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. Recreate your customers, prices, and subscriptions in Flint. Contact Flint to copy eligible saved cards.
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 | Selling items: an order. A bare amount: a payment intent. Which to use |
| Hosted one-time checkout | Checkout Session, mode=payment | Checkout session, cs_ | |
| Checkout inside your page | Embedded Checkout, ui_mode: embedded | Headless checkout with surface: "headless" | 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 | Application fees map to platform fees: a fixed amount per payment, within a cap the merchant approves. Splits of one payment to other sellers map to seller splits, which a marketplace creates with its own API key. Test mode works now, and live splits need Flint's approval of your platform. A split payment can't carry a platform fee, and Flint can't send a seller money outside a payment |
| In-person card readers | Terminal | Readers and In-person payments | Flint supports the Stripe Reader S710 (or S700), which your server drives through Flint with no reader SDK, and Tap to Pay on iPhone and Android with the Stripe Terminal SDK. A reader takes a payment through the order pay route, not a reader-specific route. US only, with no offline mode. A Flint device records the register or kiosk that runs your app, and is separate from a reader |
| 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. Routes that can create a money or stock movement require one. On those routes Flint keeps the key for as long as the result exists, not for 24 hours, so a late retry never charges twice. - 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"
Guest orders that were unlinked before the import stay unlinked. When a returning buyer checks out as a guest and types an imported customer's email, that order also stays unlinked (customer_id: null) and doesn't appear in the customer's order history. To attach earlier guest purchases, have the buyer verify that email with a Flint code, then call link-guest-purchases.
For future purchases, set customer_id on the order before checkout for a signed-in buyer, or let a guest verify their email in checkout where that option is available. After cutover, share your Flint customer account link so buyers can see the purchases linked to them.
Saved cards and subscribers#
Contact Flint to migrate saved cards before you start accepting payments for those customers on Flint. Flint coordinates the copy from Stripe and confirms eligibility for your source account. Stripe can copy eligible saved cards stored as PaymentMethods; it doesn't copy subscriptions. For Square, Braintree, or another processor, Flint first confirms that the processor can send a compatible export directly to Stripe.
- Map your customers. Move customers first. Give Flint the old customer IDs and the corresponding Flint
customer_idvalues. If you already stored those IDs as uniqueexternal_reference_idvalues, tell Flint. Never send card numbers or security codes to Flint. - Confirm which cards can move. Authorize the source copy and confirm that the buyers' existing permission covers future charges after the move. If a card is expired, ineligible, or needs fresh consent, ask the buyer to save a card.
- Import each subscription with its card. Use the mapping Flint provides to match the card the subscription uses in Stripe to its Flint
payment_method_id. Pass that ID withbilling_start.type: importedand the period Stripe already billed. Flint doesn't bill that period again. - Switch renewals one subscriber at a time. Before the old renewal can run, check that the Flint subscription has the right card and that its first charge matches the next unpaid period. Then set
cancel_at_period_endin Stripe and verify Stripe won't renew. If you defer the cutover, keep the renewal on Stripe. If you already created the Flint subscription, cancel it immediately and verify it has ended without charging the renewal. After Stripe renews, import the newly paid period with a newIdempotency-Key.
If you deliberately import before a card is ready, bind one before payment_method_due_at. Import without a card covers Flint's reminder and what happens if no card is bound by renewal.
Move subscribers without charging twice#
Use a migrated card or a card the buyer saves in Flint. Import 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. A subscriber who hasn't saved a card yet can still be imported before the period ends; bind their card before payment_method_due_at.
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: "headless" and Stripe Elements. A headless 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. Before you fulfill, check the order's dispute_status (access rules). Checkout sessions covers expiry, headless 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 ctoken_... from stripe.createConfirmationToken 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": "create_confirmation_token",
"submit_to": "pay_order",
"mode": "payment",
"amount_money": {"amount": 9900, "currency": "USD"},
"payment_options": ["card"],
"payment_method_creation": "manual"
}
}
}
}
}
In the browser, create Stripe with the returned key and account, mount Elements in deferred mode, and create a ConfirmationToken where you called stripe.confirmPayment:
const {stripe: collection} = paymentCollection;
const guidance = collection.elements;
const stripe = Stripe(collection.publishable_key, {
stripeAccount: collection.account_id,
});
// Stripe Elements takes processor method types. Apple Pay and Google Pay ride on card.
const STRIPE_METHOD_TYPES = {card: "card", apple_pay: "card", google_pay: "card", affirm: "affirm", ach_debit: "us_bank_account"};
const paymentMethodTypes = [...new Set(guidance.payment_options.flatMap((option) => STRIPE_METHOD_TYPES[option] ?? []))];
const elements = stripe.elements({
mode: guidance.mode,
amount: guidance.amount_money.amount,
currency: guidance.amount_money.currency.toLowerCase(),
paymentMethodCreation: guidance.payment_method_creation,
paymentMethodTypes,
});
elements
.create("payment", {
// Show only the wallets Flint offers; Stripe's default can show others.
wallets: {
applePay: guidance.payment_options.includes("apple_pay") ? "auto" : "never",
googlePay: guidance.payment_options.includes("google_pay") ? "auto" : "never",
},
})
.mount("#payment-element");
// On submit, instead of stripe.confirmPayment:
const {error: submitError} = await elements.submit();
if (submitError) throw submitError;
const {error, confirmationToken} = await stripe.createConfirmationToken({elements});
if (error) throw error;
// Post confirmationToken.id to your backend.
Every payment-mode read returns next_step: "create_confirmation_token", including API-key and checkout-session reads. Embedded payments covers the same browser flow for both.
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-ctoken_1kmn0aExample" \
-d '{
"action": "pay",
"payment_source": {"credential_type": "stripe_confirmation_token", "stripe": {"confirmation_token": "ctoken_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. Pay returns
urlactions by default: open eachorder_payment_attempt.pending_actions[].client_action.urlin a redirect, popup, or iframe. To usestripe.handleNextAction, explicitly sendclient_action_type: "stripe". Then your backend sendsaction: "resume"with theorder_payment_attempt_idand a newIdempotency-Key, or confirms the leg’s payment intent again withoutpayment_source. Use a Stripe secret only withhandleNextAction: it can also confirm the payment. Flint's API returns no secret for URL actions, but Stripe's authentication page can receive it during the challenge.
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 every payment.
To start the payment from a payment intent instead of pay, create the order's payment leg with POST /v1/payment-intents and order_id, then confirm it with the same payment_source. Server-confirmed payments shows both requests. If you charge an amount with no items, such as a balance top-up, use a standalone payment intent without an order. 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", {
// Show only the wallets Flint offers; Stripe's default can show others.
wallets: {
applePay: guidance.payment_options.includes("apple_pay") ? "auto" : "never",
googlePay: guidance.payment_options.includes("google_pay") ? "auto" : "never",
},
})
.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. Where you sent Stripe'soff_session: true, sendcustomer_presence: "absent".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 send save_payment_method: true when you pay the order or confirm a standalone payment intent. See Save a card while the customer pays for orders and Save the card for later charges for payment intents.
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/checkout-sessions with type: invoice and the invoice_id, and send the buyer to the session's url. Collect an invoiced order only that way: 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. - Migrate saved cards and subscribers. Verify the Flint subscription's card and first charge date before stopping the next renewal on Stripe.
- Move invoices you still issue to Flint invoices.
- Keep Stripe running until refunds and disputes on Stripe payments are settled.