Customer email delivery
Flint emails your buyers about their purchases, deliveries, subscriptions, failed payments, Returns, and invoices. To send any of those yourself, switch that family of email to merchant_sends: Flint stops sending it, the webhook events keep firing, and your server writes and sends the message.
Each family is a separate setting. You can send your own receipts and still let Flint send dunning notices.
Decide what you need#
Taking over a family means you write, send, and support that email. Some goals need less:
| You want | Do this |
|---|---|
| Your own wording, design, or sending domain for a kind of email | Set its family to merchant_sends and send it from the events, as described here. Flint's own templates and wording can't be changed. |
| Flint's email, with links to your own account pages | Set customer_account.mode to merchant_hosted and leave customer_email_delivery alone. See Point Flint's email at your pages. |
| To skip one fulfillment email | Send buyer_notification_behavior: "suppress" on that fulfillment or package action. See What the buyer receives. |
The two settings are independent. With customer_account.mode set to merchant_hosted, every account link in the email Flint still sends opens your site, including the "Pay invoice" button in invoice email and the unsubscribe link.
The six families#
customer_email_delivery has one field per family. Each takes flint_sends, the default, or merchant_sends.
| Family | What Flint stops sending |
|---|---|
order_receipts | Payment and refund receipts, for orders, invoices, and payments made without an order, and failed bank debit notices for orders |
fulfillment_updates | Pickup, shipment, and delivery notices, and notices that a paid line's expected_ship_date changed |
subscription_lifecycle | Subscription started, renewal, cancellation, pause, and trial ending notices; a gift recipient's gift and final notices; and delivery notices for subscriptions that ship: action needed, upcoming pause, skipped shipment, delivery changed, and backordered |
dunning | Failed subscription payment notices |
returns | Return updates, and the codes for new gift cards a Return issues as store credit |
invoices | Invoice email, reminders, late fee notices, credit note emails, and failed bank debit notices for invoice payments |
customer_email_delivery belongs to the merchant: locations and devices can't override it. Settings are stored per environment, so switching a family in a sandbox doesn't change what live buyers receive.
What else changes#
Switching a family stops more than the automatic email:
order_receipts. Flint won't send a receipt on request either.POST /v1/orders/{order_id}/send-receipt,POST /v1/payment-intents/{payment_intent_id}/send-receipt, and the buyer'sPOST /v1/me/orders/{order_id}/send-receiptreturnACTION_NOT_ALLOWEDwithdetails[0].reasonmerchant_managed_email.invoices. An invoice issued with the defaultdelivery_modeofmerchant_defaultis issued ascaller_managed: deliver itspublic_urlyourself, and send reminders wheninvoice.reminder_duearrives. A reminder fromPOST /v1/invoices/{invoice_id}/send-reminderis recorded as asuppresseddelivery attempt withsuppression_reasonmerchant_managed_email. Issuing or creating and issuing withdelivery_mode: email, or scheduling an issue, returns409 ACTION_NOT_ALLOWEDwithdetails[0].reasonmerchant_managed_email. Issue withcaller_managedormerchant_default, or setcustomer_email_delivery.invoicestoflint_sends; scheduling needsflint_sends. See Delivery outcomes.returns. You deliver the codes for gift cards a Return issues. See Delivering the gift card.
Switch a family over#
Flint checks the setting when it sends each email. An email for a merchant_sends family isn't sent, even one Flint queued before you switched, and isn't sent later if you switch back. Have your own sending working first.
To hand a family back, set it to flint_sends. Sending "customer_email_delivery": null resets every family to flint_sends. Flint sends from the next email onward; it doesn't send the ones it skipped.
Honor unsubscribes in email you send#
Buyers can turn off two kinds of email:
| Preference | Email you must skip when it is false |
|---|---|
shipping_updates | Your shipping updates, including those you send for fulfillment_updates |
checkout_reminders | Your reminders about an unpaid checkout |
Each starts as true and belongs to the recipient's email address in this environment, including guest checkouts with that address. Switching fulfillment_updates to merchant_sends doesn't clear earlier opt-outs. Flint skips a merchant_sends email before checking the recipient's preference, so check it yourself before sending.
Read GET /v1/customers/{customer_id}/email-preferences for a customer's current address. For a guest, call POST /v1/email-preferences/lookup with {"email": "maya@example.com"} before each send. Both need customers.read and return the same fields: customer_id, email, shipping_updates, checkout_reminders, and version. For a guest, customer_id and version are null. Lookup matches addresses without regard to case or surrounding spaces; when a customer matches, it returns that customer's ID and preference version. See Email preferences.
Subscribe to customer_email_preferences.updated to keep your own suppression list current for customers. Its object is the full customer preference snapshot, including the email and both categories. It fires when a preference changes or the customer's email changes, and its version is separate from the customer's. An unchanged preference, a guest preference change, and customer deletion send no such event. Events can arrive out of order, so read the current preferences before sending when your stored state may be stale. Lookup before each guest send because guest changes have no event.
The merchant reads don't change preferences. The buyer changes them from their account or an unsubscribe link.
Events to send from#
Each family's email follows these events.
| Family | Events |
|---|---|
order_receipts | order.paid (or payment_intent.succeeded for payments without an order), refund.succeeded, and refund.partially_succeeded; payment_intent.payment_failed for failed bank debits on orders |
fulfillment_updates | fulfillment.updated, fulfillment.completed, fulfillment.canceled, fulfillment.failed, fulfillment_event.created, shipment.created, shipment.updated, package.created, package.updated, and order.updated when a paid line's expected_ship_date changes; honor customer_email_preferences.updated for opt-outs |
subscription_lifecycle | subscription.created, subscription.activated, subscription.payment_succeeded, subscription.cancellation_scheduled, subscription.canceled, subscription.paused, subscription.resumed, subscription.trial_ending, subscription.plan_changed, subscription.cycle_skipped, subscription.delivery_action_required, subscription.delivery_pause_upcoming, subscription.delivery_updated |
dunning | subscription.past_due, subscription_payment_retry.failed |
returns | return.created, return.updated, return.decision_recorded, return.canceled, return.completed, return.reopened |
invoices | invoice.created, invoice.issued, invoice.sent, invoice.updated, invoice.reminder_due, invoice.paid, invoice.reopened, invoice.marked_uncollectible, invoice.voided, invoice_delivery_attempt.sent, invoice_delivery_attempt.failed, invoice_delivery_attempt.suppressed, invoice_payment_attempt.processing, invoice_payment_attempt.succeeded, invoice_payment_attempt.failed, credit_note.issued |
The webhook events catalog has each payload.
Email on the moments the buyer cares about#
Not every event warrants an email. Send on the moments Flint emails for, and ignore the rest:
- Fulfillment. Flint emails on the package and fulfillment actions listed in What the buyer receives, such as a package shipped or delivered.
fulfillment_event.createdrecords each of those moments withprevious_statusandcurrent_status. It also records tracking changes and carrier scans, which Flint doesn't email.shipment.updatedandpackage.updatedfire for any change to the resource, including metadata, shipping details, and package items, andfulfillment.updatedalso fires foraccept,hold, andrelease_hold. Flint emails none of those, and buyers never see a hold. - Payment retries. A retry on a past-due subscription, started by the buyer from their account or by you, sends
subscription_payment_retry.created, thensubscription_payment_retry.succeededorsubscription_payment_retry.failed. If you send your own dunning email, use them to tell the buyer how the retry went. See Recover a past-due subscription. - Invoices. Send the invoice on
invoice.issued, and a reminder on eachinvoice.reminder_due. Event payloads leave outpublic_url, so take the link from the issue response or fromGET /v1/invoices/{invoice_id}. The invoice carriesdelivery_mode, so one handler covers invoices Flint emails and invoices you deliver. Send a credit note email oncredit_note.issued, with the credit note PDF fromGET /v1/credit-notes/{credit_note_id}/pdf. See What the buyer receives.
Choosing the right event covers the events most integrations build on.
Link the buyer to their order#
Flint's own email links the buyer to the order, subscription, or Return in your Flint-hosted customer account, and the link opens it without a sign-in. Your email can carry the same link.
- Flint sends order.paid webhook to Your server
- Your server sends POST /v1/orders/{order_id}/access-links to Flint
- Flint returns url and expires_at to Your server
- Your server sends your receipt email, with the url to Buyer
- Buyer sends opens the order in the customer account to Flint
Create the link while you write the message. Key the request on the webhook event, so a redelivered event returns the same link instead of creating another:
curl -X POST https://api.withflintpay.com/v1/orders/ord_01J5Z8N3QK4W7Y2RB6TPVXHC9D/access-links \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: receipt-whev_1kmn0aExample"
{
"data": {
"url": "https://links.withflintpay.com/account/YnV5ZXItYWNjb3VudC1saW5rOnYx.eyJ2IjoxfQ.kX8uY2Vy7Qp4Ht0Wm3Ja9Ls6Rd1Fb5Nc2Gz8Vq4Ek0#g=flint_bag_Tq3Zr8Wn1Kc6Lm0Pv5Xs9Hd2Fj7Gb4Ya8Ue3Ni6Ro1",
"expires_at": "2026-11-02T15:04:05Z",
"purpose": "order_view"
},
"request_id": "req_01KWM6D5YQY7N98R7XAY7VRQ7S"
}
Put url in the message unchanged. It resolves when the buyer opens it, so it follows your current custom domain.
Orders have no receipt_url field, because a permanent link in every order and webhook would be a long-lived key to the buyer's details. To attach a PDF receipt to your own email, download it with GET /v1/orders/{order_id}/receipt-pdf once the order has a successful payment or gift card redemption, the same condition as send-receipt. It works under either order_receipts mode; see Receipts and buyer links.
Past either limit, a buyer with a link Flint emailed can request a new link from the expired-link page, with sign-in as another option. Flint sends the replacement to the order's current buyer_email (also for a Return), or the subscription customer's current email, with the original link's permissions. Replacements are limited to one per 10 minutes and three per 24 hours per object. Links your integration creates ask the buyer to contact your store for a replacement; create a new access link for them. Revoked links cannot be reissued. Store policy and the subscription's state still decide which actions a subscription_manage link offers; see Subscriptions. The order and Return routes take no body, or an empty {}.
The failed-payment link Flint emails can also cancel, pause, or undo a scheduled cancellation, as well as replace the card and retry payment. The subscription's state and your store policy decide which actions are offered. Canceling a past-due subscription ends it immediately and stops further payment retries.
Links already sent gain these permissions when opened after this change. A session opened earlier keeps its original permissions until it ends, within 24 hours.
Treat the link as a credential#
Anyone who has the link can open what it opens, so handle it like a password reset link:
- Send it only to that buyer, and keep it out of logs and analytics.
- Create a new link for each message. A call with a new
Idempotency-Keycreates another link; earlier links keep working until they expire. - Flint returns
urlonly in the create response, and again to a retry with the sameIdempotency-Keyunder the one-time secret rules. A retry returns the original link without extending its lifetime or restoring its opens. Without a key, every call creates a new link and can't be replayed. - If Flint can't keep the result after creating a link, contact support with the request ID before you send another request.
When Flint refuses a link#
Email Flint always sends#
customer_email_delivery doesn't cover these. Flint sends them whatever the families say:
- Sign-in codes for the Flint-hosted customer account.
- A sign-in notice after each sign-in with an emailed code. It comes from Flint rather than your store, is titled "New sign-in to your Flint account", names the device and time, and links to the buyer's sessions so they can remove one they don't recognize.
- Codes that confirm an email change, sent to the new address and to the current one when the account already has an email. The buyer enters them to prove they own each address. In both
flint_hostedandmerchant_hostedaccount modes, these emails use your current store display name, logo, and support contact when sent. The subject is "Confirm your email change for {store name}". The From name is your store display name, and the sender address is Flint's verified address. Without a logo, the header shows your store name alone; without a support contact, the support line is omitted. - Verification codes from checkout and from linking a buyer's guest purchases.
Other settings control these:
- Ticket emails for event payment links follow the link's
send_ticket_emails. See Payment links. - Checkout reminder email, to a buyer who left hosted checkout without paying, follows
checkout.recovery_email. It's off by default. - A gift card email you request with
POST /v1/gift-card-notificationsis always sent.
Next steps#
WebhooksWebhook events catalogBuild your own customer accountCustomer email changes started by staff#
For a staff-started change, Flint sends a store-branded confirmation email to the proposed address. The link lasts seven days and changes nothing until the recipient presses Confirm. After confirmation, Flint sends the old address a notice with the store's support contact, unless the customer had no email. That notice has no undo link and does not reveal the new address. Both emails use the store's sender name, logo, and Reply-To. These account security emails are not an opt-out category.
If Flint cannot queue an email-change confirmation, the request returns 503 SERVICE_UNAVAILABLE. The request changed nothing and does not count toward the customer's email-change limit, so retry with the same key. A response with reason template_not_configured means the email service is not configured for this message type; contact Flint support before retrying.