Skip to content

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#

JobStripeFlintNotes
Store a buyerCustomerCustomer, cus_
Save a card for laterSetupIntent, then PaymentMethodPOST /v1/payment-methods, which returns a payment method pm_ with its Stripe setup
Take a payment on your pagePaymentIntent confirmed in the browserAn order paid by your backend, or a standalone payment intent your backend confirmsSelling items: an order. A bare amount: a payment intent. Which to use
Hosted one-time checkoutCheckout Session, mode=paymentCheckout session, cs_
Checkout inside your pageEmbedded Checkout, ui_mode: embeddedHeadless checkout with surface: "headless"No equivalent iframe: you build the checkout screens and mount Stripe Elements
One link for many buyersPayment LinkPayment link, pl_
Sell catalog itemsProduct and one-time PriceProduct and variant, prod_ and var_
Recurring priceProduct and recurring PriceSubscription plan, plan_
Recurring billingSubscriptionSubscription, sub_
Bill on termsInvoiceInvoice, inv_
DiscountsCoupon and promotion codePromotion, promo_
Sales taxStripe TaxAutomatic sales tax on the order
Give money backRefundRefund, ref_
Credit an invoiceCredit noteCredit note
ChargebacksDisputeDispute, du_
Fraud screeningRadar rules and listsRisk controlsYou write your own rules and lists; recreate yours rather than importing them
Move money to your bankPayoutPayout
Match payouts to salesBalance transactionReconciliation and the balance transaction endpoints
Buyers manage their own billingCustomer portalCustomer accountBuyers see orders, subscriptions, and returns in Flint's hosted account, or in one you build on /v1/me
Simulate time for subscriptionsTest clockTest clock
Platform onboardingConnectPartner app installs and API & agent onboardingApplication 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 readersTerminalReaders and In-person paymentsFlint 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 serverWebhook endpoint and EventWebhook 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 against https://api.withflintpay.com, sent as Authorization: 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, not metadata[key]=value pairs.
  • Money. Every amount is a Money object with an integer in minor units and an uppercase currency: {"amount": 2999, "currency": "USD"} where Stripe takes amount=2999&currency=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-Key on 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_REQUEST with param naming the field. Error handling describes the envelope.

Plan the cutover#

