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

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 confirms
Hosted one-time checkoutCheckout Session, mode=paymentCheckout session, cs_
Checkout inside your pageEmbedded Checkout, ui_mode: embeddedHeadless checkout with surface: "embedded"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 onboardingNo equivalent for application fees, revenue share, or payment splits
In-person card readersTerminalDevicesNo equivalent: a Flint device records the register or kiosk that handled a fulfillment, not a card reader that takes payments
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. 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_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"

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:

  1. Create the customer. Move customers first, so each buyer has a Flint customer_id.
  2. Ask the buyer to save a card. Either build a card form with POST /v1/payment-methods, which takes the customer_id and 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.
  3. Import the subscription once the card is active. Create it with billing_start.type set to imported, so Flint continues from the period Stripe already billed. Import the subscription has the request.
  4. Stop Stripe renewing it. Set cancel_at_period_end on 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.

  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#

    The subscriber enters their card once more, either 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 import.

  3. Preview the import#

    Send the create body to POST /v1/subscription-previews with mode: "create" first. It runs every check a real create runs, lists every failure, and creates nothing. Import subscribers from another tool has the request and response.

  4. Import the subscription#

    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:

    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.

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

  • 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, the request names no card and the customer has no default: save a card first. 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 with a new Idempotency-Key, since the original key replays this refusal. 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: "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
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. Checkout sessions covers expiry, embedded 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_collectionpm_... from stripe.createPaymentMethodPOST /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 pm_... from stripe.createPaymentMethod 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": "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:

JavaScript
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
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 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. On requires_action, the browser runs stripe.handleNextAction with the client secret in order_payment_attempt.pending_actions[0].client_action, and your backend sends action: "resume" with the order_payment_attempt_id and a new Idempotency-Key. Pass that secret only to handleNextAction: 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
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").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.
  • 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 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:

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

  • 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.
  • Have each subscriber save a card on Flint, import their subscription with billing_start.type: "imported", and set cancel_at_period_end on the Stripe subscription.
  • 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.

Was this helpful?