Customer accounts
After a purchase, buyers come back to find an order, track a package, pay an invoice, change a card, pause a subscription, or start a return. Every Flint store has a customer account for this, and every account link in Flint's email opens it. You decide who serves it with one setting, customer_account.mode:
flint_hosted, the default
Flint's account
Flint serves the account at account.withflintpay.com, or on a subdomain of yours. You set its colors, name, and what buyers may change. There is nothing to build.
merchant_hosted
Your own account
You build the pages on /v1/me with a customer session. Flint sends every account link in its email to your URLs.
Branding and a custom domain only change Flint's account, so they need flint_hosted. What buyers may change on their subscriptions applies in both modes. customer_account is a merchant setting: locations and devices inherit it and can't override it.
What buyers get in Flint's account#
A buyer signed in to Flint's account sees everything they have with your store:
| Area | What the buyer can do |
|---|---|
| Orders | Follow delivery tracking and have the receipt sent again. |
| Returns | Start one from an order, follow it, and pay a balance the Return leaves. |
| Subscriptions | Change the card, delivery, cadence, quantity, or plan, skip or order a renewal now, and pause or cancel, within your subscription rules. |
| Invoices | Pay them and download invoice and credit note PDFs. |
| Gift cards | Save one with its code or the private link from its email to follow its balance and history. Saving doesn't change who owns the card or let the buyer spend it from the account, and several buyers can save the same card. |
| Settings | Manage saved cards, addresses, profile, email address, and email preferences, and ask you to delete their data. |
The account uses your branding and, once you add one, your domain.
Warning: Flint's account can't be framed
Flint's account sends frame-ancestors 'none', so browsers refuse to show it in an iframe, and no setting changes that. To put the account inside your own pages, build it yourself.
When your store cannot take payments#
If your merchant account is restricted or suspended, buyers can still sign in, read orders, tracking, receipts, returns, refunds, and settings, and cancel or pause a subscription. Keeping a subscription, skipping a cycle, and changes to addresses or delivery that do not charge the buyer remain available. Buyers can also resume paid time remaining on a paused subscription and replace a saved card when the payment processor still supports card setup.
Flint refuses new payments, including invoice payments, renewal payments, payment retries, return balances, and plan or quantity changes that charge now. The API returns 409 MERCHANT_NOT_READY with details[0].reason processing_restricted and a message such as "Maple Market can't take payments right now." Changes billed at a future renewal remain available.
A closed store keeps receipts and order history readable. Its account is read-only for commerce changes; those requests return 409 ACTION_NOT_ALLOWED with reason terminal_status. Sign-in, account security, and sending an existing receipt again remain available. Flint applies these rules on both its account host and your custom account domain.
How buyers get in#
Buyers sign in with their email address: Flint emails them a six-digit code and a sign-in link for your store's account.
Links in Flint's own email skip the sign-in: a receipt opens its order, a Return update opens its Return, and a subscription email opens its subscription. The failed-payment email also lets the buyer cancel, pause, or undo a scheduled cancellation without signing in, where the subscription's state and your store policy allow it. Canceling while past due ends the subscription immediately and stops further payment retries. Your own email and your own site can do the same with an access link. A returned url is a bearer credential, so send it only to the buyer and keep it out of logs.
Order and subscription access links also accept a signed-in Dashboard session for the selected merchant and environment. Any merchant member who can view the resource can create a view link. Creating a subscription_manage link requires permission to manage subscriptions. API keys and partner tokens still need the documented scopes, including commerce.subscriptions.write for subscription_manage.
When a link Flint emailed expires or runs out of opens, the buyer can ask for a new link from that page. It goes to the address on the order (also for a Return), or the subscription customer's current email, with the original permissions. Flint sends at most one replacement per 10 minutes and three per 24 hours per object. Sign-in remains another option. For a link your integration creates, the buyer asks your store for a new one. Revoked links cannot be reissued.
Customer and subscription access links accept an optional return_url for a destination on your site. Send, for example, {"return_url":"https://shop.example/account"} when creating the link. The URL must be nonempty absolute HTTPS, have no credentials, and contain at most 2,048 characters. Test mode also accepts HTTP loopback URLs. Query strings and fragments are allowed, and the host need not match the account domain. Invalid values return 400 INVALID_REQUEST with detail INVALID_VALUE at return_url. The destination belongs to the browser session the link starts, until sign-out or session end; a later sign-in by emailed code has no return URL. In Flint's hosted account, that session shows a "Back to {business name}" link in the header and a "Return to {business name}" button after the buyer cancels or pauses a subscription, both to return_url. Without one, those go to your business website (website_url), and they're hidden when you have no website either. The access-link response echoes return_url, or null when omitted. Order and Return access links always return null. Changing the destination needs a new idempotency key.
Access links exist only in Flint's account. With merchant_hosted, creating one returns 409 ACTION_NOT_ALLOWED with details[0].reason merchant_hosted_customer_accounts. Link the buyer to their order covers links in email you send yourself, and Send a buyer into Flint's account covers the sign-in from your site.
After paying in hosted checkout, View your order opens the order in your account. When the buyer confirmed their email with a code during that checkout, to save a card or use a saved one, and presses the button within an hour of confirming, it signs them in to your store's account instead, so they see the order beside everything else they have with you. That sign-in reaches your store's account only.
What your buyers see, and what they cannot do#
Plan your support around these limits of Flint's account. Each one is something buyers ask you about.
When your setup leaves a gap#
| If your store | Buyers see |
|---|---|
| Records no fulfillment for an order in Flint | The order page says you haven't started on the order yet, until a fulfillment exists. Add fulfillments and shipments, with tracking, as you ship. |
| Has no active return policy that covers an item | No way to start a return for it. The order shows only how to contact you. Returns your team creates in the Dashboard or with an API key don't need a policy. |
| Has no support email, phone, or help page on its business profile | No contact details and no Get help button. Pages link to your website when your profile lists one, and otherwise say that you haven't listed a way to reach you. Buyer email has no Reply-To. A new store sets a support email before it can take live payments; a store that went live earlier gets a prompt to add one. |
Email Flint sends for you#
Buyer email comes from Flint's sending address, with your store name as the sender name. Its Reply-To is your support email, so a buyer who replies reaches you. Without a support email, a reply goes to Flint's no-reply address and nobody reads it. Email Flint always sends lists the email your settings can't turn off, including the sign-in notice Flint sends after each sign-in with an emailed code.
Try the account in a sandbox#
Sign-in with an emailed code works only in live mode. A test buyer opens the account from a test link instead: in a sandbox, choose Preview as a test buyer in the Dashboard's buyer account settings, or create a customer access link with your test key. The account then shows that sandbox's orders and subscriptions, marked as test mode. Its branding, account name, and policy links still come from your live settings, so a sandbox's branding shows at sandbox checkout but not in the account.
What buyers can't do in the account#
- Cancel an order, or change its items or delivery address. Orders offer only a return and a resent receipt.
- Get a refund without a return. Refunds come from you, or from a Return you resolve.
- Change a subscription's plan unless the plan lists plan change options, or make any change your subscription rules turn off.
- Sign in without access to their email address. There are no passwords, so a buyer who lost access to their email needs a link from you: the Dashboard creates an account link on the customer's page, and order and subscription links on those pages. An account link lasts 15 minutes by default. Create it with
POST /v1/customers/{customer_id}/access-linksand{"expires_in_seconds": 259200}for a 72-hour link, so you can send it however reaches the buyer. When the buyer can read their email but sign-in codes don't arrive, send{"delivery":"email"}and Flint emails the 72-hour link under your store's name. - Message you from the account. It shows your support contact, and the buyer writes to you there.
Brand the account#
branding styles Flint's account and hosted checkout together:
curl -X PATCH https://api.withflintpay.com/v1/settings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"branding": {
"primary_color": "#1B4D3E",
"accent_color": "#C8873A",
"background_color": "#F4EFE5",
"text_color": "#1A1714",
"font_family": "system_serif",
"corner_radius": 4
}
}'
| Field | Accepts |
|---|---|
primary_color, accent_color, background_color, text_color | A six-digit hex color such as #1B4D3E. Send null to clear one. |
font_family | instrument_sans, system_sans, system_serif, or monospace. Send null to clear it. |
corner_radius | Pixels from 0 to 32. 0 is a square corner. |
Any other value returns 400 INVALID_REQUEST with param naming the field. The account also shows the logo and icon you set on your merchant profile with PATCH /v1/merchant.
The account title is your business name. To show another name, such as a membership program, set account_name, up to 100 characters:
curl -X PATCH https://api.withflintpay.com/v1/settings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_account": {
"presentation": { "account_name": "Cedar & Stone Supply Club" }
}
}'
Send "account_name": null to go back to your business name. Flint's account shows the Powered by Flint credit unless your agreement with Flint removes it.
Serve it on your own domain#
Flint's account stays on account.withflintpay.com until you give it a subdomain of yours, such as account.cedarandstone.com. The hostname is a custom domain with type customer_account, and it needs the custom domain add-on, bought on the dashboard's Flint billing page:
curl -X POST https://api.withflintpay.com/v1/custom-domains \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: account-domain-1" \
-d '{ "type": "customer_account", "hostname": "account.cedarandstone.com" }'
The response lists the CNAME and TXT records to publish in dns_records. Publish them at your DNS provider, and the domain's status becomes active once they resolve and its certificate issues. Custom domains covers the records, status reasons, checking again, removing a hostname, and every error.
What changes for buyers:
- Account links in Flint's email use your hostname once the domain is
active, and Flint's address until then. If an active hostname later stops working, new links go back to Flint's address. - Buyers sign in again on their first visit to your hostname. Sessions don't move between
account.withflintpay.comand your domain. - The hostname serves only the customer account. Hosted checkout, payment links, and invoice payment pages use a separate custom domain with
typecheckout.
Build your own account instead#
Set mode to merchant_hosted when you want buyers in your own pages. Flint then sends every account link in its email to merchant_account_url, or to the page a route template names:
curl -X PATCH https://api.withflintpay.com/v1/settings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: account-url-1" \
-d '{
"customer_account": {
"mode": "merchant_hosted",
"merchant_account_url": "https://cedarandstone.com/account",
"route_templates": {
"order": "/orders/{resource_id}",
"subscription": "/subscriptions/{resource_id}",
"return": "/returns/{resource_id}",
"invoice": "/invoices/{resource_id}",
"email_preferences": "/email-preferences"
}
}
}'
merchant_account_url is required. It must be an absolute https:// URL on a hostname you own, not an IP address or a withflintpay.com hostname, with no credentials or fragment, up to 2,048 characters. In a sandbox, a loopback URL such as http://localhost:3000/account also works, so sandbox email opens an account running on your machine.
Saving the URL registers its hostname as a payment method domain, so you don't register it first. The URL must be on a payment method domain that is active, or on a subdomain of one. A new registration can still be waiting on its wallet check, and the save then returns 409 ACTION_NOT_ALLOWED with details[0].reason status_not_reached. Find the registration with GET /v1/payment-method-domains, check it again once the hostname serves your site, then save the URL again. The refusal's next_steps says whether you can reuse its Idempotency-Key. A loopback URL in a sandbox skips the registration.
Route templates are optional paths under merchant_account_url. A link for a resource without a template lands on merchant_account_url itself.
| Template | Rule | Example |
|---|---|---|
order, subscription, return, invoice | Starts with / and contains {resource_id} exactly once | /orders/{resource_id} |
email_preferences | Starts with / and contains no placeholder | /email-preferences |
No template can hold a scheme, query, fragment, or .. segment. Send null for a template to remove it.
How Flint's email reaches your pages#
Account links in Flint's email point at Flint, which sends the buyer to whatever customer_account says at the moment they click. Changing the mode or a route template also repoints email you sent last month.
- Buyer sends opens View order in a receipt to Flint
- Flint returns redirect to your order route with flint_ query parameters to Buyer
- Buyer sends GET /account/orders/ord_... to Your site
- Your site returns sign-in, then the order read through /v1/me to Buyer
The link carries no credential. You sign the buyer in with your own login, create a customer session for them, and read the resource through /v1/me. Point Flint's email at your pages lists the flint_ parameters and how to keep them through your sign-in.
What else changes with your own account#
- Customer email. You own the buyer's identity, so
PATCH /v1/customers/{customer_id}can set, change, or clear a customer'semail. See Who may change a customer's email. - Access links and cards saved with Flint are only in Flint's account.
- Concurrent edits. Flint's account saves profile, address, and email preference changes against the
versionthe page loaded, and asks the buyer to reload when one changed elsewhere. Do the same: see Avoid overwriting another change.
Build your own customer account covers the pages themselves.
Switching between modes#
Each mode accepts only its own fields, so a half-applied switch fails instead of saving a setting that does nothing. presentation belongs to flint_hosted, and merchant_account_url and route_templates belong to merchant_hosted. Sending a field for the other mode, in the same request or while the other mode is saved, returns 400 INVALID_REQUEST with detail code NOT_ALLOWED.
Changing mode drops the other mode's fields: switching to merchant_hosted clears presentation, and switching back to flint_hosted clears merchant_account_url and route_templates. buyer_capabilities stays. Sending "customer_account": null removes the whole object and returns you to Flint's account with default settings.
Archive a customer_account custom domain before you switch to merchant_hosted or send "customer_account": null. While one isn't archived, both return 409 RESOURCE_IN_USE. See Before you change the customer account mode.
Errors when you save customer_account#
What buyers can do to their subscriptions#
customer_account.buyer_capabilities sets what a buyer may change on their own subscriptions. It applies in Flint's account and to every /v1/me request your own account makes with a customer session, in either mode:
curl -X PATCH https://api.withflintpay.com/v1/settings \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer_account": {
"buyer_capabilities": {
"cancellation_timing": "buyer_chooses",
"pause": { "enabled": true, "max_cycles": 3 },
"cancellation_reasons": ["too_expensive", "unused", "switched_service", "other"],
"retention_offer": { "kind": "pause_instead", "pause_cycles": 2 },
"can_update_delivery": true,
"skip": { "enabled": true, "max_consecutive_skips": 2 }
}
}
}'
| Field | Default | What it controls |
|---|---|---|
cancellation_timing | end_of_period | end_of_period ends a buyer's cancellation at the subscription's next scheduled time: the end of a trial, the end of the billing period, or the next payment retry of a past-due subscription. buyer_chooses also lets the buyer end it right away. A subscription with no scheduled time, such as a paused one, always ends right away. |
pause.enabled | true | Whether buyers may pause. |
pause.max_cycles | no limit | The longest pause a buyer may choose, 1 to 12 billing periods. With a limit set, every buyer pause names its length. Without one, a buyer can also pause until they resume. |
cancellation_reasons | [] | Up to 8 of too_expensive, missing_features, switched_service, unused, customer_service, too_complex, low_quality, and other, each once, in the order buyers see them. Empty asks nothing. |
retention_offer.kind | none | pause_instead offers a pause before the buyer cancels. It needs pause.enabled. |
retention_offer.pause_cycles | none | How many billing periods the offered pause lasts, 1 to 12 and at most pause.max_cycles. Required with pause_instead, and not allowed with none. |
can_update_delivery | true | Whether buyers may change the shipping address and delivery method of a subscription that ships. |
skip.enabled | true | Whether buyers may skip their next renewal. |
skip.max_consecutive_skips | no limit | How many renewals in a row a buyer may skip, 1 to 12. Every skip counts, including yours, and the next paid renewal resets the count. |
A value outside these rules returns 400 INVALID_REQUEST with param naming the field.
buyer_capabilities is written as a whole. Each update replaces the stored value, and every field it leaves out goes back to its default, so send every field you want to keep. GET /v1/settings/effective returns it with each default filled in.
Buyers can always cancel: no setting removes the cancel button, and a buyer never has to give a reason or accept an offer first. Your API key isn't bound by any of these fields, so your support team can still pause for six months or cancel on the spot.
How the rules reach your pages#
A subscription read through a customer session lists its buyer_actions, worked out from these rules and the subscription's state:
pausereadsstore_policywhen pausing is off,update_deliverywhencan_update_deliveryisfalse, andskipwhen skipping is off.skipreadslimit_reachedonce the buyer has skippedmax_consecutive_skipsrenewals in a row.- An available
cancelentry carries thecancellation_reasonsto offer in your order, atimingofend_of_period,buyer_chooses, orimmediately, and aretention_offerwhen your offered pause is available now.timingreadsimmediatelywhen the subscription has no scheduled time to wait for, whatevercancellation_timingsays. - An available
pauseentry carriesmax_pause_duration_cycleswhen you setmax_cycles. cancel_plan_changelets a buyer keep the current plan by sendingscheduled_plan_change: null. It is available for a buyer-scheduled change. A merchant-scheduled change reportsstore_policy; trying to clear it returns409 ACTION_NOT_ALLOWED, reasonnot_offered.- A pending plan change makes
update_billing_interval,update_quantity, andswap_itemsunavailable with reasonnot_in_state. change_plandoesn't come frombuyer_capabilities. It follows theplan_change_optionson the subscription's plan:store_policywhen no option has a usable target, andnot_in_statewhen the subscription's state rules out every option. See Let buyers change plans.
Every subscription includes the required nullable scheduled_plan_change snapshot. period_end keeps the current plan until the next charged renewal, while next_renewal switches immediately. The snapshot's effective_at follows the next billing date and can be null; the buyer projection includes the target subscription_plan summary. See Schedule or clear a pending change.
Build your controls from these entries rather than from your settings. Build cancel and pause controls shows each one, and Buyer self-service lists the /v1/me routes for delivery, cadence, quantity, item swaps, plan changes, skips, and ordering now.
Because your settings can change between a page load and a click, Flint checks them again on every request. An action you turned off returns 409 ACTION_NOT_ALLOWED with details[0].reason not_offered. A skip past your limit returns 409 LIMIT_REACHED with details[0].reason consecutive_skips. A pause longer than max_cycles, a pause with no length when a limit is set, or a reason not in your list returns 400 INVALID_REQUEST with param naming the field.
Webhooks for buyer changes#
A buyer's changes send the same webhook events as yours. cancellation_details.requested_by on the cancellation event and delivery.updated_by on the subscription say buyer when the buyer made the change.
Read customer verifications#
When you link a buyer's guest purchases, your server can check the current status with GET /v1/customer-verifications/{customer_verification_id}. To list a customer's verifications, use GET /v1/customer-verifications?customer_id={customer_id}; customer_id is required. Both need an API key with customers.read or customers.write.
Flint computes status when you read: pending, confirmed, used, or expired. A confirmed verification can link purchases for 15 minutes. Reading before linking is optional; linking checks the current state. Flint deletes a verification 8 days after its code and its time to link have expired. Customer deletion also removes it. After deletion, the single read returns 404 RESOURCE_NOT_FOUND, and the list no longer includes it.
Who may change a customer's email#
Who may change a customer's email depends on the mode.
In Flint's account, you can set, correct, or clear an email until the buyer authenticates or verifies ownership of it. After that, replacing it requires confirmation by the buyer. PATCH /v1/customers/{customer_id} with a different email, a change of case only, or null returns 409 ACTION_NOT_ALLOWED with details[0].reason managed_externally. The buyer changes it in the account's settings, or through a page of yours with a customer session:
POST /v1/me/email-change-requestswithnew_email. Flint emails a six-digit code to the current address and another to the new one. A customer with no email on file confirms only the new address, and the response'scurrent_email_confirmation_requiredsays which applies. A buyer can start three changes in 15 minutes.POST /v1/me/email-change-requests/{email_change_request_id}/confirmwithnew_email_code, andcurrent_email_codewhen it is required. Nothing changes until both addresses are confirmed.
A wrong code returns 400 INVALID_REQUEST with param current_email_code or new_email_code. When both are wrong, the current address is reported first.
A confirmed change ends the buyer's access to your store on all devices. Flint revokes the customer's sessions and emailed access links at your store, including the session that confirmed. The buyer stays signed in to Flint and their other stores. To open your store again, they sign in with the new email. Email change uses codes only lists the errors confirmation can return.
Staff can also start a change when the current inbox is mistyped or inaccessible. Send POST /v1/customers/{customer_id}/email-change-requests with new_email; Flint emails a confirmation link to the new address, valid for seven days. The current inbox needs no code. Nothing changes until the new inbox confirms. Read pending requests or cancel one through the customer email change routes.
A confirmed staff change affects only your store's customer and revokes that customer's sessions and emailed links. Cards saved with Flint never move. The old address receives a store-branded notice with your contact details, no new address, and no undo link. An email another customer at your store already uses is refused.
In your own account, you own the buyer's identity, so PATCH /v1/customers/{customer_id} can set, change, or clear email.
A direct email change with PATCH /v1/customers/{customer_id} revokes the customer's sessions and emailed access links. In flint_hosted mode, use an email change request once the buyer has authenticated or verified ownership, including when setting a missing email. A paid checkout session can also fill a missing email: when the order's customer has no email, Flint sets it to the email the checkout collected, unless another customer already has that address. It never replaces an email the customer already has.
If you later switch to flint_hosted, the email on each customer becomes the address that buyer signs in with, the same as the emails on customers you create.
Account deletion#
A buyer can ask to delete their data from Flint's account, or from yours with POST /v1/me/deletion-requests. The request comes to you: you approve or reject it, and webhook events report each step.
Completion anonymizes the customer rather than erasing your history: orders, payments, and refunds stay, without the buyer's identity, which is what retention_policy retain_required_commerce_records means. Email preferences are kept separately, so Flint keeps honoring an unsubscribe. The customer stays readable by ID with status deleted, and GET /v1/customers leaves it out unless you filter with status=deleted. If you keep your own copy of buyer data, delete it when customer.deleted arrives.
Customer deletion requests covers approval, the subscriptions and saved cards that block it, requests you open for a buyer, and what Flint keeps.
Cards saved with Flint#
A buyer who signs in to Flint's account with an emailed code also sees the cards they saved with Flint, beside the cards saved at your store. This works on your custom domain too. To use one for a subscription, the buyer agrees to save a copy at your store, and may be asked to authenticate.
The store copy is a payment method of your store with its own consent, independent of the card saved with Flint, and your subscriptions can charge it without the buyer present. Removing the card saved with Flint, or withdrawing consent for your store, stops the copy from working right away. Some cards ask the buyer to authenticate again on a later charge; the card-update link Flint sends after a failed renewal brings them back.
On /v1/me/payment-methods, each card carries saved_with, flint or store; accept values you don't recognize. The /v1/me/flint-wallet/cards routes accept only the session from an emailed-code sign-in to Flint's account. Customer sessions you create, access links, checkout sessions, and API keys get 404, so your own account shows only your store's cards.
Next steps#
Build your own customer accountCustomer sessionsCustom domainsCustomer email deliveryCards saved with Flint when changing email#
An email change applies to this store's customer account. Links in earlier emails stop working after confirmation. Other stores keep the previous email. The Flint account and its saved cards also keep the previous email unless the buyer asks to move them.
Before sending codes, an eligible Flint-hosted account can read GET /v1/me/flint-wallet/cards. When at least one card is returned, offer an unchecked choice to also move the saved cards. Keep the choice until confirmation; don't check the new email for a wallet first.
Send optional move_flint_wallet: true with the codes to POST /v1/me/email-change-requests/{email_change_request_id}/confirm only if the buyer chose to move the cards. Omission and false keep them at the previous email. The confirm result includes flint_wallet_outcome for these sessions when the previous email had saved cards:
| Outcome | What happened |
|---|---|
moved | The cards now belong to the new email. |
kept | The cards stayed at the previous email because no move was requested. |
new_email_has_wallet | The new email already has a Flint wallet, so nothing moved. |
Only a customer session from a live email-code sign-in at a Flint-hosted account can send the choice or receive the outcome. A merchant-created session must omit move_flint_wallet, including false; sending it returns 400 INVALID_REQUEST, detail NOT_ALLOWED, at that field. Merchant credentials never learn whether the buyer has a Flint wallet. Creating an email-change request is unchanged.