Skip to content

Customers

Customers are reusable buyer profiles: contact details, billing and shipping addresses, tax exemption, and your own cross-reference via external_reference_id. Attach a customer to orders, invoices, and subscriptions to keep purchase history connected to one identity, and to enable repeat billing with saved payment methods.

Creating or updating a customer email requires one bare address with no display name or whitespace and a valid dotted host, up to 320 characters. Plus addressing and internationalized domain names are supported. Receipt-specific fields retain their smaller limits. Email-based sign-in, verification of existing customers, lookups, and filters keep their existing validation rules. Checkout verification that creates a new customer applies the same email rules as creating a customer directly.

Your server manages customers with a secret or restricted key. The buyer reads and edits their own profile through /v1/me with a customer session; see Customer account.

Routes by task#

  • Create, find, and update customers with /v1/customers. Build your own customer account shows the flow for a store with its own sign-in.
  • Record exemption certificates, reasons, and coverage with /v1/customers/{customer_id}/tax-exemptions. See Customer tax exemptions. Flint applies them to a customer's sales when tax_exempt is false.
  • Save addresses and choose the billing and shipping defaults with /v1/customers/{customer_id}/addresses. See Saved addresses.
  • Sign a buyer in to Flint's hosted account from your site with an access link.
  • Attach guest checkouts to a customer once the buyer proves they own the email, with /v1/customer-verifications and link-guest-purchases. See Link a buyer's guest purchases.
  • Honor email opt-outs in email you send with GET /v1/customers/{customer_id}/email-preferences or POST /v1/email-preferences/lookup. See Email preferences.
  • Honor an emailed unsubscribe link without asking the buyer to sign in, with /v1/email-preference-links. See Unsubscribe without sign-in.
  • Erase a buyer's data on request with /v1/customer-deletion-requests. See Customer deletion requests.

Customer status#

status on customer
Final values do not change again
  • active
    You can change the customer and attach it to new purchases.
  • deletion_processing
    You approved a deletion request and Flint is erasing the customer's personal data. Every change returns 409 ACTION_NOT_ALLOWED with details[0].reason: in_progress.
  • deletedFinal
    The personal data is erased. The customer stays readable by ID, named "Deleted customer" with its personal fields null, so the orders, invoices, and payments that reference it keep working. It can't be changed or restored.

Deletion requests return requested_by (buyer, merchant, or null for an unknown pre-existing source), response_due_at (one calendar month after the request), and decided_at (the latest approve or reject decision, null while pending or unknown for an older request). resolved_at records the later completion or failure, or the rejection itself. Resolving with decision: reject accepts an optional trimmed decision_reason of 1 to 500 characters, visible to the buyer. It is refused with approve before any change. The reason is erased if the customer is later deleted.

While a deletion request is pending_review, GET and list responses include blocking_resources and blocking_resource_count, computed at read time. The references use the same resource_type and resource_id fields as the RESOURCE_IN_USE error: subscriptions that are not canceled, and payment methods that are active or pending. The array includes up to 25 of each type, ordered by type and ID; the count includes every blocker. When nothing blocks approval, they are [] and 0. Both fields are absent on other statuses. Approval checks the current blockers again. To let Flint clear them during approval, set cancel_subscriptions and remove_payment_methods to true. Read canceled_subscription_ids and removed_payment_method_ids to follow that work.

No endpoint deletes a customer outright. To honor a deletion or privacy request, create a deletion request with POST /v1/customer-deletion-requests and approve it. What Flint deletes and what it keeps lists every field the erasure clears and the records it leaves in place.

  • customer.created
    A new customer exists
  • customer.updated
    A change advanced the customer's version, including a new default address or payment method, and approval of a deletion request
  • customer.deleted
    The personal data is erased and status is deleted

Phone numbers#

phone takes an E.164 number: a leading +, then the country code and number as digits only, matching ^\+[1-9][0-9]{1,14}$. Create and update trim surrounding whitespace first, then reject spaces, hyphens, dots, and parentheses inside the number with 400 INVALID_REQUEST. Format phones from another system before you send them: +14155550100, not +1 (415) 555-0100 or 14155550100. Leave out national trunk prefixes, so a UK number is +442079460958, not +4402079460958. Flint stores the trimmed number as sent and does not check for trunk prefixes, and the exact phone filter matches that string.

Create or find a customer#

email is optional, so you can create a customer at the register without one. When present, it is unique among the environment's customers, compared without regard to case. Accents count, so josé@example.com and jose@example.com are different addresses. A deleted customer gives up its email, so a new customer can use the address.

When no customer has the email, Flint creates one and returns 201. When another customer already has it, on_email_conflict decides the answer:

on_email_conflictResponse
error, or omitted409 ALREADY_EXISTS with param: "email". details[0].current_resource names the customer that has the email.
return_existing200 with that customer, unchanged

Use return_existing to find or create a customer in one call, such as when a buyer first signs in to your site. It requires email, finds the customer with the same rule as above (case is ignored, accents are kept), and never copies the request's other fields onto the customer it returns, so PATCH that customer if they differ. When the customer that has the email is being deleted, it returns 409 ACTION_NOT_ALLOWED with details[0].reason: in_progress.

cURL
curl -X POST https://api.withflintpay.com/v1/customers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: signup-user-8421" \
  -d '{
    "email": "maya@example.com",
    "name": "Maya Chen",
    "external_reference_id": "user_8421",
    "on_email_conflict": "return_existing"
  }'