Run both systems side by side and move one flow at a time:

  1. Recreate your catalog and recurring prices as products and subscription plans.
  2. Register a Flint webhook endpoint and deploy a handler for Flint events next to your Stripe handler.
  3. Send new purchases to Flint: hosted checkout, payment links, or your own payment page.
  4. Move customers and subscribers in batches, each before Stripe's next renewal for that subscriber.
  5. 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
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
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.

  1. Map your customers. Move customers first. Give Flint the old customer IDs and the corresponding Flint customer_id values. If you already stored those IDs as unique external_reference_id values, tell Flint. Never send card numbers or security codes to Flint.
  2. 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.
  3. 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 with billing_start.type: imported and the period Stripe already billed. Flint doesn't bill that period again.
  4. 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_end in 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 new Idempotency-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.

  1. Create the plan#

    Recreate each recurring Stripe Price as a subscription plan. Stripe's interval of day, week, month, or year becomes billing_interval daily, weekly, monthly, or yearly, and interval_count becomes billing_interval_count:

    cURL
    curl -X POST https://api.withflintpay.com/v1/subscription-plans \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Idempotency-Key: plan-pro-monthly-v1" \
      -d '{
        "name": "Pro Monthly",
        "billing_interval": "monthly",
        "billing_interval_count": 1,
        "currency": "USD",
        "line_items": [
          {
            "type": "custom",
            "name": "Pro Plan",
            "unit_price_money": {"amount": 2999, "currency": "USD"},
            "quantity": 1
          }
        ],
        "trial_period_days": 14,
        "external_reference_id": "price_PxStripeExample"
      }'
    

    The trial applies to new signups. An imported subscription has already paid, so it skips the trial.

  2. Save the subscriber's card on Flint#

    If Flint couldn't migrate the card, the subscriber saves one on a page you build or in Flint's hosted customer account:

    • Your page. Your backend calls POST /v1/payment-methods with the customer_id, and the browser confirms the returned setup with stripe.confirmSetup, as Replace SetupIntents shows.
    • Flint's account. Email the subscriber a link to your customer account, where they sign in with their email and add a card under settings. Make it their default with PATCH /v1/customers/{customer_id} and default_payment_method_id, or pass its ID in the next step.

    Wait for payment_method.activated, or for the payment method's status to be active, before you bind it to the subscription or pass it in the import.

  3. Preview the import#

    Send the create body to POST /v1/subscription-previews with mode: "create" first. It checks the proposed terms and billing schedule, lists validation failures, and creates nothing. The create checks for an existing subscription with the same external reference when it saves the import. Import subscribers from another tool has the request and response.

  4. Import the subscription#

    Use the Stripe subscription ID as external_reference_id and keep the same Idempotency-Key when retrying its import. Even with a new key, Flint refuses an imported create if a subscription with that reference has not ended in the same merchant environment. The response is 409 ALREADY_EXISTS; details[0].current_resource identifies the existing subscription. Retrieve that subscription and continue the migration with its ID. A scheduled cancellation still blocks another import until the subscription ends.

    Set billing_start to imported. period_started_at is the start of the period the subscriber is in now on Stripe: the subscription item's current_period_start in recent Stripe API versions. completed_cycles is how many periods Stripe has charged, including the current one, so the next renewal's subscription_cycle continues from it. It must be at least 1. Omit it to start at 1 and give the first Flint renewal subscription_cycle: 2:

    cURL
    curl -X POST https://api.withflintpay.com/v1/subscriptions \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Idempotency-Key: import-sub_PxStripeExample" \
      -d '{
        "terms": {
          "type": "subscription_plan",
          "subscription_plan_id": "plan_1kmn0aExample"
        },
        "customer_id": "cus_1kmn0aExample",
        "payment_method_id": "pm_1kmn0aExample",
        "billing_start": {
          "type": "imported",
          "period_started_at": "2026-10-15T00:00:00Z",
          "completed_cycles": 7
        },
        "external_reference_id": "sub_PxStripeExample"
      }'
    
    Response
    {
      "data": {
        "subscription_id": "sub_1kmn0aExample",
        "status": "active",
        "customer_id": "cus_1kmn0aExample",
        "subscription_plan_id": "plan_1kmn0aExample",
        "payment_method_id": "pm_1kmn0aExample",
        "current_period_start_at": "2026-10-15T00:00:00Z",
        "current_period_end_at": "2026-11-15T00:00:00Z",
        "next_billing_at": "2026-11-15T00:00:00Z",
        "completed_cycles": 7,
        "billing_anchor_day": 15,
        "external_reference_id": "sub_PxStripeExample"
      }
    }
    

    The subscription is active at once and sends subscription.created and subscription.activated. Flint computes the period end from the plan's interval and charges the saved card at next_billing_at. Check that it matches the Stripe subscription's current_period_end. Leave out payment_method_id and Flint uses the customer's default_payment_method_id. If the customer has no usable default, the subscription is created with payment_method_id: null and a payment_method_due_at time, and sends subscription.created with both.

    If next_billing_at differs from the Stripe subscription's current_period_end, correct it right after the create. The import always ends the first Flint period one full interval after period_started_at. A Stripe subscription in a period shorter than one interval, such as a first period cut short by billing_cycle_anchor, would get the extra days unbilled. Send the Stripe period end and the billing day in billing_schedule, alone in the request:

    cURL
    curl -X PATCH https://api.withflintpay.com/v1/subscriptions/sub_1kmn0aExample \
      -H "Content-Type: application/json" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Idempotency-Key: import-schedule-sub_PxStripeExample" \
      -d '{
        "billing_schedule": {
          "owner": "flint",
          "next_billing_at": "2026-11-01T00:00:00Z",
          "billing_anchor_day": 1
        }
      }'
    

    This example moves the date from the full interval's end, November 15, back to the end of the Stripe period. The period end becomes next_billing_at, and later renewals bill on billing_anchor_day. Control the billing schedule has the rules.

    Each imported subscriber also gets Flint's "You're subscribed" email shortly after the import, and a request to add a card when the subscription has none. To send your own message instead, such as one that explains the move, set customer_email_delivery.subscription_lifecycle to merchant_sends before you import, and send from subscription.created. Do this for any subscriber whose date you correct: Flint's email quotes the date from the create, before your PATCH. That setting covers every subscription notice, including renewal and cancellation emails, so switch it back after the cutover if you want Flint to send those. Customer email delivery has the setting and the events.

  5. Stop Stripe from renewing#

    Once the Flint subscription exists, set cancel_at_period_end to true on the Stripe subscription. The subscriber keeps the period they paid for, Stripe doesn't charge again, and Flint bills the next period.

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.

  • HTTP 400
    param names the field to correct. On billing_start.period_started_at, the imported period has ended or hasn't started: send the start of the period the subscriber is in now. On payment_method_id with detail code REQUIRED, a start other than imported names no card and the customer has no default: save a card first. An imported start can omit the card. With detail code NOT_ALLOWED, the card was saved with usage: "on_session", which can't be charged for renewals: save one for later charges. On an ID field, the value isn't a Flint ID, often because it is the Stripe ID.
  • HTTP 409
    Reason status_not_reached: the card is still pending. Wait for payment_method.activated, then send the request again; next_steps says whether you can reuse its Idempotency-Key. Reason unsupported_state: the card is failed, expired, or archived, so ask the subscriber for another card.

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
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
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.

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
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_id instead of line_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 tip section 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:

