Migrating from Stripe
Move a Stripe integration to Flint one flow at a time: hosted checkout, payment links, an embedded Payment Element, saved cards, subscriptions, invoices, refunds, and webhooks. For each flow, replace the Stripe calls you make today with the Flint requests shown.
Flint processes cards on Stripe, so your browser code keeps Stripe.js and Stripe Elements. What changes is your backend and your webhook handler. Your backend calls Flint instead of Stripe, and Flint's responses tell Stripe.js which account and publishable key to use. You don't need your own Stripe account: Flint sets up the Stripe account your business processes on. The customers, prices, saved cards, and subscriptions in your current Stripe account stay there, so you recreate them on Flint.
The larger change is the model. A Stripe integration usually starts from a payment object (a PaymentIntent, a Checkout Session, an Invoice) and keeps the cart, tax, and discounts in your own code. Flint starts from the order: Flint prices the line items, discounts, tax, and delivery on the server, an order's payments settle against its balance, and a refund names the items it reverses. With a payments API that has orders, tax, and refunds built in, your code stops recomputing totals.
Browser
Stays the same
Stripe.js, the Payment Element, Apple Pay and Google Pay, and 3D Secure challenges in the browser.
Backend
Changes
The API you call, IDs, request and response shapes, who confirms a payment, webhook verification, and event names.
Stripe objects and their Flint equivalents#
| Job | Stripe | Flint | Notes |
|---|---|---|---|
| Store a buyer | Customer | Customer, cus_ | |
| Save a card for later | SetupIntent, then PaymentMethod | POST /v1/payment-methods, which returns a payment method pm_ with its Stripe setup | |
| Take a payment on your page | PaymentIntent confirmed in the browser | An order paid by your backend, or a standalone payment intent your backend confirms | |
| Hosted one-time checkout | Checkout Session, mode=payment | Checkout session, cs_ | |
| Checkout inside your page | Embedded Checkout, ui_mode: embedded | Headless checkout with surface: "embedded" | No equivalent iframe: you build the checkout screens and mount Stripe Elements |
| One link for many buyers | Payment Link | Payment link, pl_ | |
| Sell catalog items | Product and one-time Price | Product and variant, prod_ and var_ | |
| Recurring price | Product and recurring Price | Subscription plan, plan_ | |
| Recurring billing | Subscription | Subscription, sub_ | |
| Bill on terms | Invoice | Invoice, inv_ | |
| Discounts | Coupon and promotion code | Promotion, promo_ | |
| Sales tax | Stripe Tax | Automatic sales tax on the order | |
| Give money back | Refund | Refund, ref_ | |
| Credit an invoice | Credit note | Credit note | |
| Chargebacks | Dispute | Dispute, du_ | |
| Fraud screening | Radar rules and lists | Risk controls | You write your own rules and lists; recreate yours rather than importing them |
| Move money to your bank | Payout | Payout | |
| Match payouts to sales | Balance transaction | Reconciliation and the balance transaction endpoints | |
| Buyers manage their own billing | Customer portal | Customer account | Buyers see orders, subscriptions, and returns in Flint's hosted account, or in one you build on /v1/me |
| Simulate time for subscriptions | Test clock | Test clock | |
| Platform onboarding | Connect | Partner app installs and API & agent onboarding | No equivalent for application fees, revenue share, or payment splits |
| In-person card readers | Terminal | Devices | No equivalent: a Flint device records the register or kiosk that handled a fulfillment, not a card reader that takes payments |
| Notify your server | Webhook endpoint and Event | Webhook endpoint whep_, webhook event whev_ |
Several prefixes match Stripe's (cus_, pm_, pi_, cs_, sub_, prod_), so a prefix doesn't tell you which system an ID came from. A Flint ID is the prefix followed by 26 uppercase letters and digits, and Flint rejects a Stripe ID in a field that takes a Flint ID. Keep each Stripe ID in the Flint resource's external_reference_id or metadata, and look records up by it during the cutover.
Before you start#
- Keys and URL. Use a sandbox key (
flint_test_...) from the dashboard againsthttps://api.withflintpay.com, sent asAuthorization: Bearer. Sandboxes and Testing cover test data and test cards. - JSON bodies. Flint takes
application/json, not form-encoded parameters. Nested objects are JSON objects, notmetadata[key]=valuepairs. - Money. Every amount is a
Moneyobject with an integer in minor units and an uppercase currency:{"amount": 2999, "currency": "USD"}where Stripe takesamount=2999¤cy=usd. See Money and amounts. - Metadata. Up to 50 keys, keys up to 256 characters and values up to 4,096. Values can't be empty, and keys starting with
flint_are reserved. - Idempotency. Send
Idempotency-Keyon every write that accepts one. On routes that require one, such as creating a subscription, paying an order, or creating a refund, Flint keeps the key for as long as the result exists, not for 24 hours, so a late retry never charges twice. Idempotency lists the routes. - Errors. Validation failures return
400 INVALID_REQUESTwithparamnaming the field. Error handling describes the envelope.
Plan the cutover#
Run both systems side by side and move one flow at a time:
- Recreate your catalog and recurring prices as products and subscription plans.
- Register a Flint webhook endpoint and deploy a handler for Flint events next to your Stripe handler.
- Send new purchases to Flint: hosted checkout, payment links, or your own payment page.
- Move customers and subscribers in batches, each before Stripe's next renewal for that subscriber.
- Keep Stripe running for payments it already took. A refund or dispute on a Stripe payment is handled in Stripe; Flint refunds only payments Flint collected.
Past orders and refunds#
Flint doesn't import order or payment history: no route creates a paid order for a sale Stripe already took. Keep your Stripe history in Stripe and in your own records, and refund payments made before the cutover in Stripe. Store each Stripe ID on the Flint objects you do create, in external_reference_id and metadata, so a support tool can find the Stripe charge behind a Flint customer, subscription, or order. Subscribers are the exception to a clean break: Move subscribers without charging twice covers recreating them.
Move customers#
Create one Flint customer per Stripe customer you still bill. Put the Stripe customer ID in external_reference_id and use it in the idempotency key, so rerunning the import never creates a duplicate:
curl -X POST https://api.withflintpay.com/v1/customers \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: import-customer-cus_PxStripeExample" \
-d '{
"name": "Ada Lovelace",
"email": "ada@example.com",
"external_reference_id": "cus_PxStripeExample",
"metadata": {"stripe_customer_id": "cus_PxStripeExample"},
"on_email_conflict": "return_existing"
}'
on_email_conflict: "return_existing" returns an active customer that already has that email, unchanged and with 200, instead of creating a second one. That customer keeps the external_reference_id it had, so update it if you need the Stripe ID there. Without the field, a duplicate email returns 409 ALREADY_EXISTS naming the existing customer. Matching ignores case.
Store data.customer_id beside the Stripe ID in your database. To find a customer by its Stripe ID later, filter the list:
curl "https://api.withflintpay.com/v1/customers?external_reference_id=cus_PxStripeExample" \
-H "Authorization: Bearer YOUR_API_KEY"
Saved cards and subscribers#
Flint has no route that imports cards or payment methods, and it doesn't copy cards from Stripe. Every subscriber and every customer with a card on file saves a card on Flint again, and the buyer does it themselves in the browser. Plan for that before the cutover:
- Create the customer. Move customers first, so each buyer has a Flint
customer_id. - Ask the buyer to save a card. Either build a card form with
POST /v1/payment-methods, which takes thecustomer_idand returns the Stripe setup the browser confirms, or send the buyer to Flint's customer account to add a card under settings. Save the subscriber's card on Flint has both. Save a card and charge it later covers statuses and refused cards. - Import the subscription once the card is
active. Create it withbilling_start.typeset toimported, so Flint continues from the period Stripe already billed. Import the subscription has the request. - Stop Stripe renewing it. Set
cancel_at_period_endon the Stripe subscription after the Flint one exists.
Schedule each subscriber's request to arrive well before their Stripe current_period_end, and import them before it. A subscriber who hasn't saved a card has no Flint subscription, so Flint never charges them. Stripe keeps billing them until you cancel there, so don't cancel the Stripe subscription before the Flint one exists. If the Stripe period ends first, let Stripe renew once and import the new period. Reminders and a batch ordered by renewal date keep the cutover short.
Move subscribers without charging twice#
Cards saved in your Stripe account don't move to Flint, and a Flint subscription needs an active Flint payment method. So each subscriber saves a card on Flint, then you import their subscription with the period they already paid Stripe for. Flint charges nothing for that period and takes over at the next renewal.
Import the subscription while its Stripe period is still running. A period that has already ended, or a period_started_at in the future, returns 400 INVALID_REQUEST on billing_start.period_started_at. If a subscriber hasn't saved a card before Stripe's period ends, let Stripe renew once and import the new period.
A subscriber still in a Stripe trial hasn't paid for a period yet, so don't import them. Create their subscription with "billing_start": {"type": "scheduled", "starts_at": "..."} set to the Stripe trial's end, which charges nothing before then. A scheduled start can't be combined with a plan that has a trial (400 INVALID_REQUEST), so use a plan without trial_period_days for these subscribers.
To keep setting renewal dates from your own system during the cutover, add "billing_schedule": {"owner": "external"} and supply each date, as Control the billing schedule describes.
New subscribers#
New signups start on Flint directly. For a hosted signup page, create a checkout session with type: "subscription_plan" and the subscription_plan_id, or one payment link per plan with subscription_plan_id instead of line_items. Flint creates the subscription and saves the card when the buyer pays. To create a subscription from your backend for a customer with a saved card, send "billing_start": {"type": "immediate"}, which collects the first payment now. Subscription billing covers trials, renewals, failed payments, and plan changes.
Replace Stripe Checkout#
A Stripe Checkout Session with mode=payment becomes a Flint checkout session. Redirect the buyer to data.url in the response, as you redirect to Stripe's url today.
Note: Coming from Stripe Embedded Checkout?
Flint has no iframe checkout to mount in your page. Use hosted checkout, or build your own with surface: "embedded" and Stripe Elements. An embedded session has no url, because you render every screen yourself. Build your own checkout covers it.
For a one-off amount with no order of your own, use type: "quick_pay". Flint creates the order behind it:
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: checkout-consulting-001" \
-d '{
"type": "quick_pay",
"quick_pay_item": {
"name": "Consulting session",
"amount_money": {"amount": 15000, "currency": "USD"}
},
"buyer_fields": {"require_email": true},
"redirects": {
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel"
}
}'
Where your Stripe code builds line_items with price_data, create a Flint order with those items first and pass its order_id with type: "order". The order stays the record of the sale through payment, refunds, and reporting:
curl -X POST https://api.withflintpay.com/v1/checkout-sessions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: checkout-ord-1kmn0a-001" \
-d '{
"type": "order",
"order_id": "ord_1kmn0aExample",
"buyer_fields": {"require_email": true},
"redirects": {"success_url": "https://example.com/orders/success"}
}'
Fulfill from the order.paid webhook, not from the redirect to success_url, as you would fulfill from checkout.session.completed today. Checkout sessions covers expiry, embedded checkout, tips, and promotions.
Replace Stripe Payment Links#
A Stripe Payment Link becomes a Flint payment link: one reusable URL for a site, a campaign, a QR code, or a sales email.
curl -X POST https://api.withflintpay.com/v1/payment-links \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: payment-link-spring-drop-001" \
-d '{
"name": "Spring merch drop",
"description": "Limited release t-shirt",
"line_items": [
{
"type": "custom_fixed",
"key": "shirt",
"name": "Limited Tee",
"quantity": 1,
"unit_price_money": {"amount": 3500, "currency": "USD"},
"allow_quantity_adjustment": true,
"min_quantity": 1,
"max_quantity": 5
}
],
"buyer_fields": {"require_email": true},
"redirects": {"success_url": "https://example.com/orders/success"}
}'
Share data.url. The same endpoint covers the other kinds of Stripe link:
- Subscriptions. Send
subscription_plan_idinstead ofline_items. - Donations. Send
payment_link_type: "donation". - Events and tickets. Send
payment_link_type: "event". - Tips. If you collect a tip as a separate step or a "Tip" line item, use the link's
tipsection instead. The hosted page asks for the tip and the order records it apart from the items. See Tips and charges.
If your app creates a Stripe link for each buyer, that is a checkout session on Flint. Payment links, checkout sessions, or invoices compares the three.
Replace PaymentIntents and the Payment Element#
With Stripe, your backend creates a PaymentIntent and the browser confirms it with stripe.confirmPayment. With Flint, the browser only creates a credential, and your backend sends it to Flint, which creates and confirms the payment. When you sell items, pay an order:
- Your backend sends POST /v1/orders to Flint
- Your backend sends GET /v1/orders/{order_id} to Flint
- Flint returns payment_collection to Your backend
- Your backend returns payment_collection to Browser
- Browser sends pm_... from stripe.createPaymentMethod to Your backend
- Your backend sends POST /v1/orders/{order_id}/pay to Flint
- Flint returns order_payment_attempt to Your backend
- Flint returns order.paid webhook to Your backend
Create the order where you created the PaymentIntent:
curl -X POST https://api.withflintpay.com/v1/orders \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: order-pro-annual-001" \
-d '{
"line_items": [{
"type": "custom",
"name": "Pro Plan Annual",
"quantity": 1,
"unit_price_money": {"amount": 9900, "currency": "USD"},
"fulfillment": {"requirement": "none"}
}]
}'
Read the order before you mount Elements. payment_collection.stripe replaces the client secret your backend sent the browser:
curl https://api.withflintpay.com/v1/orders/ord_1kmn0aExample \
-H "Authorization: Bearer YOUR_API_KEY"
{
"data": {
"order_id": "ord_1kmn0aExample",
"status": "open",
"payment_status": "unpaid",
"version": 1790760000,
"settlement_amounts": {
"outstanding_money": {"amount": 9900, "currency": "USD"}
},
"payment_collection": {
"stripe": {
"account_id": "acct_1AbcPlaceholder",
"publishable_key": "pk_test_51AbcPlaceholder",
"elements": {
"next_step": "collect_payment_source",
"submit_to": "pay_order",
"mode": "payment",
"amount_money": {"amount": 9900, "currency": "USD"},
"payment_method_types": ["card"],
"payment_method_creation": "manual"
}
}
}
}
}
In the browser, create Stripe with the returned key and account, mount Elements in deferred mode, and create a PaymentMethod where you called stripe.confirmPayment:
const {stripe: collection} = paymentCollection;
const guidance = collection.elements;
const stripe = Stripe(collection.publishable_key, {
stripeAccount: collection.account_id,
});
const elements = stripe.elements({
mode: guidance.mode,
amount: guidance.amount_money.amount,
currency: guidance.amount_money.currency.toLowerCase(),
paymentMethodCreation: guidance.payment_method_creation,
paymentMethodTypes: guidance.payment_method_types,
});
elements.create("payment").mount("#payment-element");
// On submit, instead of stripe.confirmPayment:
const {error: submitError} = await elements.submit();
if (submitError) throw submitError;
const {error, paymentMethod} = await stripe.createPaymentMethod({elements});
if (error) throw error;
// Post paymentMethod.id to your backend.
This assumes a read with your API key, where next_step is collect_payment_source. Under a checkout session credential, follow Embedded payments.
Your backend pays the order with it. Send the balance and version from the read, so Flint refuses the payment with 409 VERSION_CONFLICT if the total changed after the buyer saw it:
curl -X POST https://api.withflintpay.com/v1/orders/ord_1kmn0aExample/pay \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: pay-ord_1kmn0aExample-pm_1kmn0aExample" \
-d '{
"action": "pay",
"payment_source": {"credential_type": "token", "token": "pm_1kmn0aExample"},
"expected_outstanding_money": {"amount": 9900, "currency": "USD"},
"expected_version": 1790760000
}'
Error handling changes in two ways:
- Declines are not errors. Stripe returns
402with acard_errorfor a decline. Flint returns200for every outcome, and you act ondata.order_payment_attempt.status:succeeded,failedwith the reason in the payment intent'slast_payment_error, orrequires_action. - 3D Secure runs from a pending action. On
requires_action, the browser runsstripe.handleNextActionwith the client secret inorder_payment_attempt.pending_actions[0].client_action, and your backend sendsaction: "resume"with theorder_payment_attempt_idand a newIdempotency-Key. Pass that secret only tohandleNextAction: it can also confirm the payment.
Never call stripe.confirmPayment for an order: payment_collection holds no PaymentIntent client secret to confirm. Embedded payments with Stripe Elements has the complete flow, including 3D Secure, retries after a decline, and confirmation tokens for checkout sessions.
If you charge an amount with no items, such as a balance top-up, use a standalone payment intent instead. Your backend creates it with POST /v1/payment-intents, the browser creates a Stripe ConfirmationToken, and your backend confirms with POST /v1/payment-intents/{payment_intent_id}/confirm. See Server-confirmed payments.
Replace SetupIntents for saved cards#
A Stripe SetupIntent becomes a Flint payment method you create for the customer. Its response carries the SetupIntent client secret the browser confirms:
curl -X POST https://api.withflintpay.com/v1/payment-methods \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: save-card-cus-1kmn0a-001" \
-d '{"customer_id": "cus_1kmn0aExample"}'
{
"data": {
"payment_method_id": "pm_1kmn0aExample",
"customer_id": "cus_1kmn0aExample",
"type": "card",
"status": "pending",
"usage": "off_session",
"is_default": false,
"client_setup": {
"stripe": {
"account_id": "acct_Example",
"publishable_key": "pk_test_Example",
"setup_intent": {
"stripe_js_call": "confirm_setup",
"client_secret": "seti_Example_secret_Example"
}
}
}
}
}
Send data.client_setup.stripe to the browser and confirm the setup with the returned account:
const stripe = Stripe(setup.publishable_key, {
stripeAccount: setup.account_id,
});
const elements = stripe.elements({
clientSecret: setup.setup_intent.client_secret,
});
elements.create("payment").mount("#payment-element");
// On submit:
const {error} = await stripe.confirmSetup({
elements,
confirmParams: {return_url: "https://example.com/account/cards"},
redirect: "if_required",
});
The payment method starts pending. When Stripe confirms the setup, Flint moves it to active and sends payment_method.activated. Only an active card can be charged, so wait for that event, or poll GET /v1/payment-methods/{payment_method_id}, before you use it. Then use its payment_method_id where you used the Stripe PaymentMethod:
POST /v1/subscriptions, aspayment_method_id.POST /v1/orders/{order_id}/payandPOST /v1/payment-intents/{payment_intent_id}/confirm, withcredential_type: "payment_method", to charge it later.PATCH /v1/customers/{customer_id}withdefault_payment_method_id, to make it the customer's default, which Stripe keeps ininvoice_settings.default_payment_method. Sendnullto clear the default.
To save the card while the customer pays, as Stripe's setup_future_usage: "off_session" does, set setupFutureUsage: "off_session" on Elements and confirm a standalone payment intent with save_payment_method: true. See Save the card for later charges.
Track saved cards with payment_method.activated, payment_method.failed, and payment_method.archived, which fires when a card is deleted. A change to the customer's default card sends customer.updated. Save a card and charge it later covers refused cards and duplicates.
Replace Stripe Invoicing#
Stripe's draft, finalize, and send steps become create and issue. collection_method becomes collection.mode:
| Stripe | Flint |
|---|---|
collection_method: send_invoice | collection.mode: "buyer_initiated": the buyer pays from the hosted invoice |
collection_method: charge_automatically | collection.mode: "automatic": Flint charges collection.payment_method_id, or the customer's default card, when it issues the invoice |
Invoices paid outside Stripe (paid_out_of_band) | collection.mode: "external", with POST /v1/invoices/{invoice_id}/manual-payments for each payment |
due_date or days_until_due | payment_due, with type: "date" and due_date, or saved payment terms |
| Finalize and send | POST /v1/invoices/{invoice_id}/issue, or issue on the create request |
Create and issue an invoice in one request:
curl -X POST https://api.withflintpay.com/v1/invoices \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: invoice-consulting-oct-001" \
-d '{
"type": "quick_pay",
"quick_pay": {
"customer_id": "cus_1kmn0aExample",
"line_items": [{
"type": "custom",
"name": "Consulting, October 2026",
"quantity": 1,
"unit_price_money": {"amount": 250000, "currency": "USD"},
"fulfillment": {"requirement": "none"}
}]
},
"collection": {"mode": "buyer_initiated"},
"payment_due": {"type": "date", "due_date": "2026-11-30"},
"recipient_email": "ap@example.com",
"issue": {"delivery_mode": "email"}
}'
The invoice is open with its invoice_number and a hosted public_url, which replaces Stripe's hosted_invoice_url, and Flint emails it to recipient_email. To bill an order you already built, send "type": "order" and its order_id instead of quick_pay.
For a "Pay now" button in your own app, call POST /v1/invoices/{invoice_id}/checkout-sessions and send the buyer to checkout_session.url. Collect an invoiced order only through that endpoint: the invoice owns collection while it is open, so a generic checkout session or payment for the order is refused.
To record a check or wire, call POST /v1/invoices/{invoice_id}/manual-payments. It is refused only while an online payment on the invoice is resolving, with OPERATION_IN_PROGRESS. Invoicing covers reminders, late fees, payment schedules, and voiding.
Subscription renewals don't create invoices on Flint. Each renewal creates an order that carries subscription_id and subscription_cycle. A handler that reads invoice.paid for renewals moves to subscription.payment_succeeded, as the event map shows.
Replace refunds#
A Stripe refund on a charge or PaymentIntent becomes a refund on the order or the payment intent. refund_type says how much, and has no default:
fullrefunds everything still refundable, as a Stripe refund with noamount.amountrefundsamount_money, as Stripe'samount.targetsrefunds named line items or charges, and Flint computes the amount.
curl -X POST https://api.withflintpay.com/v1/refunds \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: refund-ord-1kmn0a-full" \
-d '{
"refund_type": "full",
"order_id": "ord_1kmn0aExample",
"reason": "requested_by_customer",
"reason_message": "Customer canceled before fulfillment."
}'
If your Stripe code works out an item's share of the discount and tax before each partial refund, delete it. Send refund_type: "targets" with line_items naming the order_line_item_id and a quantity, and leave the amount out. Flint computes the amount and reverses that item's tax:
curl -X POST https://api.withflintpay.com/v1/refunds \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: refund-li-1kmn0a-one" \
-d '{
"refund_type": "targets",
"order_id": "ord_1kmn0aExample",
"line_items": [{"order_line_item_id": "li_1kmn0aExample", "quantity": 1}],
"reason": "defective_product"
}'
Check status on every create response. A Flint refund is pending, succeeded, partially_succeeded, or failed, and requires_action and canceled appear only on its payment_refunds entries. A refund that the card network or your balance rejects while the request runs still returns 201 and can already carry status: "failed" and a failure_reason. If it returns pending, follow the refund with GET /v1/refunds/{refund_id} or refund.* events. A 201 alone doesn't mean the money moved. See When a refund fails, and Stripe partial refund: discount and tax reversal for one return worked through on both APIs.
Replace webhooks#
Register a Flint endpoint for the events your handler needs:
curl -X POST https://api.withflintpay.com/v1/webhook-endpoints \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Idempotency-Key: webhook-endpoint-migration-001" \
-d '{
"url": "https://example.com/webhooks/flint",
"enabled_events": [
"order.paid",
"payment_intent.payment_failed",
"payment_method.activated",
"payment_method.failed",
"subscription.activated",
"subscription.payment_succeeded",
"subscription.past_due",
"subscription.canceled",
"invoice.paid",
"refund.succeeded",
"refund.partially_succeeded",
"refund.failed"
]
}'
Then change three things in your handler:
- Verification. Stripe signs with a shared secret in
Stripe-Signature. A new Flint endpoint signs each delivery with a bearer JWT: verify it and the raw body's hash against Flint's public JWKS, with thewebhook_endpoint_idas the audience. There is no secret to store. See Verify the signature. If you'd rather keep a shared-secret verifier, create the endpoint with"signing_methods": ["hmac"]. The create response returns thesecretonce, and deliveries follow Standard Webhooks. - Deduplication. Deduplicate on the body's
webhook_event_id, also sent as thewebhook-idheader, where you used the Stripe event ID. It is the same on every retry and resend. - Event names. Route on
event_type, and read the resource fromdata.object.
Map Stripe events to Flint events#
| Your handler | Stripe event | Flint event |
|---|---|---|
| Fulfills a paid purchase | Stripe eventcheckout.session.completed, payment_intent.succeeded | Flint eventorder.paid |
| Records a payment with no order | Stripe eventpayment_intent.succeeded | Flint eventpayment_intent.succeeded |
| Reports a failed payment | Stripe eventpayment_intent.payment_failed | Flint eventpayment_intent.payment_failed |
| Marks a saved card usable | Stripe eventsetup_intent.succeeded | Flint eventpayment_method.activated |
| Reports a refused card setup | Stripe eventsetup_intent.setup_failed | Flint eventpayment_method.failed |
| Provisions a subscriber | Stripe eventcustomer.subscription.created, first invoice.paid | Flint eventsubscription.activated |
| Extends access on renewal | Stripe eventinvoice.paid | Flint eventsubscription.payment_succeeded |
| Prompts for a new card | Stripe eventinvoice.payment_failed | Flint eventsubscription.past_due |
| Warns before a trial ends | Stripe eventcustomer.subscription.trial_will_end | Flint eventsubscription.trial_ending |
| Revokes access | Stripe eventcustomer.subscription.deleted | Flint eventsubscription.canceled |
| Marks an invoice paid | Stripe eventinvoice.paid | Flint eventinvoice.paid |
| Confirms a refund | Stripe eventcharge.refunded, refund.updated | Flint eventrefund.succeeded, refund.partially_succeeded, refund.failed |
| Responds to a chargeback | Stripe eventcharge.dispute.created | Flint eventdispute.created |
order.paid fires once an order is paid in full, whatever paid it: hosted checkout, a payment link, your own page, or an invoice. One subscription covers every purchase flow. Which Stripe webhook event should you trust? explains the choice for each Stripe event, and the event catalog covers the Flint side.
Migration checklist#
- Recreate catalog items as products and recurring prices as subscription plans, with the Stripe IDs in
external_reference_id. - Create a Flint customer for every Stripe customer you still bill.
- Register a Flint webhook endpoint, verify its signatures, and route Flint event names.
- Point hosted checkout, payment links, and your own payment page at Flint, and remove
stripe.confirmPaymentfrom order payments. - Have each subscriber save a card on Flint, import their subscription with
billing_start.type: "imported", and setcancel_at_period_endon the Stripe subscription. - Move invoices you still issue to Flint invoices.
- Keep Stripe running until refunds and disputes on Stripe payments are settled.