Response
{
  "data": {
    "customer_id": "cus_1kmn0aExample",
    "merchant_id": "mer_1kmn0aExample",
    "status": "active",
    "name": "Maya Chen",
    "email": "maya@example.com",
    "phone": null,
    "external_reference_id": "user_8421",
    "internal_note": null,
    "segment": null,
    "price_list_id": null,
    "tax_identity": null,
    "billing_address": null,
    "shipping_address": null,
    "default_payment_method_id": null,
    "version": 1,
    "created_at": "2026-10-28T17:00:00Z",
    "updated_at": "2026-10-28T17:00:00Z"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Update a customer#

PATCH /v1/customers/{customer_id} changes only the fields you send.

  • Clear a value with null. This works for name, phone, internal_note, external_reference_id, segment, price_list_id, default_payment_method_id, default_invoice_payment_term_id, tax_identity, and metadata, and for email when you can change it. Merchant responses always include name, email, phone, internal_note, external_reference_id, segment, and price_list_id, with null when the customer has no value.
  • Email stays on subscribed customers. A customer with a subscription that isn't canceled can't have its email cleared.
  • Booleans take true or false. null for tax_exempt or is_merchant_verified returns 400 INVALID_REQUEST with detail INVALID_VALUE.
  • Some fields are set elsewhere. billing_address and shipping_address follow the saved address defaults, and test_clock_id is set only at creation. Sending any of them returns 400 INVALID_REQUEST with detail UNKNOWN_FIELD.

tax_exempt: true gives the customer's orders, checkout sessions, invoices, and subscription renewals zero tax in both automatic and external mode; see Tax-exempt customers. tax_identity is the legal name, address, and tax IDs printed on invoices and credit notes. With automatic tax, a business buyer's VAT or GST number in tax_ids also decides whether a cross-border sale is a reverse charge; VAT, GST, and international tax has the rules.

Avoid overwriting another change#

Every change advances the customer's version and sends customer.updated. A PATCH that changes no field, such as the same request sent again, keeps the version and sends no event. To refuse a change when someone else updated the customer after you read it, send the version you read as expected_version. A stale value returns 409 VERSION_CONFLICT and changes nothing: read the customer again, reapply your change, and send it with the new version and a new Idempotency-Key.

expected_version is required when you clear tax_identity or replace tax_identity.tax_ids, so a list of tax IDs is never replaced on top of one you haven't seen.

When another write lands while yours is running and your expected_version, if any, still matches, Flint returns 409 CONCURRENT_MODIFICATION and changes nothing. Send the same request again.

Who can change the email#

It depends on your store's customer_account.mode:

ModeChanging email with PATCH
flint_hosted, the defaultYou can set, correct, or clear an email until the buyer authenticates or verifies ownership of it. Once the identity is protected, a different email, a change of case only, or null returns 409 ACTION_NOT_ALLOWED with details[0].reason: managed_externally. To start the change for the buyer, create a customer session and call POST /v1/me/email-change-requests; the buyer confirms it with the codes Flint emails them.
merchant_hostedYou own the buyer's identity, so you can set, change, or clear the email. Changing the email ends customer sessions and access links for the old address, and cancels pending email changes.

New customers start without a protected hosted identity. Successful hosted sign-in, opening a customer access link, or confirming an email ownership code protects that identity permanently, even after sign-out. Merchant creation, a merchant verification label, and sending an unused code or link do not protect it. Existing customers whose sign-in history is unknown remain protected, including customers without a current email.

A successful email correction ends customer sessions and access links issued for the old address. Previously sent invoices and receipts keep their original recipients and snapshots; Flint does not resend them automatically.

Clearing an email while the customer has a subscription that is not canceled returns 409 CUSTOMER_EMAIL_REQUIRED. Cancel those subscriptions before clearing the email.

In either mode, an email another customer has returns 409 ALREADY_EXISTS. Who may change a customer's email covers the buyer's side.

A paid checkout session can also fill a missing email. When the order's customer has no email, Flint sets it to the buyer_email the checkout collected once the payment settles. Flint does this before it sends the buyer's notices or provisions a subscription, so they have an address. It never replaces an email the customer already has, and it doesn't change any other customer field. When another customer in the environment already has the address, the customer stays without an email. Paying an order with an API key and no checkout session never changes the customer.

Default payment method#

default_payment_method_id names the saved card that a new subscription or an automatic invoice charges when the request doesn't name one. Set it with PATCH /v1/customers/{customer_id}, or let the buyer set it with PATCH /v1/me, and send null to clear it. The payment method must belong to the customer, be active, and have usage: "off_session". Each payment method reports whether it is the default in is_default.

Changing the default, or deleting the payment method that is the default, advances the customer's version and sends customer.updated. Sending the default the customer already has changes nothing. Flint never picks a default for you, even after the first card or a deletion. Choose a default card lists the errors a payment method that doesn't qualify returns.

Direct price list#

Set price_list_id when you create or update a customer to assign a wholesale price list in the same merchant environment. Send null with PATCH to clear the assignment; omit it to leave the assignment unchanged. Merchant responses always include price_list_id, with null when none is assigned. Customer sessions cannot read or change it.

You can assign an inactive list, but it does not apply while inactive. Assigning an archived list returns 409 ACTION_NOT_ALLOWED with reason archived. A missing list, including one in another merchant or environment, returns 404 RESOURCE_NOT_FOUND. Both errors name price_list_id. A list assigned to any customer cannot be archived until those assignments are cleared. Erasing a customer clears its assignment.

Find customers#

GET /v1/customers takes two kinds of filter:

  • query is for a search box. It matches part of a name, email, phone number, or external_reference_id, or the start of a customer_id.
  • Exact filters are for values your code already holds: email (the whole address after trimming, ignoring case and keeping accents), phone, external_reference_id, segment, price_list_id, is_merchant_verified, and in a sandbox test_clock_id. segment and is_merchant_verified are labels you set for promotion and delivery rules; Flint never sets them.

All filters combine with each other, with status, and with the created_* and updated_* ranges before pagination. Send segment, price_list_id, phone, and is_merchant_verified once each. An empty, repeated, or malformed value returns 400 INVALID_REQUEST with detail INVALID_VALUE and param naming the filter. A valid value that matches no customer returns an empty page.

phone takes a full E.164 number, such as +14155551234. Encode the plus sign as %2B, as --data-urlencode does here; an unencoded + reads as a space.

cURL
curl -G https://api.withflintpay.com/v1/customers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "segment=wholesale" \
  --data-urlencode "phone=+14155551234" \
  --data-urlencode "expand=default_payment_method"

GET /v1/customers and GET /v1/customers/{customer_id} accept expand. Each path needs customers.read, and some need more:

expandAddsAlso needs
default_payment_methodThe payment method that default_payment_method_id names, or null when there is no defaultpayments.payment_methods.read
receivablesThe customer's outstanding and overdue invoice balances, by currencyNothing more

A key without a scope a path needs gets 403 INSUFFICIENT_SCOPE with param: "expand". Expand related records covers how Flint batches each page, keeps page tokens valid, and reports failures.

Saved addresses#

To save addresses in the same call that creates a customer, send addresses on POST /v1/customers. Each entry has the same shape as the address-book create request. The customer and all entries are saved together, or none are saved. At most one entry can have is_default_billing: true and at most one can have is_default_shipping: true; one entry can have both. The defaults appear in the create response's billing_address and shipping_address. Omit addresses or send [] to create without saved addresses.

JSON
{
  "email": "buyer@example.com",
  "addresses": [{
    "recipient_name": "Taylor Smith",
    "address": {"line1": "1 Main St", "city": "Austin", "state": "TX", "postal_code": "78701", "country": "US"},
    "is_default_billing": true,
    "is_default_shipping": true
  }]
}

When on_email_conflict is return_existing and the customer already exists, Flint returns that customer without adding or changing addresses. Submitted entries must still be valid. Invalid subdivisions return 400 INVALID_REQUEST with a path such as addresses[0].address.state.

A customer's addresses live under /v1/customers/{customer_id}/addresses, and the buyer manages the same list through /v1/me/addresses. Saved addresses are the only way to write a customer's addresses: the customer's billing_address and shipping_address are read-only copies of the saved addresses marked is_default_billing and is_default_shipping. Flint taxes an order at the billing default when the order has no other tax location, and checkout prefills the shipping default.

When you create or replace a saved address, address.state must name a subdivision of address.country for the United States and Canada. Send a code (TX, ON), an ISO-prefixed code (US-TX, CA-ON), or a name (Texas, Ontario, Québec); matching ignores case and surrounding whitespace. US territories and military codes AA, AE, and AP are accepted. Flint preserves the value you send after trimming surrounding whitespace. A value that doesn't belong to that country returns 400 INVALID_REQUEST, with param: address.state and detail code INVALID_VALUE. Correct the state or country before sending the address again.

US addresses require state and postal_code. For other countries, omit state when the address has none. Countries other than the United States and Canada have no subdivision membership check. Flint doesn't check whether a postal code exists.

An address is a default only when you say so, even the customer's first. Each of these changes the customer's copy, advances its version, and sends customer.updated:

YouThe customer's billing_address or shipping_address
Send is_default_billing or is_default_shipping as true when you create or update an addressCopies this address. The address that held the default loses it.
Send false for a default the address holdsBecomes null
Change the address of a defaultFollows the new address
Delete a defaultBecomes null. Flint doesn't promote another address, so set a new default when orders and checkout still need one.

When the customer's copy already matches, such as a default moving to another address with the same postal address, its version stays and no event is sent.

cURL
curl -X PATCH https://api.withflintpay.com/v1/customers/cus_1kmn0aExample/addresses/caddr_1kmn0aExample \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: default-billing-caddr-1kmn0a-1" \
  -d '{ "expected_version": 2, "is_default_billing": true }'
Response
{
  "data": {
    "customer_address_id": "caddr_1kmn0aExample",
    "customer_id": "cus_1kmn0aExample",
    "recipient_name": "Maya Chen",
    "label": "Home",
    "address": {
      "line1": "2100 Main St",
      "city": "Irvine",
      "state": "CA",
      "postal_code": "92614",
      "country": "US"
    },
    "is_default_billing": true,
    "is_default_shipping": true,
    "version": 3,
    "created_at": "2026-10-20T16:00:00Z",
    "updated_at": "2026-10-28T17:05:00Z"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4E"
}

Each saved address has its own version, starting at 1. Updating the address, making it a default, and losing a default to another address each advance it. expected_version on PATCH, or as a query parameter on DELETE, checks the address's version, not the customer's. A stale value returns 409 VERSION_CONFLICT with resource_type: "customer_address" and the current version in details[0].current_version, and nothing changes. Recover the same way as for the customer.

Email preferences#

GET /v1/customers/{customer_id}/email-preferences reads the preferences for the customer's current email address. POST /v1/email-preferences/lookup reads them for an address, including a guest's, with {"email": "maya@example.com"}. Both require customers.read and return the same CustomerEmailPreferences shape:

JSON
{
  "data": {
    "customer_id": "cus_1kmn0aExample",
    "email": "maya@example.com",
    "shipping_updates": false,
    "checkout_reminders": true,
    "version": 4
  },
  "request_id": "req_01KWM6P19KJRRC7B8BBEAQQ1KD"
}

shipping_updates covers shipping updates and checkout_reminders covers checkout reminders. Each is true until the buyer turns it off. When one is false, Flint stops sending that kind of email, and you must skip it in email you send too. Receipts and other transactional email are unaffected by these preferences.

Preferences belong to the address, so they cover guest checkouts and other customers using the same address in this environment. Lookup trims surrounding spaces and ignores case when matching. When a customer matches, lookup returns that customer's customer_id and preference version; when several match, Flint chooses one consistently. For a guest, both fields are null. A category with no stored choice is enabled. Keep the address in the lookup's JSON body.

The customer read returns 404 RESOURCE_NOT_FOUND with param: customer_id for an unknown customer or one in another merchant or environment. A customer without an email returns 404 with reason email_missing. A deleted or anonymized customer also returns 404. Preferences stay readable while deletion is processing. Lookup still works for an address after deletion and honors its earlier opt-outs.

The preference version is separate from the customer's version. It advances when either category changes or the customer's email changes. customer_email_preferences.updated carries the full preference snapshot from the customer read. Repeating an unchanged preference sends no event, and neither do guest preference changes or customer deletion. Removing the customer's email also sends no preference event, because the preference read then returns 404. Subscribe when you maintain your own suppression list, and look up preferences before each guest send.

These merchant routes only read preferences. The buyer changes them through /v1/me/email-preferences or an unsubscribe link.

POST /v1/customers/{customer_id}/access-links creates a link that signs the buyer in to your Flint-hosted customer account as this customer. It requires customers.sessions.write. The body is optional. The default purpose, customer_account, opens account home. Use payment_method_setup to open Add card for your store. Both delivery modes return the selected purpose.

With the default delivery: "link", Flint returns the single-use url for your server to send. It works for 15 minutes by default. Send expires_in_seconds: 259200 for a 72-hour link. Anyone holding the link can sign in as the customer. Share it only with that buyer and keep it out of logs.

cURL
curl -X POST https://api.withflintpay.com/v1/customers/cus_1kmn0aExample/access-links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: account-link-cus-1kmn0a-1" \
  -H "Content-Type: application/json" \
  -d '{"return_url":"https://shop.example/account"}'
Response
{
  "data": {
    "url": "https://account.withflintpay.com/auth#token=ptok_example",
    "delivery": "link",
    "purpose": "customer_account",
    "expires_at": "2026-10-28T17:15:00Z",
    "return_url": "https://shop.example/account"
  },
  "request_id": "req_01KWM6P19KJRRC7B8BBEAQQ1KC"
}

return_url must be a nonempty absolute HTTPS URL without credentials, up to 2,048 characters. In test mode, HTTP loopback URLs also work. Query strings and fragments are allowed; the host need not match your account domain. An invalid value returns 400 INVALID_REQUEST with detail INVALID_VALUE and param: return_url. The response always includes return_url, with null when omitted. It belongs to the browser session the link starts; a later sign-in by emailed code has no return URL.

A retry with the same Idempotency-Key returns the original result under the one-time secret rules. The retry keeps the link's original lifetime and open limit. Use a new key to change the purpose, delivery or return destination. Without a key, each call creates a new link.

Send delivery: "email" and Flint queues a store-branded email to the customer's current address. The customer_account purpose sends a sign-in email and payment_method_setup sends a card request. An emailed link works once within 72 hours. With email delivery, omit expires_in_seconds or set it to 259200.

cURL
curl -X POST https://api.withflintpay.com/v1/customers/cus_1kmn0aExample/access-links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Idempotency-Key: account-link-cus-1kmn0a-2" \
  -H "Content-Type: application/json" \
  -d '{"delivery":"email"}'
Response
{
  "data": {
    "delivery": "email",
    "purpose": "customer_account",
    "sent": true,
    "recipient_email": "j***@example.com",
    "return_url": null
  },
  "request_id": "req_01KWM6P19KJRRC7B8BBEAQQ1KC"
}

sent: true means Flint accepted the email for delivery. The response includes a masked recipient_email and omits url and expires_at. Replaying the request returns the original acknowledgement without queuing another email.

  • HTTP 404
    No customer has that ID in this environment. param is customer_id.
  • HTTP 409
    Reason merchant_hosted_customer_accounts: your store hosts its own customer account, so there is no Flint account to sign in to. Create a customer session for your own pages instead. Reason in_progress: the customer is being deleted or is deleted.
  • HTTP 409
    The store can't save cards in this environment. Check accept_card_payments in readiness.capabilities on GET /v1/merchant.
  • HTTP 503
    SERVICE_UNAVAILABLERetry the same request
    With reason template_not_configured, Flint can't email card requests. Create a link with delivery: "link" and send it to the customer.

Customers on a test clock#

In a sandbox, POST /v1/customers takes an optional test_clock_id to create the customer on a test clock. The customer and every subscription created for them read the clock's time instead of real time, so you can advance the clock to test trials, renewals, and failed payments. Test subscriptions and renewals walks through one.

cURL
curl -X POST https://api.withflintpay.com/v1/customers \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: customer-clock-001" \
  -d '{ "email": "ada@example.com", "test_clock_id": "tclk_1kmn0aExample" }'

A customer stays on the clock it was created on: it can't move to another clock or come off one. Merchant responses include test_clock_id only for customers created on a clock. GET /v1/customers?test_clock_id=tclk_... lists the customers on one clock.

Creating a customer on a clock can return:

  • HTTP 403
    Reason test_mode_required: a live credential sent test_clock_id, in the body or as a list filter. Use a test key.
  • HTTP 404
    The clock isn't in this sandbox. param is test_clock_id.
  • HTTP 409
    The clock can't take new customers. resource_type is test_clock, param is test_clock_id, and current_status is the clock's status. Reason in_progress: the clock is advancing, so wait for test_clock.ready and retry. Reason terminal_status or archived: the clock is failed or archived, so create a new clock.
  • HTTP 409
    on_email_conflict: "return_existing" matched a customer on a different clock, or one of the two customers has no clock. Returning that customer would run your test at the wrong time, so Flint answers as it does for on_email_conflict: "error", with param: "email" and the existing customer named.

Change a customer's sign-in email#

For a Flint-hosted account, use POST /v1/customers/{customer_id}/email-change-requests when staff need to correct a mistyped or inaccessible address. Send new_email, a bare email address of at most 320 characters. Flint emails that address a link valid for seven days. Nothing changes until its owner presses Confirm. API keys and partner app tokens record requested_by: integration; Dashboard staff record merchant. Buyer requests record buyer.

cURL
curl -X POST https://api.withflintpay.com/v1/customers/cus_01ARZ3NDEKTSV4RRFFQ69G5FAV/email-change-requests \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: correct-customer-email-8421" \
  -d '{"new_email":"maya.chen@example.com"}'

Creation returns 201 with an EmailChangeRequest. Only one request can be pending per customer, shared with the buyer's own email-change flow: a newer request cancels the previous one. Creating a change requires customers.write. Three attempts per customer are allowed in 15 minutes, shared with buyer attempts; staff may start 30 per merchant environment per hour. A throttle returns 429 RATE_LIMIT_EXCEEDED with Retry-After.

Use GET /v1/customers/{customer_id}/email-change-requests?status=pending to find the pending change. Omit status to list every state, newest created_at first, with descending email_change_request_id as the tiebreak. status accepts repeated or comma-separated values. Lists take page_size (default 20, maximum 100) and page_token; continue with next_page_token. Use GET /v1/customers/{customer_id}/email-change-requests/{email_change_request_id} to retrieve a known request. Both reads require customers.read.

status is pending, confirmed, canceled, or expired. confirmed_at and canceled_at are nullable timestamps. new_email is null in every terminal state: Flint erases the requested addresses. supported_actions is ["cancel"] while pending and [] otherwise. current_email_confirmation_required is always false for staff requests.

Cancel with POST /v1/customers/{customer_id}/email-change-requests/{email_change_request_id}/cancel, with no body or {} and customers.write. Cancellation returns 200, invalidates the confirmation link or codes, and leaves the customer's email unchanged. Canceling a terminal request returns 409 ACTION_NOT_ALLOWED with reason terminal_status, its current_status, and supported_actions: []. An ID outside the named customer returns 404 RESOURCE_NOT_FOUND at email_change_request_id.

On confirmation, Flint changes the customer email at this store, moves its email preferences, revokes its customer sessions and emailed access links, and sends a notice to the old address when there was one. The buyer stays signed in to Flint and their other stores. The notice gives the store's contact details, with no undo link or new address. Cards saved with Flint never move. Other stores' customer records stay unchanged. Listen for customer.updated with previous_attributes.email; there are no email-change-request events.

An address already used by another customer at this store returns 409 ALREADY_EXISTS at new_email, with the customer in details[0].current_resource. Flint checks again at confirmation. An unchanged address returns 400 INVALID_REQUEST. A customer being deleted or already deleted returns 409 ACTION_NOT_ALLOWED with reason in_progress or terminal_status.

In merchant_hosted mode, starting a request returns 409 ACTION_NOT_ALLOWED with reason not_offered. Use PATCH /v1/customers/{customer_id} there. In flint_hosted mode, that PATCH refuses email changes once the buyer has authenticated or verified ownership, with reason managed_externally. Before that, staff can set, correct, or clear the email directly.

Create and cancel accept an optional Idempotency-Key. Retry a lost response with the same key and body. If the original result cannot be recovered, list this customer's requests and read the known request before starting another change; contact support with the request ID if the outcome remains uncertain. Never switch keys to work around an unresolved outcome.

The Customer object#

A merchant's customer profile.

Returned by GET /v1/customers/{customer_id} and carried by the endpoints below.

Attributes

billing_addressobject or nullRequired

The customer's default billing address: a copy of the address of the saved address marked is_default_billing. Read-only; change it through /v1/customers/{customer_id}/addresses. Flint taxes orders with no other tax location at this address. `null` when no saved address is the billing default.

created_atstringRequired

RFC3339 timestamp.

customer_idstringRequired

Unique identifier for this customer, prefixed `cus_`.

default_invoice_payment_term_idstring

ID of the invoice payment term that applies to this customer's invoices created with `payment_due.type` set to `customer_default`. Absent when none is set.

Not returned with a customer session

default_payment_methodobject or null

Present only when `expand` includes `default_payment_method`; `null` when expanded and there is no related payment method.

Not returned with a customer session

default_payment_method_idstring or nullRequired

ID of the customer's default off-session payment method. Existing subscriptions keep their own payment_method_id when the default changes. `null` when none is set.

emailstring or nullRequired

Customer email. `null` when the customer has none. Unique among the environment's customers.

external_reference_idstring or nullRequired

Caller-owned identifier for this customer in an external system. `null` when none is set. Not returned to customer sessions.

Not returned with a customer session

internal_notestring or nullRequired

Internal note about this customer. `null` when none is set. Not returned to customer sessions.

Not returned with a customer session

is_merchant_verifiedboolean

Flag you set on the customer, for example after checking ID in store. Promotion and delivery rules can match it. Flint does not set it; it is unrelated to customer verifications, which prove a buyer controls an email address.

Not returned with a customer session

merchant_idstringRequired

ID of the merchant this resource belongs to.

metadatamap of string

Stored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.

Not returned with a customer session

namestring or nullRequired

Customer name. `null` when none is set.

phonestring or nullRequired

Customer phone number. `null` when none is set.

price_list_idstring or nullRequired

ID of the customer's direct wholesale price list. `null` when none is set. An inactive list can be assigned but does not apply. Not returned to customer sessions.

Not returned with a customer session

receivablesobject

What this customer owes you on invoices: the outstanding and overdue amounts, one balance per currency. Present only when `expand` includes `receivables`.

Not returned with a customer session

segmentstring or nullRequired

Free-form label you assign, such as wholesale, so promotion and delivery rules can match groups of customers. It is not an ID; Flint does not check it against any resource. `null` when none is set. Not returned to customer sessions.

Not returned with a customer session

shipping_addressobject or nullRequired

The customer's default shipping address: a copy of the address of the saved address marked is_default_shipping. Read-only; change it through /v1/customers/{customer_id}/addresses. Checkout prefills it. `null` when no saved address is the shipping default.

statusenumRequired

Where the customer is in the deletion lifecycle.

  • active
  • deletion_processing
  • deleted
tax_exemptboolean

Whether Flint treats this customer as exempt from tax on their orders, so it skips tax calculation for them. Not returned to customer sessions.

Not returned with a customer session

tax_identityobject or nullRequired

Legal name, registered address and tax IDs printed on this customer's invoices and credit notes. `null` when none is set. Always `null` for customer sessions.

test_clock_idstring

ID of the test clock the customer was created on. The customer and its subscriptions read the clock's `frozen_at` as the current time. Present only for customers created on a test clock. Not returned to customer sessions.

Not returned with a customer session

updated_atstringRequired

RFC3339 timestamp.

versionintegerRequired

Current version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.

JSON
{
  "billing_address": {
    "city": "New York",
    "country": "US",
    "line1": "123 Main St",
    "postal_code": "10001",
    "state": "NY"
  },
  "created_at": "2026-03-17T14:30:00Z",
  "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
  "default_payment_method_id": null,
  "email": "jane@example.com",
  "external_reference_id": null,
  "internal_note": null,
  "is_merchant_verified": true,
  "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
  "metadata": {
    "crm_id": "crm_123"
  },
  "name": "Jane Doe",
  "phone": "+14155552671",
  "price_list_id": null,
  "segment": "vip",
  "shipping_address": null,
  "status": "active",
  "tax_exempt": true,
  "tax_identity": null,
  "updated_at": "2026-03-17T14:30:00Z",
  "version": 1
}

The Customer deletion request object#

A request to delete a customer's personal information.

Returned by GET /v1/customer-deletion-requests/{customer_deletion_request_id} and carried by the endpoints below.

Attributes

blocking_resource_countinteger

Total resources currently preventing approval, including resources beyond the blocking_resources cap. Present only for pending_review, including zero when nothing blocks approval. Computed at read time using the same rule as approval.

blocking_resourcesarray of object

Resources currently preventing approval, computed when the request is read. Present only for pending_review, including an empty array when nothing blocks approval. Uses the same references as RESOURCE_IN_USE: non-canceled subscriptions and active or pending payment methods, ordered by resource_type then resource_id, capped at 25 of each type. List the customer's subscriptions and payment methods for the remaining resources when blocking_resource_count exceeds this array's length. Approval rechecks the blockers; cancel_subscriptions and remove_payment_methods can clear the matching resources before erasure.

canceled_subscription_idsarray of stringRequired

Subscription IDs whose immediate cancellation completed for this request, sorted by ID. Empty when none have completed. Read the request again while processing to see progress.

customer_deletion_request_idstringRequired

Stable ID of the tracked deletion request. Use it to retrieve the review and erasure status.

customer_idstringRequired

ID of the customer the request would erase.

decided_atstring or nullRequired

Time of the most recent approve or reject decision. `null` when the request is pending_review or when a pre-existing decision time cannot be determined. Approval sets this before asynchronous erasure finishes; retry approval sets it again.

decision_reasonstring or nullRequired

Merchant's plain-text explanation for rejecting the request, visible to the buyer. `null` when no reason was provided or the customer's personal data has since been erased.

removed_payment_method_idsarray of stringRequired

Payment method IDs whose archival completed for this request, sorted by ID. Empty when none have completed. Read the request again while processing to see progress.

requested_atstringRequired

RFC3339 timestamp.

requested_byenum or nullRequired

Who opened the request: buyer from the buyer account, or merchant on the buyer's behalf. `null` when the source of a pre-existing request cannot be determined.

  • buyer
  • merchant
  • null
resolved_atstring

Unlike decided_at, which records the merchant's decision, this is the time of the most recent resolved outcome: rejected, completed, or failed. Absent while pending_review or processing. Cleared when a failed request is approved again.

response_due_atstringRequired

Requested time plus one calendar month in UTC, clamped to the last day of that month. This is the deadline for responding to the buyer's request.

retention_policyenumRequired

What deletion keeps. `retain_required_commerce_records`: orders, invoices, credit notes, payments, and refunds stay for accounting, tax, and disputes, without the customer's email address or phone number. Issued invoices and credit notes keep the buyer name, billing address, and tax ID they were issued with, because tax law requires them. Orders keep the delivery recipient's name and address. Contact copies created while deletion is finishing are erased within minutes, with another check about 24 hours later.

  • retain_required_commerce_records
statusenumRequired

Where the request is in review and erasure.

  • pending_review
  • processing
  • completed
  • rejected
  • failed
supported_actionsarray of enumRequired

Lifecycle actions Flint accepts now, independent of the caller's permissions. Contains resolve while awaiting review, during processing, and when retrying a failed deletion. Empty for completed and rejected requests. Repeating the original decision still succeeds; an opposite decision is refused with field_locked at decision.

Not returned with a customer session

  • resolve
JSON
{
  "blocking_resource_count": 0,
  "blocking_resources": [],
  "canceled_subscription_ids": [],
  "customer_deletion_request_id": "cdel_01KEZF7C001SCPDJYR1AA8KQCZ",
  "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
  "decided_at": null,
  "decision_reason": null,
  "removed_payment_method_ids": [],
  "requested_at": "2026-08-02T16:00:00Z",
  "requested_by": "merchant",
  "response_due_at": "2026-09-02T16:00:00Z",
  "retention_policy": "retain_required_commerce_records",
  "status": "pending_review",
  "supported_actions": [
    "resolve"
  ]
}

The Customer verification object#

An email verification requested for linking guest purchases.

Returned by GET /v1/customer-verifications/{customer_verification_id} and carried by the endpoints below.

Attributes

channelenumRequired

How the code was delivered.

  • email
created_atstringRequired

RFC3339 timestamp.

customer_idstringRequired

ID of the customer whose email this verification proves.

customer_verification_idstringRequired

Unique identifier for this customer verification, prefixed `cver_`.

emailstringRequired

The email address that received the code: the customer's email when the verification was created.

expires_atstringRequired

RFC3339 timestamp.

purposeenumRequired

What the verification is for.

  • link_guest_purchases
statusenumRequired

pending while the code can be confirmed; confirmed while an unused proof can link purchases; used after linking; expired when the code or proof expires.

  • pending
  • confirmed
  • used
  • expired
supported_actionsarray of enumRequired

Lifecycle actions Flint accepts now, independent of the caller's permissions. Contains confirm while the code is pending; empty once confirmed, used, expired, or out of attempts. Expiry is evaluated when Flint serves the response.

  • confirm
JSON
{
  "channel": "email",
  "created_at": "2026-11-10T15:00:00Z",
  "customer_id": "cus_01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "customer_verification_id": "cver_01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "email": "buyer@example.com",
  "expires_at": "2026-11-10T15:15:00Z",
  "purpose": "link_guest_purchases",
  "status": "pending",
  "supported_actions": [
    "confirm"
  ]
}

List customer deletion requests#

GET/v1/customer-deletion-requests

Requires scope customers.read or customers.write

Rate limit: read

Lists deletion requests across the selected merchant environment so a merchant can discover and review buyer-created requests. Default order: requested_at descending, then customer_deletion_request_id descending.

Query parameters

statusarray of enum

Only return requests in this lifecycle state. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • pending_review
  • processing
  • completed
  • rejected
  • failed
customer_idstring

Only return requests for this Flint customer ID.

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

Response · 200

The matching deletion requests.

dataarray of objectRequired

Deletion requests matching the supplied filters, in the published list order.

metaobject

Metadata about this response, including warnings when present.

next_page_tokenstring

Opaque cursor to pass as page_token to fetch the next page. Omitted when no more results remain.

request_idstringRequired

ID of this API request. Include it when asking Flint to investigate the response.

curl https://api.withflintpay.com/v1/customer-deletion-requests \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The matching deletion requests.

JSON
{
  "data": [
    {
      "blocking_resource_count": 0,
      "blocking_resources": [],
      "canceled_subscription_ids": [],
      "customer_deletion_request_id": "cdel_01KEZF7C001SCPDJYR1AA8KQCZ",
      "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
      "decided_at": null,
      "decision_reason": null,
      "removed_payment_method_ids": [],
      "requested_at": "2026-08-02T16:00:00Z",
      "requested_by": "merchant",
      "response_due_at": "2026-09-02T16:00:00Z",
      "retention_policy": "retain_required_commerce_records",
      "status": "pending_review",
      "supported_actions": [
        "resolve"
      ]
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Request customer account deletion#

POST/v1/customer-deletion-requestsIdempotent

Requires scope customers.write

Rate limit: sensitive_write

Creates a deletion request for merchant review, or returns the customer's open request unchanged. No deletion work starts until approval.

Request body

customer_idstringRequired

Flint customer ID of the customer to delete.

Response · 201

The new deletion request.

dataobjectRequired

The tracked request to review and erase this customer's personal data.

metaobject

Metadata about this response, including idempotency replay and warnings when present.

request_idstringRequired

ID of this API request. Include it when asking Flint to investigate the response.

Response · 200

The customer's existing open deletion request, unchanged. Nothing was created.

Same attributes as 201.

curl -X POST https://api.withflintpay.com/v1/customer-deletion-requests \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE"
  }'

Get a customer deletion request#

GET/v1/customer-deletion-requests/{customer_deletion_request_id}

Requires scope customers.read or customers.write

Rate limit: read

Returns the current status of a tracked deletion request.

Path parameters

customer_deletion_request_idstringRequired

Flint customer deletion request ID. Must be a valid ID with prefix cdel_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The tracked deletion request.

Same response as Request customer account deletion.

curl https://api.withflintpay.com/v1/customer-deletion-requests/cdel_01KEZF7C009P94WEXW5RMRFXAY \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The tracked deletion request.

JSON
{
  "data": {
    "blocking_resource_count": 0,
    "blocking_resources": [],
    "canceled_subscription_ids": [],
    "customer_deletion_request_id": "cdel_01KEZF7C001SCPDJYR1AA8KQCZ",
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "decided_at": null,
    "decision_reason": null,
    "removed_payment_method_ids": [],
    "requested_at": "2026-08-02T16:00:00Z",
    "requested_by": "merchant",
    "response_due_at": "2026-09-02T16:00:00Z",
    "retention_policy": "retain_required_commerce_records",
    "status": "pending_review",
    "supported_actions": [
      "resolve"
    ]
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Resolve a customer deletion request#

POST/v1/customer-deletion-requests/{customer_deletion_request_id}/resolveIdempotent

Requires scope customers.write

Rate limit: sensitive_write

Approves or rejects a pending deletion request. Approval returns processing while account data and buyer credentials are deleted asynchronously. A failed deletion can be approved again but cannot be rejected. Approval is blocked while the customer has non-canceled subscriptions or usable saved payment methods.

Path parameters

customer_deletion_request_idstringRequired

Flint customer deletion request ID. Must be a valid ID with prefix cdel_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

cancel_subscriptionsboolean

When decision is approve, cancel every non-canceled subscription immediately before erasure. Defaults to false. Saved on first approval; omit on retries or send the original value.

decisionenumRequired

Whether to erase the customer's personal data or keep the customer as is.

  • approve
  • reject
decision_reasonstring

Optional plain-text explanation visible to the buyer. Only allowed when decision is reject. Trimmed before storage; must contain 1 to 500 characters after trimming. `null` is not allowed. Reasons are erased if the customer is later deleted.

remove_payment_methodsboolean

When decision is approve, archive active and pending saved payment methods before erasure. Defaults to false. Subscriptions are canceled first when both options are selected. Saved on first approval; omit on retries or send the original value.

Response · 200

The updated deletion request.

Same response as Request customer account deletion.

curl -X POST https://api.withflintpay.com/v1/customer-deletion-requests/cdel_01KEZF7C009P94WEXW5RMRFXAY/resolve \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "decision": "approve"
  }'

List customer verifications#

GET/v1/customer-verifications

Requires scope customers.read or customers.write

Rate limit: read

Lists every status for the required customer_id. Status and supported_actions are computed when read. Flint deletes a verification 8 days after its code and proof expire; customer deletion also removes it. Default order: created_at descending, then customer_verification_id descending.

Query parameters

customer_idstringRequired

Required exact customer ID. An unknown or inaccessible customer returns an empty page.

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

Response · 200

The customer verifications.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl "https://api.withflintpay.com/v1/customer-verifications?customer_id=cus_01KEZF7C006X9JK6NZNA2SM9XD" \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The customer verifications.

JSON
{
  "data": [
    {
      "channel": "email",
      "created_at": "2026-11-10T15:00:00Z",
      "customer_id": "cus_01ARZ3NDEKTSV4RRFFQ69G5FAV",
      "customer_verification_id": "cver_01ARZ3NDEKTSV4RRFFQ69G5FAV",
      "email": "buyer@example.com",
      "expires_at": "2026-11-10T15:15:00Z",
      "purpose": "link_guest_purchases",
      "status": "pending",
      "supported_actions": [
        "confirm"
      ]
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "next_page_token": "example",
  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
}

Create a customer email verification#

POST/v1/customer-verificationsIdempotent

Requires scope customers.write

Rate limit: sensitive_write

Sends a Flint verification code to the customer's current email for linking guest purchases. A customer without an email fails with `ACTION_NOT_ALLOWED`. Set purpose to link_guest_purchases; email is the only channel and the default. Confirm the code before linking purchases. Read its current status with GET /v1/customer-verifications/{customer_verification_id}. To prove an email inside a checkout, use POST /v1/checkout-sessions/{checkout_session_id}/customer-verifications.

Request body

channelenum

Defaults to email when omitted. Explicit null and an empty value are not accepted.

  • email
customer_idstringRequired

ID of the customer whose email to verify. The code goes to this customer's current email.

purposeenumRequired

What the verification is for. It can only be used for that purpose.

  • link_guest_purchases

Response · 200

The pending verification.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/customer-verifications \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "channel": "email",
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "purpose": "link_guest_purchases"
  }'

Get a customer verification#

GET/v1/customer-verifications/{customer_verification_id}

Requires scope customers.read or customers.write

Rate limit: read

Returns one customer verification in any status. Status and supported_actions are computed when read. Flint deletes a verification 8 days after its code and proof expire; customer deletion also removes it.

Path parameters

customer_verification_idstringRequired

Flint customer verification ID. Must be a valid ID with prefix cver_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The customer verification.

Same response as Create a customer email verification.

curl https://api.withflintpay.com/v1/customer-verifications/cver_01KEZF7C00E7S01991S7457CVK \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The customer verification.

JSON
{
  "data": {
    "channel": "email",
    "created_at": "2026-11-10T15:00:00Z",
    "customer_id": "cus_01ARZ3NDEKTSV4RRFFQ69G5FAV",
    "customer_verification_id": "cver_01ARZ3NDEKTSV4RRFFQ69G5FAV",
    "email": "buyer@example.com",
    "expires_at": "2026-11-10T15:15:00Z",
    "purpose": "link_guest_purchases",
    "status": "pending",
    "supported_actions": [
      "confirm"
    ]
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01ARZ3NDEKTSV4RRFFQ69G5FAV"
}

Confirm a customer email verification#

POST/v1/customer-verifications/{customer_verification_id}/confirmIdempotent

Requires scope customers.write

Rate limit: sensitive_write

Confirms the Flint-sent code and returns a verification that can link guest purchases for its customer. A confirmed verification expires in 15 minutes and can be redeemed once.

Path parameters

customer_verification_idstringRequired

Flint customer verification ID. Must be a valid ID with prefix cver_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

codestringRequired

The six-digit code Flint sent to the customer's email.

Response · 200

The confirmed verification.

Same response as Create a customer email verification.

curl -X POST https://api.withflintpay.com/v1/customer-verifications/cver_01KEZF7C00E7S01991S7457CVK/confirm \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "code": "123456"
  }'

List customers#

GET/v1/customers

Requires scope customers.read or customers.write

Rate limit: read

Returns a paginated list of customers for the authenticated merchant. Without a status filter, returns active and deletion_processing customers; deleted customers appear only when the filter names deleted. Default order: created_at descending, then customer_id descending.

Query parameters

statusarray of enum

Filter by status. Omitted, the list leaves out deleted rows; name deleted to include them. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • active
  • deletion_processing
  • deleted
page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

querystring

Search across customer_id, name, email, phone number, and external_reference_id. Text fields match any part of the value, and %, _ and \ are ordinary characters, not wildcards. IDs match from the start and need the type prefix, such as cus_01.

external_reference_idstring

Exact-match filter on the caller-owned external reference ID.

emailstring

Exact whole-address match after trimming surrounding whitespace. Case is ignored and accents are kept: `Ana@example.com` matches `ana@example.com`, but `josé@example.com` doesn't match `jose@example.com`.

price_list_idstring

Only return customers assigned directly to this price list.

segmentstring

Byte-sensitive whole-value match on the opaque customer segment. Whitespace, casing, Unicode, and commas are literal.

is_merchant_verifiedboolean

Filter by merchant verification, independently of email verification.

phonestring

Exact match on a full E.164 phone number, such as `+14155551234`. The leading plus is required.

test_clock_idstring

Sandbox only. Exact-match filter on `test_clock_id`. A live credential gets `403 FORBIDDEN` with reason `test_mode_required`.

sort_byenum

Field to sort by. Defaults to created_at; ties are broken by customer_id.

  • name
  • email
  • created_at
  • updated_at
sort_directionenum

Sort direction. Defaults to desc.

  • asc
  • desc
created_afterstring

Inclusive lower bound on created_at.

created_beforestring

Exclusive upper bound on created_at.

updated_afterstring

Inclusive lower bound on updated_at.

updated_beforestring

Exclusive upper bound on updated_at.

expandarray of enum

Include related objects in the response. Supported expansions: default_payment_method, receivables. Include the requested related resources using scoped batch reads for this page. Each relationship requires its existing target read scopes. Expansion changes the representation without changing pagination tokens. Limits: at most 10 unique expand paths per request.

  • default_payment_method
  • receivables

Response · 200

A page of customers.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/customers \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

A page of customers.

JSON
{
  "data": [
    {
      "billing_address": {
        "city": "New York",
        "country": "US",
        "line1": "123 Main St",
        "postal_code": "10001",
        "state": "NY"
      },
      "created_at": "2026-03-17T14:30:00Z",
      "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
      "default_payment_method_id": null,
      "email": "jane@example.com",
      "external_reference_id": null,
      "internal_note": null,
      "is_merchant_verified": true,
      "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
      "metadata": {
        "crm_id": "crm_123"
      },
      "name": "Jane Doe",
      "phone": "+14155552671",
      "price_list_id": null,
      "segment": "vip",
      "shipping_address": null,
      "status": "active",
      "tax_exempt": true,
      "tax_identity": null,
      "updated_at": "2026-03-17T14:30:00Z",
      "version": 1
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM63W8G2YAQ49MM20GEKSFD"
}

Create customer#

POST/v1/customersIdempotent

Requires scope customers.write

Rate limit: write

Creates a customer record for a buyer's contact details and purchases in this environment. When an active customer already has `email`, `on_email_conflict` chooses whether to fail with `ALREADY_EXISTS`, which names that customer, or return the existing customer unchanged. Emails match case-insensitively.

Request body

addressesarray of object

Initial saved addresses, created atomically with the customer. Each entry uses the address-book create shape. At most one entry may be the billing default and one the shipping default. Defaults populate billing_address and shipping_address. Omit or send [] for none. When on_email_conflict is return_existing, an existing customer and its addresses stay unchanged.

default_invoice_payment_term_idstring

ID of the invoice payment term that applies to this customer's invoices created with `payment_due.type` set to `customer_default`.

emailstring

Customer email, unique among the environment's customers. Required when `on_email_conflict` is `return_existing`. The local part before @ must be at most 64 octets (UTF-8 bytes).

external_reference_idstring

Caller-owned identifier for this resource in an external system.

internal_notestring

Internal note about this customer. Not returned to customer sessions. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.

is_merchant_verifiedboolean

Flag you set on the customer, for example after checking ID in store. Promotion and delivery rules can match it. Flint does not set it; it is unrelated to customer verifications, which prove a buyer controls an email address.

metadatamap of string

Caller-owned metadata. Values can't be empty strings. Keys starting with flint_ are reserved for Flint, are not returned, and cannot be written through the public API.

namestring

Customer name, up to 255 characters (Unicode code points) after trimming surrounding whitespace. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.

on_email_conflictenum

What to do when an active customer in this environment already has `email`. `error` returns `409 ALREADY_EXISTS` naming that customer. `return_existing` returns that customer unchanged with `200` instead of creating one; it requires `email`. Emails match case-insensitively.

  • error
  • return_existing
phonestring

Customer phone number in E.164 format: a leading `+`, then the country code and number as digits only, such as `+14155551234`, matching `^\+[1-9][0-9]{1,14}$`. Flint trims surrounding whitespace but rejects spaces, hyphens, dots, and parentheses inside the number, so send `+14155550100`, not `+1 (415) 555-0100`. Leave out a national trunk prefix: send `+442079460958`, not `+4402079460958`.

price_list_idstring or null

ID of a wholesale price list in this merchant environment. An inactive list can be assigned but does not apply. An archived list returns 409 ACTION_NOT_ALLOWED; a missing list returns 404 RESOURCE_NOT_FOUND. Omit or send null for no direct list.

segmentstring

Free-form label you assign, such as wholesale, so promotion and delivery rules can match groups of customers. It is not an ID; Flint does not check it against any resource.

tax_exemptboolean

Whether Flint treats this customer as exempt from tax on their orders, so it skips tax calculation for them. Defaults to `false`.

tax_identityobject

Legal name, registered address and tax IDs printed on this customer's invoices and credit notes.

test_clock_idstring

Sandbox only. ID of a test clock to create the customer on. The customer, and every subscription created for it, read the clock's time instead of real time. A customer can't be moved to another clock or taken off one. A live credential gets `403 FORBIDDEN` with reason `test_mode_required`.

Response · 201

The created customer.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

Response · 200

The existing customer that has this email, unchanged. Returned only when on_email_conflict is return_existing. Nothing was created.

Same attributes as 201.

curl -X POST https://api.withflintpay.com/v1/customers \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "email": "jane@example.com",
    "metadata": {
      "crm_id": "crm_123"
    },
    "name": "Jane Doe"
  }'

Get customer#

GET/v1/customers/{customer_id}

Requires scope customers.read or customers.write

Rate limit: read

Returns a single customer by ID.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

expandarray of enum

Include related objects in the response. Supported expansions: default_payment_method, receivables. Expanding the default payment method requires customers.read plus payments.payment_methods.read. Limits: at most 10 unique expand paths per request.

  • default_payment_method
  • receivables

Response · 200

The requested customer.

Same response as Create customer.

curl https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The requested customer.

JSON
{
  "data": {
    "billing_address": {
      "city": "New York",
      "country": "US",
      "line1": "123 Main St",
      "postal_code": "10001",
      "state": "NY"
    },
    "created_at": "2026-03-17T14:30:00Z",
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "default_payment_method_id": null,
    "email": "jane@example.com",
    "external_reference_id": null,
    "internal_note": null,
    "is_merchant_verified": true,
    "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
    "metadata": {
      "crm_id": "crm_123"
    },
    "name": "Jane Doe",
    "phone": "+14155552671",
    "price_list_id": null,
    "segment": "vip",
    "shipping_address": null,
    "status": "active",
    "tax_exempt": true,
    "tax_identity": null,
    "updated_at": "2026-03-17T14:30:00Z",
    "version": 1
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM63W8G2YAQ49MM20GEKSFD"
}

Update customer#

PATCH/v1/customers/{customer_id}Idempotent

Requires scope customers.write

Rate limit: write

Applies a sparse update to a customer. Clearing email while any subscription is not canceled returns 409 CUSTOMER_EMAIL_REQUIRED. Changing, case-changing, or clearing an existing email requires customer_account.mode to be merchant_hosted; otherwise the update fails with `ACTION_NOT_ALLOWED` and reason `managed_externally`. A customer with no email can be given one in either mode. To change the email of a customer who signs in to your Flint-hosted account, send POST /v1/customers/{customer_id}/email-change-requests with new_email. The new address confirms through the link Flint emails it. If Flint cannot read the account settings, the update fails with a retryable `SERVICE_UNAVAILABLE` and the customer is unchanged.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

default_invoice_payment_term_idstring or null

Default payment term for this customer's invoices. Send null to clear it.

default_payment_method_idstring or null

The active off_session payment method to use by default. Existing subscriptions keep their payment_method_id. Omit to leave unchanged; null clears it. A change sends customer.updated.

emailstring or null

The customer's email. Omit to leave unchanged; null clears it. In `flint_hosted` mode, you can set, correct, or clear the email until the buyer authenticates or verifies ownership of it. Existing identities with unknown sign-in history remain protected and require a buyer-confirmed change. In `merchant_hosted` mode, you can set, change, or clear it. An email change ends customer sessions and access links for the old address. The local part before @ must be at most 64 octets (UTF-8 bytes).

expected_versioninteger

Required when tax_identity is null or tax_identity.tax_ids is present. Stale versions return a conflict.

external_reference_idstring or null

Caller-owned identifier for this resource in an external system. Omit to leave unchanged; null clears it.

internal_notestring or null

Internal note about this customer. Omit to leave unchanged; null clears it. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.

is_merchant_verifiedboolean

Flag you set on the customer, for example after checking ID in store. Promotion and delivery rules can match it. Flint does not set it; it is unrelated to customer verifications, which prove a buyer controls an email address.

metadatamap of string or null

Caller-owned metadata. Omit this field to leave metadata unchanged. Send an object to merge by key, set a key to null to remove it, or set metadata to null to clear all caller-owned metadata. An empty object makes no change. Values can't be empty strings. Keys starting with flint_ are reserved for Flint, are not returned, and cannot be written through the public API. This operation also limits the metadata object you send, before merging: at most 50 keys, counting null deletions, each key 1 to 256 Unicode code points, and at most 32768 UTF-8 bytes of keys plus values.

namestring or null

Customer name, up to 255 characters (Unicode code points) after trimming surrounding whitespace. Omit to leave unchanged; null clears it. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.

phonestring or null

Customer phone number in E.164 format: a leading `+`, then the country code and number as digits only, such as `+14155551234`, matching `^\+[1-9][0-9]{1,14}$`. Flint trims surrounding whitespace but rejects spaces, hyphens, dots, and parentheses inside the number, so send `+14155550100`, not `+1 (415) 555-0100`. Leave out a national trunk prefix: send `+442079460958`, not `+4402079460958`. Omit to leave unchanged; null clears it.

price_list_idstring or null

ID of a wholesale price list in this merchant environment. Omit to leave unchanged; null clears it. An inactive list can be assigned but does not apply. An archived list returns 409 ACTION_NOT_ALLOWED; a missing list returns 404 RESOURCE_NOT_FOUND.

segmentstring or null

Free-form label you assign, such as wholesale, so promotion and delivery rules can match groups of customers. It is not an ID; Flint does not check it against any resource. Omit to leave unchanged; null clears it.

tax_exemptboolean

Whether Flint treats this customer as exempt from tax on their orders, so it skips tax calculation for them. Omit to leave unchanged; `null` is not accepted.

tax_identityobject or null

Legal name, registered address and tax IDs printed on this customer's invoices and credit notes. Omit to leave unchanged; null clears it.

Response · 200

The updated customer.

Same response as Create customer.

curl -X PATCH https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "internal_note": "VIP buyer",
    "metadata": {
      "segment": "vip"
    },
    "phone": "+14155552671"
  }'

List customer addresses#

GET/v1/customers/{customer_id}/addresses

Requires scope customers.read or customers.write

Rate limit: read

Lists the customer's saved addresses with billing and shipping default flags. Default order: created_at descending, then customer_address_id descending.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

Response · 200

The customer's addresses.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/addresses \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The customer's addresses.

JSON
{
  "data": [
    {
      "address": {
        "city": "Austin",
        "country": "US",
        "line1": "12 Main St",
        "postal_code": "78701",
        "state": "TX"
      },
      "created_at": "2026-08-02T16:00:00Z",
      "customer_address_id": "caddr_01KEZF7C00K2Q127FBJAXWB0FP",
      "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
      "is_default_billing": false,
      "is_default_shipping": true,
      "label": "Home",
      "recipient_name": "Alex Morgan",
      "updated_at": "2026-08-02T16:00:00Z",
      "version": 1
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Create a customer address#

POST/v1/customers/{customer_id}/addressesIdempotent

Requires scope customers.write

Rate limit: write

Creates a stable saved address. The address becomes a default only when the request sets is_default_billing or is_default_shipping, or later by setting those flags with PATCH, including the customer's first address. A saved default becomes the customer's effective address for the corresponding role.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

addressobjectRequired

The postal address to save.

is_default_billingboolean

Set true to make this the default billing address and remove that default from any other saved address. Defaults to false.

is_default_shippingboolean

Set true to make this the default shipping address and remove that default from any other saved address. Defaults to false.

labelstring

Limited to 100 characters (Unicode code points), counted before surrounding whitespace is trimmed.

phonestring

E.164 phone number. Limited to 30 characters (Unicode code points), counted before surrounding whitespace is trimmed.

recipient_namestringRequired

Limited to 255 characters (Unicode code points), counted before surrounding whitespace is trimmed.

Response · 201

The created address.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/addresses \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "address": {
      "city": "Austin",
      "country": "US",
      "line1": "12 Main St",
      "postal_code": "78701",
      "state": "TX"
    },
    "is_default_shipping": true,
    "label": "Home",
    "recipient_name": "Alex Morgan"
  }'

Get a customer address#

GET/v1/customers/{customer_id}/addresses/{customer_address_id}

Requires scope customers.read or customers.write

Rate limit: read

Returns one saved address owned by the customer.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

customer_address_idstringRequired

Flint customer address ID. Must be a valid ID with prefix caddr_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The requested address.

Same response as Create a customer address.

curl https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/addresses/caddr_01KEZF7C00K2Q127FBJAXWB0FP \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The requested address.

JSON
{
  "data": {
    "address": {
      "city": "Austin",
      "country": "US",
      "line1": "12 Main St",
      "postal_code": "78701",
      "state": "TX"
    },
    "created_at": "2026-08-02T16:00:00Z",
    "customer_address_id": "caddr_01KEZF7C00K2Q127FBJAXWB0FP",
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "is_default_billing": false,
    "is_default_shipping": true,
    "label": "Home",
    "recipient_name": "Alex Morgan",
    "updated_at": "2026-08-02T16:00:00Z",
    "version": 1
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Update a customer address#

PATCH/v1/customers/{customer_id}/addresses/{customer_address_id}Idempotent

Requires scope customers.write

Rate limit: write

Applies a sparse update to a saved address. Set is_default_billing or is_default_shipping to true to make this address the default, or false to clear a default it holds. Updating a default address also updates the customer's effective address for that role.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

customer_address_idstringRequired

Flint customer address ID. Must be a valid ID with prefix caddr_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

addressobject

Replaces the whole postal address. Send every field you want to keep; omitted optional fields such as line2 are removed.

expected_versioninteger

The `version` of the saved address you last read. The update fails with a conflict if the address has changed since.

is_default_billingboolean

Set true to make this the default billing address and remove that default from any other saved address. Set false to clear this default if this address holds it; no other address becomes the default.

is_default_shippingboolean

Set true to make this the default shipping address and remove that default from any other saved address. Set false to clear this default if this address holds it; no other address becomes the default.

labelstring or null

Limited to 100 characters (Unicode code points), counted before surrounding whitespace is trimmed. Send null to clear it.

phonestring or null

E.164 phone number. Limited to 30 characters (Unicode code points), counted before surrounding whitespace is trimmed. Send null to clear it.

recipient_namestring

Limited to 255 characters (Unicode code points), counted before surrounding whitespace is trimmed.

Response · 200

The updated address.

Same response as Create a customer address.

curl -X PATCH https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/addresses/caddr_01KEZF7C00K2Q127FBJAXWB0FP \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "address": {
      "city": "Austin",
      "country": "US",
      "line1": "12 Main St",
      "postal_code": "78701",
      "state": "TX"
    },
    "expected_version": 1,
    "label": "Home"
  }'

Delete a customer address#

DELETE/v1/customers/{customer_id}/addresses/{customer_address_id}Idempotent

Requires scope customers.write

Rate limit: write

Deletes a saved address. Deleting the billing or shipping default leaves the customer with none; Flint doesn't pick another address.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

customer_address_idstringRequired

Flint customer address ID. Must be a valid ID with prefix caddr_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

expected_versioninteger

Optional address version last read by the caller.

Response · 200

The deleted address snapshot.

Same response as Create a customer address.

curl -X DELETE https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/addresses/caddr_01KEZF7C00K2Q127FBJAXWB0FP \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

List customer email change requests#

GET/v1/customers/{customer_id}/email-change-requests

Requires scope customers.read or customers.write

Rate limit: read

Returns requests in every status, ordered by created_at descending, then email_change_request_id descending. Status and supported_actions are computed when read. Default order: created_at descending, then email_change_request_id descending.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

statusarray of enum

Only return requests in these statuses. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • pending
  • confirmed
  • canceled
  • expired
page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

Response · 200

The customer email change request.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/email-change-requests \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The customer email change request.

JSON
{
  "data": [
    {
      "canceled_at": null,
      "confirmed_at": null,
      "created_at": "2026-08-02T16:00:00Z",
      "current_email_confirmation_required": false,
      "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
      "email_change_request_id": "cecr_01KEZF7C00B8VJX4M828K0430H",
      "expires_at": "2026-08-09T16:00:00Z",
      "new_email": "alex.new@example.com",
      "requested_by": "integration",
      "status": "pending",
      "supported_actions": [
        "cancel"
      ]
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Request a customer email change#

POST/v1/customers/{customer_id}/email-change-requestsIdempotent

Requires scope customers.write

Rate limit: sensitive_write

Emails the new address a confirmation link valid for seven days. Available for Flint-hosted accounts. One request can be pending per customer; creating another cancels the previous request. Nothing changes until the new address confirms. The change affects only this store, revokes the customer's sessions and links, and never moves cards saved with Flint. Limited to three attempts per customer in 15 minutes and 30 staff requests per merchant environment per hour.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

new_emailstringRequired

The address to change the email to. Flint emails a six-digit code to it. The local part before @ must be at most 64 octets (UTF-8 bytes).

Response · 201

The pending email change request.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/email-change-requests \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "new_email": "alex.new@example.com"
  }'

Get a customer email change request#

GET/v1/customers/{customer_id}/email-change-requests/{email_change_request_id}

Requires scope customers.read or customers.write

Rate limit: read

Returns one request belonging to this customer, including its current status. Terminal requests have no new_email.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

email_change_request_idstringRequired

Flint email change request ID. Must be a valid ID with prefix cecr_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The customer email change request.

Same response as Request a customer email change.

curl https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/email-change-requests/cecr_01KEZF7C00B8VJX4M828K0430H \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The customer email change request.

JSON
{
  "data": {
    "canceled_at": null,
    "confirmed_at": null,
    "created_at": "2026-08-02T16:00:00Z",
    "current_email_confirmation_required": false,
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "email_change_request_id": "cecr_01KEZF7C00B8VJX4M828K0430H",
    "expires_at": "2026-08-09T16:00:00Z",
    "new_email": "alex.new@example.com",
    "requested_by": "integration",
    "status": "pending",
    "supported_actions": [
      "cancel"
    ]
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Cancel a customer email change request#

POST/v1/customers/{customer_id}/email-change-requests/{email_change_request_id}/cancelIdempotent

Requires scope customers.write

Rate limit: sensitive_write

Cancels a pending request and invalidates its link or codes. The customer's email stays unchanged. A terminal request refuses cancellation. Send no body or an empty JSON object.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

email_change_request_idstringRequired

Flint email change request ID. Must be a valid ID with prefix cecr_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The customer email change request.

Same response as Request a customer email change.

curl -X POST https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/email-change-requests/cecr_01KEZF7C00B8VJX4M828K0430H/cancel \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Get a customer's email preferences#

GET/v1/customers/{customer_id}/email-preferences

Requires scope customers.read or customers.write

Rate limit: read

Returns the preferences for the customer's current email address in this merchant environment. A missing choice is enabled. Reads remain available while deletion is processing. Returns RESOURCE_NOT_FOUND for an unknown or deleted customer, or with reason email_missing when the customer has no email address. Merchants cannot change these preferences.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The email address's current preferences.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/email-preferences \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The email address's current preferences.

JSON
{
  "data": {
    "checkout_reminders": false,
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "email": "buyer@example.com",
    "shipping_updates": true,
    "version": 1
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Link guest purchases to a customer#

POST/v1/customers/{customer_id}/link-guest-purchasesIdempotent

Requires scope customers.write

Rate limit: sensitive_write

Links purchases with the verified email and no customer to the verification's customer in the same merchant environment. Purchases bound to another customer stay with that customer. The verification is single use; use the same idempotency key to retry an uncertain result.

Path parameters

customer_idstringRequired

Flint customer ID. Must be a valid ID with prefix cus_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

customer_verification_idstringRequired

ID of a confirmed customer verification with purpose `link_guest_purchases`. Linking uses it up.

Response · 200

The linked purchases.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/customers/cus_01KEZF7C006X9JK6NZNA2SM9XD/link-guest-purchases \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "customer_verification_id": "cver_01ARZ3NDEKTSV4RRFFQ69G5FAV"
  }'

Look up email preferences#

POST/v1/email-preferences/lookup

Requires scope customers.read or customers.write

Rate limit: read

Reads an address's email preferences without putting it in a URL. Matches after trimming surrounding whitespace and ignoring case. Returns the same shape as the customer preference read. For an address without a current customer, customer_id and version are null. With multiple matching customers, returns the first customer in ID order. A category with no stored choice is enabled. Merchants cannot change these preferences.

Request body

emailstringRequired

Email address to look up. Matched after trimming surrounding whitespace and ignoring case, the way Flint matches unsubscribes.

Response · 200

The email address's current preferences.

Same response as Get a customer's email preferences.

curl -X POST https://api.withflintpay.com/v1/email-preferences/lookup \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "alex@example.com"
  }'

Was this helpful?