Paying an order from your own pageResponse
BrowserYour backendFlintPOST /v1/ordersGET /v1/orders/{order_id}payment_collectionpayment_collectionctoken_... from stripe.createConfirmationTokenPOST /v1/orders/{order_id}/payorder_payment_attemptorder.paid webhook
  1. Your backend sends POST /v1/orders to Flint
  2. Your backend sends GET /v1/orders/{order_id} to Flint
  3. Flint returns payment_collection to Your backend
  4. Your backend returns payment_collection to Browser
  5. Browser sends ctoken_... from stripe.createConfirmationToken to Your backend
  6. Your backend sends POST /v1/orders/{order_id}/pay to Flint
  7. Flint returns order_payment_attempt to Your backend
  8. Flint returns order.paid webhook to Your backend

Create the order where you created the PaymentIntent:

cURL
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
curl https://api.withflintpay.com/v1/orders/ord_1kmn0aExample \
  -H "Authorization: Bearer YOUR_API_KEY"
Response
{
  "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:

JavaScript
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
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 402 with a card_error for a decline. Flint returns 200 for every outcome, and you act on data.order_payment_attempt.status: succeeded, failed with the reason in the payment intent's last_payment_error, or requires_action.
  • 3D Secure runs from a pending action. Pay returns url actions by default: open each order_payment_attempt.pending_actions[].client_action.url in a redirect, popup, or iframe. To use stripe.handleNextAction, explicitly send client_action_type: "stripe". Then your backend sends action: "resume" with the order_payment_attempt_id and a new Idempotency-Key, or confirms the leg’s payment intent again without payment_source. Use a Stripe secret only with handleNextAction: 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
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"}'
Response
{
  "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:

JavaScript
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, as payment_method_id.
  • POST /v1/orders/{order_id}/pay and POST /v1/payment-intents/{payment_intent_id}/confirm, with credential_type: "payment_method", to charge it later. Where you sent Stripe's off_session: true, send customer_presence: "absent".
  • PATCH /v1/customers/{customer_id} with default_payment_method_id, to make it the customer's default, which Stripe keeps in invoice_settings.default_payment_method. Send null to 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:

StripeFlint
collection_method: send_invoicecollection.mode: "buyer_initiated": the buyer pays from the hosted invoice
collection_method: charge_automaticallycollection.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_duepayment_due, with type: "date" and due_date, or saved payment terms
Finalize and sendPOST /v1/invoices/{invoice_id}/issue, or issue on the create request

Create and issue an invoice in one request:

cURL
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:

  • full refunds everything still refundable, as a Stripe refund with no amount.
  • amount refunds amount_money, as Stripe's amount.
  • targets refunds named line items or charges, and Flint computes the amount.
cURL
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
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
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 the webhook_endpoint_id as 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 the secret once, and deliveries follow Standard Webhooks.
  • Deduplication. Deduplicate on the body's webhook_event_id, also sent as the webhook-id header, 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 from data.object.

Map Stripe events to Flint events#

Stripe events and the Flint events that replace them
Fulfills a paid purchaseStripe eventcheckout.session.completed, payment_intent.succeededFlint eventorder.paid
Records a payment with no orderStripe eventpayment_intent.succeededFlint eventpayment_intent.succeeded
Reports a failed paymentStripe eventpayment_intent.payment_failedFlint eventpayment_intent.payment_failed
Marks a saved card usableStripe eventsetup_intent.succeededFlint eventpayment_method.activated
Reports a refused card setupStripe eventsetup_intent.setup_failedFlint eventpayment_method.failed
Provisions a subscriberStripe eventcustomer.subscription.created, first invoice.paidFlint eventsubscription.activated
Extends access on renewalStripe eventinvoice.paidFlint eventsubscription.payment_succeeded
Prompts for a new cardStripe eventinvoice.payment_failedFlint eventsubscription.past_due
Warns before a trial endsStripe eventcustomer.subscription.trial_will_endFlint eventsubscription.trial_ending
Revokes accessStripe eventcustomer.subscription.deletedFlint eventsubscription.canceled
Marks an invoice paidStripe eventinvoice.paidFlint eventinvoice.paid
Confirms a refundStripe eventcharge.refunded, refund.updatedFlint eventrefund.succeeded, refund.partially_succeeded, refund.failed
Responds to a chargebackStripe eventcharge.dispute.createdFlint 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.confirmPayment from 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.

Next steps#

Subscription billingTrials, renewals, failed payments, and plan changes.Embedded payments with Stripe ElementsThe full order payment flow, with 3D Secure and declines.WebhooksSignatures, retries, and processing each event once.Migrating from SquareThe same moves from Square's APIs.Migrating from Lemon SqueezyMove a Lemon Squeezy store and its subscribers before the March 31, 2027 shutdown.

Was this helpful?