Skip to content

Subscriptions

A subscription charges a customer's saved payment method on a schedule. Each charge creates an order with origin: "subscription", subscription_id, and subscription_cycle, so renewals get the same receipts, refunds, tax, and fulfillment as any other sale. A customer can hold several subscriptions, including more than one to the same plan. For the full integration, from signup to dunning, follow the subscription billing guide.

terms_type says where the terms come from. It never changes, and it's on every response and webhook payload:

  • With subscription_plan, a subscription plan sets the lines, intervals, trial, setup fee, and contract term. The subscription carries subscription_plan_id and can change plans.
  • With subscription_offer, the terms come from subscription offers on individual products, bought in a mixed cart or added through the API. There's no subscription_plan_id, each line carries its subscription_offer_id and its own quantity, and it can't change plans.

Each current or scheduled line_items entry includes its parent subscription_id on merchant and buyer reads and webhook snapshots. Renewal estimate lines include subscription_id when subscription_line_item_id identifies a saved line; both are null for new or replacement lines.

Delivery destinations and service locations include customer_id beside a saved customer_address_id. The parent is null when no saved address is referenced, including when the buyer projection withholds the address reference. Buyer responses expose only the subscription's own customer. Request inputs can still select a saved address by customer_address_id alone.

Prepaid deliveries#

Read delivery_interval, delivery_interval_count, and deliveries_per_period for the frozen cadence. A null cadence pair means one delivery per period. remaining_prepaid_deliveries counts paid deliveries whose delivery order Flint hasn't created yet, and freezes at cancellation for manual refunds. next_delivery_at is when the next delivery order is due, shifted by a timed pause, or null during an indefinite pause, when none is scheduled, or when the subscription is canceled. Merchant and buyer reads return these fields; they are read-only. See Prepaid deliveries for holds, skip, pause, ending dates, and the prepaid_deliveries_remaining refusals.

Start a subscription#

  • Hosted signup. A checkout session, payment link, headless checkout, or paid order with subscribed lines collects the buyer's card and first payment. The subscription starts trialing when the plan has a trial, and active otherwise. See Choose your signup surface.
  • POST /v1/subscriptions, when you already have the customer and an active saved card. billing_start.type picks how billing begins:
billing_start.typeStarting status
immediatetrialing when the plan has a trial. Otherwise incomplete while Flint collects the first payment.
scheduled, with a future starts_atscheduled until starts_at, with nothing charged before then. Can't be combined with a plan trial.
imported, with period_started_atactive, without a charge, for a buyer who already paid for the current period in another system

POST /v1/subscriptions requires customer_id, terms, billing_start, and an Idempotency-Key. terms.type is subscription_plan with a subscription_plan_id, or subscription_offer with billing_interval, billing_interval_count, and offer line_items. Omit payment_method_id to charge the customer's default payment method. A subscription with anything that ships also requires delivery. The customer must have an email, and a customer without one returns 409 with CUSTOMER_EMAIL_REQUIRED on param: customer_id.

cURL
curl -X POST https://api.withflintpay.com/v1/subscriptions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: sub-ada-pro-001" \
  -d '{
    "customer_id": "cus_1kmn0aExample",
    "payment_method_id": "pm_1kmn0aExample",
    "terms": {"type": "subscription_plan", "subscription_plan_id": "plan_1kmn0aExample"},
    "billing_start": {"type": "immediate"}
  }'

For plan terms, set signup quantities in terms.line_items using the plan's subscription_plan_line_item_id, for example "line_items": [{"subscription_plan_line_item_id": "spli_1kmn0aExample", "quantity": 7}]. IDs must be distinct and belong to that plan. Omitted lines keep their plan defaults. Your API key may set any line to 1 through 9,999; buyer bounds do not limit merchant input. The seat count is the quantity of the one line with allow_quantity_adjustment: true. Each recurring line costs its unit price times its quantity, plus modifiers. Scalar subscription quantity is no longer accepted.

Send the same terms.line_items in subscription when calling POST /v1/subscription-previews with mode: "create". The preview includes those quantities in the first charge and recurring charge before you create anything.

Set prorate_first_period: true with billing_anchor_day and billing_schedule.owner: flint to prorate an anchored first paid period. It defaults to false and is returned on every Subscription. It requires monthly or yearly billing, no shipping, and an immediate or scheduled start; a trial prorates from its end. Ineligible combinations return 400 INVALID_REQUEST, detail code NOT_ALLOWED, with param: prorate_first_period. Setup fees remain full. First-period proration defines the calendar, rounding, and preview behavior.

Before the first opted-in payment is paid, an interval, interval count, or anchor change returns 409 ACTION_NOT_ALLOWED, reason first_period_unpaid, with the message "Change this subscription's billing interval after its first prorated payment." Changes that keep those terms are permitted, including a plan change. Normal calendar changes resume after the first payment.

If the response is lost, find the subscription with GET /v1/subscriptions?idempotency_key=sub-ada-pro-001, even while it's still incomplete; Recovery reads explains an empty or pending result. Create the subscription covers every field, Choose when billing starts the three starts, and Create or import an offer subscription the offer branch.

Frozen line quantity policy#

Each line_items entry reports allow_quantity_adjustment, min_quantity, and max_quantity on merchant and buyer reads. The policy comes from the plan line when the terms are captured. Lines without a recorded policy report false, 1, and 9,999. A later plan edit does not change it.

Checkout subscription_terms.line_items and payment-link subscription_preview.line_items expose the plan line IDs and the same policy, so a headless integration can identify the adjustable line. scheduled_plan_change.line_items exposes the pending target's frozen lines and policy. Current and pending policies may differ.

Buyers may change only the adjustable line, within its frozen bounds. Checkout create and PATCH, and payment-link resolve, take subscription_terms.line_items with subscription_plan_line_item_id and quantity. Merchant checkout requests may set any line to 1 through 9,999. Omitted lines keep their quantities; duplicate IDs and IDs outside the plan are refused.

Status#

Subscription status, main pathsStartFinal
  • incomplete moves to active on first payment succeeds
  • trialing moves to active on first charge succeeds
  • trialing moves to past_due on first charge fails
  • scheduled moves to active on first period paid
  • active moves to past_due on charge fails
  • past_due moves to active on retry succeeds
  • active moves to paused on pause
  • paused moves to active on resume
  • past_due moves to canceled on retries run out
  • active moves to canceled on cancel
status on subscription
Final values do not change again
  • scheduled
    Created with a future starts_at. Nothing is charged before then. At starts_at, Flint collects the first period: the subscription becomes active once it's paid, or past_due if the payment fails. Don't provision yet.
  • incomplete
    The first period's payment is being collected, or is held for delivery or stock (see delivery_hold and inventory_wait). Don't provision yet.
  • trialing
    In a free trial with nothing charged, with or without a saved card. It stays trialing while the first charge after the trial is pending, and current_period_start_at and current_period_end_at describe the first paid period. If that charge is declined, it moves straight to past_due. Provision access.
  • active
    Current. A subscription becomes active only after its first charge succeeds. Provision access.
  • past_due
    A charge failed, including a first payment, and Flint is retrying or waiting for a new payment method. Keep or limit access, your call, and ask the customer for a working card. When retries run out, your dunning settings cancel it, pause it, or leave it past_due.
  • paused
    Billing is suspended. pause_reason says why. Suspend access if your product pauses with billing. A resume with an overdue period goes to past_due until that period is paid.
  • canceledFinal
    Ended, either immediately or at the end of its final period. Revoke access. A canceled subscription can't come back; create a new one if the customer returns.

Any status except canceled can move straight to canceled with cancel_immediately: true, and a first payment that fails moves a subscription to past_due. The diagram shows the main paths; the descriptions above cover the rest.

Note: Provision on subscription.activated

Flint sends subscription.activated once per subscription, the first time it's active with a paid period. A subscription created already paid or imported sends it right after subscription.created. A trial sends it after the first charge succeeds, or after the retry that succeeds when the first charge is declined, and never at signup, so provision a trial on subscription.created with status: "trialing". Webhook payloads can arrive late or out of order, so read the subscription before you grant or revoke access.

Ask for a new card on subscription.past_due and revoke access on subscription.canceled. Grant access from webhooks lists every subscription event, and Delivery webhooks the events for subscriptions that ship.

What happens next#

next_billing_at is present only while a renewal is scheduled: on a trialing or active subscription with a billing date that isn't set to cancel. Every other state reports its next step in another field:

StateRead
trialing or activenext_billing_at, when Flint starts the next renewal charge. Omitted once the subscription has reached its last billed cycle.
trialing or active on an external schedule with no dateis_awaiting_billing_schedule: true. Set the date with billing_schedule on PATCH.
Set to cancel (cancel_at_period_end: true)scheduled_cancel_at: trial_end_at while trialing, current_period_end_at while active, or next_retry_at while past_due, in place of that retry
past_duenext_retry_at for the next automatic retry, and missed_billing_at for the billing date that failed
incompletenext_retry_at
pausedscheduled_resume_at for a pause with a length, or null for one that waits for a resume
Any subscription with an end_afterexpires_at for when it ends, and remaining_cycles for the charges left. expires_at is null only when the end can't be determined, or the subscription is canceled, which also clears remaining_cycles. With no charge scheduled (paused with no resume time, or an external schedule with no date), that means a cycles end with cycles still left. A date end, a reached cycle limit, and a known scheduled cancellation keep their expires_at in those states. See End automatically.
scheduledstarts_at, present until the first payment succeeds

The next_billing_after and next_billing_before list filters match only subscriptions that have a next_billing_at, and sort_by=next_billing_at lists those without one last, in either direction.

billing_schedule_owner says who supplies the dates: flint computes them from the interval and billing_anchor_day, and external uses the dates your integration sets. completed_cycles counts the cycles charged so far, including any carried in with billing_start.imported.completed_cycles, and each renewal order's subscription_cycle is that count plus one. See How renewals work and Control the billing schedule.

When a payment fails#

While a subscription is past_due, it reports what's owed and why the last charge failed. Both fields clear when it leaves past_due, and a later failure reports its own.

Response
{
  "subscription_id": "sub_1kmn0aExample",
  "status": "past_due",
  "missed_billing_at": "2026-04-17T14:30:00Z",
  "next_retry_at": "2026-04-18T14:30:00Z",
  "outstanding_money": {"amount": 4872, "currency": "USD"},
  "recurring_subtotal_money": {"amount": 4500, "currency": "USD"},
  "last_payment_error": {
    "code": "insufficient_funds",
    "message": "The payment method has insufficient funds. Ask the customer to use a different payment method.",
    "failed_at": "2026-04-17T14:30:00Z",
    "remediation": {
      "retry": "none",
      "next_steps": "Update the subscription's payment method, then try again."
    }
  },
  "supported_actions": ["cancel", "change_plan"]
}
  • outstanding_money is the unpaid balance of the failed renewal order, including tax, shipping, and discounts, after payments and credits. It's what a retry collects. recurring_subtotal_money is only the items' price before discounts, shipping, and tax.
  • last_payment_error describes the latest decline. Buyer responses under /v1/me omit remediation and mask sensitive decline reasons.
  • To recover, point payment_method_id at a working card with PATCH, then charge now with POST /v1/subscriptions/{subscription_id}/payment-retries, or wait for the next automatic retry. Buyers can start up to 3 retries per billing period through /v1/me, counting the ones you start. While past_due, their retry_payment buyer action carries retry_payment.remaining_retries and max_retries, including when unavailable. A running retry adds active_subscription_payment_retry_id and reason in_progress; read that retry through GET /v1/me/subscriptions/{subscription_id}/payment-retries/{subscription_payment_retry_id} until it is succeeded or failed. Zero retries left reports limit_reached. Resume doesn't recover a past-due subscription.

If Flint refuses the first payment because the card payment rate limit was reached, the order payment attempt ends as failed with status_reason: rate_limit_exceeded. The subscription moves to past_due with no automatic retry. Before the dunning window ends, use the payment retry endpoint to start a new attempt. The new attempt still checks the card payment rate limit.

When a renewal payment fails covers the retry schedule, the end actions your dunning settings choose, and payment retry objects.

Pause, resume, and cancel#

Pause. Only an active subscription that isn't set to cancel can pause. pause_reason says why it's paused: merchant for your API key or dashboard, buyer for the buyer's own pause, payment_failed when retries ran out and your dunning settings pause, or delivery_action_required for a pause during or after a delivery hold.

Resume applies only to a paused subscription and finishes after the response. POST /v1/subscriptions/{subscription_id}/resume returns 202 Accepted with Retry-After: 2: the subscription is still paused, resume_requested_at is set, and Flint sends subscription.updated. Flint then makes it active, or past_due while an overdue period is collected, and sends subscription.resumed. If delivery can't be quoted for a delivery_action_required pause, it stays paused and Flint sends subscription.updated instead. resume_requested_at clears either way.

Cancel. POST /v1/subscriptions/{subscription_id}/cancel schedules the cancellation for scheduled_cancel_at, sets cancel_at_period_end: true, and sends subscription.cancellation_scheduled. A scheduled, incomplete, or paused subscription, or a past_due one with no next_retry_at, has no such time, so send cancel_immediately: true for it. Undo a scheduled cancellation with PATCH /v1/subscriptions/{subscription_id} and cancel_at_period_end: false; resume doesn't undo it. If its retained card was removed or became unusable, send a usable active off_session replacement in payment_method_id in the same request. Otherwise the update fails with 409 ACTION_NOT_ALLOWED and reason payment_method_required, and cancellation stays scheduled.

Merchant cancel accepts optional initiated_by: buyer | merchant | integration, defaulting to merchant, including when the body is omitted. Like skip-cycle's initiated_by, this is attribution only and does not apply the store's buyer limits. To enforce them, use a customer session on POST /v1/me/subscriptions/{subscription_id}/cancel or POST /v1/me/subscriptions/{subscription_id}/skip-cycle. These buyer routes always record buyer and do not accept initiated_by.

After cancellation, Flint closes the unpaid first-period order and cancels its unused payment intent. If that intent is still in requires_confirmation or requires_payment_method, a merchant can call POST /v1/payment-intents/{payment_intent_id}/cancel. If an order payment attempt still holds the intent, cancel the attempt when its supported_actions lists cancel.

cancellation_reason separates voluntary from involuntary churn on a canceled subscription, or one set to cancel:

  • buyer, merchant, or integration when that party asked, the same value as cancellation_details.requested_by.
  • payment_failed for a canceled subscription with no request, such as after retries ran out under a cancel policy.
  • other for a scheduled cancellation with no recorded requester.
  • end_after_reached for a subscription that ended on its end_after. Its cancellation_details is null.

It's absent otherwise, including after a scheduled cancellation is undone, and it can gain values. See Pause and resume and Cancel for pause lengths, cancellation reasons, and payments still processing at cancellation.

Actions and concurrency#

Merchant responses carry supported_actions, the actions the subscription's stored state allows. It's on reads, lists, write results, and the subscription in every subscription.* webhook, and it's [] when nothing is allowed. It depends only on stored state, so it changes only when version does, and a webhook payload and a read of the same version agree.

ActionListed when the subscription
cancelIsn't canceled
pauseIs active and not set to cancel
resumeIs paused
skip_cycleIs active, not set to cancel, and has a next_billing_at, on either schedule owner
renewIs active, not set to cancel, on a flint schedule, with no delivery_hold or prepaid deliveries owed, and another charge fits its end_after agreement
change_planIsn't canceled and has a subscription_plan_id; while prepaid deliveries are owed, is active, trialing, or paused and not set to cancel
change_quantityIsn't canceled and has no scheduled plan change; while prepaid deliveries are owed, is active, trialing, or paused and not set to cancel

Each action is a POST under /v1/subscriptions/{subscription_id}: /cancel, /pause, /resume, /skip-cycle, /renew (Order now), /change-plan, and /change-quantity. Show a control only when its action is listed, and ignore values you don't recognize: Flint can add actions. Quantity changes stay listed when at least one timing works: period_end accepts trials and pauses, including indefinite pauses, while next_renewal accepts non-canceled subscriptions without owed prepaid deliveries. A listed action can still be refused for a reason outside stored state, such as Order now while a renewal payment runs, a plan change with billing_starts: "now", which needs what Order now needs, or a prorated change, which needs a period paid by a Flint order. Undoing a scheduled cancellation isn't an action; it's the cancel_at_period_end: false update.

POST /v1/subscriptions/{subscription_id}/payment-retries creates a child resource, so it is excluded from supported_actions. Use the subscription's past_due status to offer a payment retry.

Buyer responses from /v1/me/subscriptions carry buyer_actions instead, and merchant responses omit it. buyer_actions also applies your store's buyer settings and gives a reason for each unavailable action. Build buyer controls from it; see Build cancel and pause controls.

Versions and conflicts#

version goes up on every change. Every subscription write except create, payment retries, and access links accepts an optional expected_version: in the body, or as a query parameter when you remove a line item. Send the version you read, and Flint applies the change only if nothing changed since. Three 409 errors mean nothing changed:

  • VERSION_CONFLICT means the subscription changed after you read it. details[0].current_version is its current version. Read it again and decide whether to resend.
  • CONCURRENT_MODIFICATION means another write landed while yours ran. Send the same request again with the same Idempotency-Key.
  • ACTION_NOT_ALLOWED means the subscription's state refuses the action, and the same request keeps failing until the state changes. details[0] names the subscription in resource_type and resource_id, with current_status when the reason depends on status, current_version when known, and for your own requests, its supported_actions. Branch on details[0].reason:
reasonMeaning and next step
terminal_statusThe subscription is canceled. Create a new one if the buyer still wants one.
cancellation_scheduledIt's set to cancel, which refuses pause, resume, Order now, a now plan change, and a buyer's payment retry. Undo the cancellation first.
period_end_unavailableA cancel without cancel_immediately found no time to cancel at. Send cancel_immediately: true.
not_pausedResume on a subscription that isn't paused. Read it again.
payment_requiredResume on a past_due subscription. Update the card and create a payment retry, or cancel.
field_lockedPause on a paused subscription with a different pause_duration_cycles. Resume it, then pause with the new length.
trial_in_progressOrder now, or a now or prorated change, while trialing or before the trial has ended. Wait for the trial to end, or use billing_starts: "next_renewal" for a plan change. For Order now and a now plan change, a trialing subscription set to cancel returns cancellation_scheduled instead. A prorated change still returns trial_in_progress.
quantity_not_carriedThe current seat count is outside the target bounds, or an adjusted line has no match. Send the target seat quantity for a bounds refusal, or every target line quantity for an unmatched line. param is line_items, and details[0].blocking_resources identifies subscription lines your key can read. Nothing changes.
external_billing_scheduleOrder now, or a now or prorated change, on an external schedule, or a buyer's skip. Act through the system that owns the schedule, or skip with your API key.
delivery_holdOrder now, a now plan change, or a payment retry during a delivery hold. Fix delivery; Flint charges the renewal when the hold clears.
inventory_waitA payment retry while the renewal waits on stock. Wait for stock, or change the items.
in_progressOrder now while a renewal payment runs, a now plan change while a collection payment waits on the buyer, or a prorated change while a refund on an order that paid the period hasn't settled. Wait, then read the subscription. A plan change while Flint runs a renewal payment is 409 OPERATION_IN_PROGRESS with a short Retry-After instead. A write while the subscription's test clock advances also returns it, with resource_type: "test_clock".
not_offeredA buyer action your store's settings don't offer. Offer only what buyer_actions lists as available.
unsupported_stateAny other status or schedule state that doesn't allow the action. Read the subscription and choose an action its status allows.

Plan changes and prorated quantity changes have a few more reasons, such as credit_exceeds_charge, minimum_charge, paid_period_required, and offer_subscription; see Change a subscriber's plan. Flint can add reasons, so fall back on current_status for one you don't recognize. When a subscription refuses an action lists the reasons each action returns.

Tax#

tax sets the tax of every order the subscription bills: renewals, setup fees, and plan changes. null means the subscription follows tax.default_enabled and tax.default_calculation in settings. Send {"enabled": true, "calculation": {"mode": "external", "components_source": "callback"}} on create or PATCH to ask your tax calculation callback, {"mode": "automatic"} for automatic tax, or {"enabled": false} to bill without tax. calculation is optional, and without it the orders take the settings default, where a provided default means automatic. tax is replaced as a whole, null in a PATCH clears it, and orders Flint already created keep their tax. A subscription created by a subscription plan checkout copies the session's tax. Merchant credentials see tax; buyer credentials don't, and can't change it.

Callback tax needs a selected callback: without one, setting it returns 409 ACTION_NOT_ALLOWED with reason configuration_required and resource_type tax_calculation_callback. A renewal the callback can't price is held without charging or dunning and tried again after an hour, backing off to once a day. Estimates on a subscription with callback tax return tax_money null. See Tax on subscriptions.

Change what renews#

A subscription copies its plan's lines and prices at signup, and editing the plan later doesn't change them. line_items is what each renewal bills. Each line quantity is the number of units; nothing multiplies it. recurring_subtotal_money is one period's items before discounts, shipping, and tax.

  • PATCH /v1/subscriptions/{subscription_id} changes metadata, external_reference_id, payment_method_id, delivery, tax, the cadence (billing_interval with billing_interval_count). Cadence must be among the plan's billing_interval_options. Change line quantities with change-quantity. The fields in one request apply together or not at all. Send billing_schedule alone in its own request.

  • Line items are added with POST /v1/subscriptions/{subscription_id}/line-items and changed or removed with PATCH or DELETE on /line-items/{subscription_line_item_id}. An added or swapped line takes the variant's current price.

  • POST /v1/subscriptions/{subscription_id}/change-plan moves to another plan, or to the current plan's lines and prices. billing_starts: "now" bills a new period today, less a credit for unused time; prorated_now charges the new plan for the rest of the current period, less the same credit, and keeps the period and billing date; next_renewal changes the plan without charging.

  • POST /v1/subscriptions/{subscription_id}/change-quantity changes line quantities. prorated_now charges the prorated difference now, keeping the period, next_billing_at, billing_anchor_day, and completed_cycles. It accepts billing_starts: "prorated_now", "next_renewal", or "period_end" and requires an Idempotency-Key, and requires a nonempty line_items array with up to 50 distinct existing subscription line IDs. Going from 5 seats to 10 at $10.00 a seat, halfway through a 30-day period that cost $50.00, charges $25.00 before tax: the new items for half the period ($50.00) less half of what the subscriber paid ($25.00). A second change in the same period is credited across both orders; Prorated charges works through two.

  • Order now (/renew) bills and ships the next renewal now, and /skip-cycle skips it.

On a trialing subscription with a Flint-owned schedule, setting billing_schedule.next_billing_at changes when the trial ends. trial_end_at and current_period_start_at move to that date, and current_period_end_at becomes the end of the first paid period. The billing anchor follows the new trial end unless you supply billing_schedule.billing_anchor_day. A pending period-end cancellation follows the new trial end too. An external-owned schedule keeps its existing trial end.

While trial conversion is in progress, a reschedule returns 409 OPERATION_IN_PROGRESS with retryable: true and leaves the schedule as it was. Retry after the conversion finishes.

change-quantity with next_renewal changes quantities immediately with no charge. period_end keeps the current quantities and stores a quantity-only scheduled_plan_change for the next billing boundary. Both allow physical lines and return null order and order_payment_attempt. Cancel the scheduled quantities with PATCH {"scheduled_plan_change": null}. All quantity-change timings refuse with plan_change_scheduled while a proposal is pending.

Buyers use POST /v1/me/subscriptions/{subscription_id}/change-quantity with line_items, billing_starts (period_end or eligible prorated_now), and optional expected_version. A full customer session and Idempotency-Key are required. Only the frozen adjustable line may change, within its min_quantity and max_quantity. The update_quantity buyer action points at this route. Physical buyer lines use period_end; view-only links cannot change quantities.

Changes to items, cadence, and delivery through PATCH and the line-item routes charge nothing and apply from the next unpaid renewal; one that's already paid ships as it was. Seats added this way are free until then, which is why a per-seat product bills them with change-quantity. A cadence change doesn't move next_billing_at. A payment method still in setup returns 409 ACTION_NOT_ALLOWED with reason status_not_reached and changes nothing; send the change again with a new Idempotency-Key once the card is active. See Update, Change cadence, quantity, and items, Order now, and Change a subscriber's plan.

Promotions. promotions lists the subscription's active recurring promotions, and is [] when none apply. A promotion leaves the list when the renewal that uses up its charged cycles is recorded, in the same change that advances completed_cycles and version: a once promotion on an ordinary signup is used by the signup order and never appears, while one on a free trial stays listed until the first renewal after the trial is recorded. A repeating one leaves when the renewal for its last discounted cycle is recorded. The list shows terms, not amounts; see Discounts and first-shipment offers.

Contract terms. A plan with contract_term_months gives the subscription contract_start_at, contract_end_at, and, when the terms carry a fee, early_termination_fee_money. They stay for the subscription's life, through pauses and plan changes. Flint shows the terms at checkout but doesn't stop an early cancellation and never charges the fee; see Collect an early termination fee.

Preview a charge or change#

POST /v1/subscription-previews estimates without saving anything. mode picks what it checks:

modeUse it to
createValidate a proposed subscription and get every problem in errors at once. Estimates first_charge, recurring, and, when a setup fee comes before a prorated first period, first_period_charge.
delivery_optionsList the delivery methods that serve a new address for a subscription, before you save it in delivery
next_renewalShow the next charge's lines, discounts, shipping, tax, and total in renewal. Buyers call POST /v1/me/subscription-previews.
plan_changePrice a plan change with the same checks as change-plan, including credit_adjustment_money for now and prorated_now
quantity_changeEstimate the immediate prorated charge, including any unused-time credit. Buyers use the same timing and line_items with POST /v1/me/subscription-previews. To estimate scheduled quantities instead, send line_items in a next_renewal preview.
promotion_applyEstimate attaching a promotion with the same checks as POST /v1/subscriptions/{subscription_id}/promotions: the proposed attachment in promotion, and the charge for its first_cycle in renewal. Refusals return HTTP errors. Saves nothing and counts no use.
delivery_method_updateCount the subscriptions on a delivery method, and how many a proposed change to it would leave ineligible

For next_renewal, optionally send delivery with the same type, delivery_method_id, destination, and optional recipient as the subscription PATCH. The estimate prices the renewal as if that delivery were saved. It saves nothing, reserves no stock, and guarantees no rate. Both the merchant and buyer preview routes accept it.

When using a preview before fixing delivery_hold, check the subscription's remaining_prepaid_deliveries, which both merchant and buyer responses include. A positive count means the held delivery is already paid: releasing it waives shipping and charges nothing today. next_renewal still estimates the next paid billing cycle. With a zero count, the preview estimates the unpaid held renewal that Flint charges when the saved delivery works.

JSON
{
  "mode": "next_renewal",
  "subscription_id": "sub_01ARZ3NDEKTSV4RRFFQ69G5FAV",
  "delivery": {
    "type": "shipment",
    "delivery_method_id": "dmet_01ARZ3NDEKTSV4RRFFQ69G5FAV",
    "destination": {
      "type": "customer_address",
      "customer_address_id": "caddr_01ARZ3NDEKTSV4RRFFQ69G5FAV"
    }
  }
}

Proposed delivery has the same refusals as PATCH: 409 ACTION_NOT_ALLOWED with reason method_unavailable, destination_not_served, or configuration_required, and delivery_method_id when known. Buyers also receive reason not_offered when delivery changes are disabled. A rate calculation failure returns 502 EXTERNAL_SERVICE_ERROR with reason rate_unavailable or rate_callback_failed. Malformed delivery returns 400 INVALID_REQUEST.

Tax and shipping are estimates, and stock isn't checked. See Show the next charge.

Billing holds#

When an issue delays billing, merchant responses include billing_hold with a reason and detected_at. The reason is configuration when the subscription's billing settings prevent collection, or retrying when Flint is retrying or confirming billing after a temporary issue. When scheduled, billing_hold.retry_at shows the next planned retry. Treat unrecognized reasons as other. The subscription keeps its lifecycle status and billing date. A billing hold does not start payment recovery or mean the buyer's card was declined.

Flint retries billing automatically. Configuration holds send a merchant attention notification; temporary retry holds do not. Repeated failures retain the first detection time and do not send another notice for the same hold. Successful billing, a replacement billing schedule, pause, cancellation, or a card decline that starts payment recovery clears the hold and resolves any notice. subscription.updated includes changes to the hold. Buyer responses omit billing_hold.

If automatic tax needs a buyer location, the merchant notice explains how to fix it. When Flint sends your subscription emails, the buyer also gets an email asking them to save a default billing address in their buyer account. You can save the address through the Customers API. Check any default shipping address first because subscription orders use it before the billing address. An immediate plan change that needs this configuration returns 409 ACTION_NOT_ALLOWED with reason configuration_required. Send the change with a new idempotency key after the address is saved.

GET /v1/subscriptions?needs_attention=true includes billing holds immediately, without waiting for the billing date to become 24 hours overdue.

Subscriptions that ship#

A subscription with physical lines, from a plan or from offers, carries delivery: the method, a copy of the destination address, the recipient, and the shipping for one shipment. Each renewal is quoted again and ships to that destination. Replace delivery as a whole with PATCH and the current version as expected_version. Flint clears delivery when the subscription is canceled; each renewal order keeps its own destination, and open_renewal_order_id names a paid renewal that hasn't shipped yet. See The delivery preference.

When a renewal can't be quoted for delivery, Flint holds it instead of charging, and the subscription doesn't enter dunning. Three fields report renewals that aren't shipping:

  • delivery_hold means the renewal is held now. reason is method_unavailable (another offered method serves the address), destination_not_served (no offered method does), or rate_unavailable (the method can't be priced). fixable_by is buyer for method_unavailable when your store lets buyers change delivery, and merchant otherwise. At ends_at, 14 days or one billing interval after the billing date, whichever is sooner, the subscription pauses with pause_reason: "delivery_action_required".
  • upcoming_delivery_hold means a check before the billing date failed, so the renewal at renewal_at will be held unless delivery is fixed first. It's never present with delivery_hold.
  • inventory_wait means a renewal or prepaid delivery is waiting for stock. Flint checks once a day. Merchant responses carry started_at, plus order_id and invoice_id if those records exist. A prepaid delivery creates no invoice and ships without another charge once stock is available. Buyer responses carry only started_at. On a renewal, the subscription stays active or becomes past_due according to your subscription_inventory_block_action.

GET /v1/subscriptions?needs_attention=true lists every subscription that needs you: past_due; active or incomplete with a billing date more than 24 hours overdue; with billing_hold or any of the three fields above; or paused with pause_reason: "delivery_action_required". needs_attention=false lists the rest. See When a renewal can't ship and Renewals that need attention.

Gift recipient#

gift_recipient names who a gift subscription is for: an email, and an optional name and message. customer_id stays the purchaser, who pays, gets receipts and reminders, and manages the subscription, and delivery.recipient stays the ship-to. Set it on create or import, or from a checkout whose plan has gifts_enabled. PATCH replaces the whole object and null clears it; send expected_version to guard against a concurrent change. Buyers can read it but not change it. Flint clears it when the subscription is canceled and when the purchaser's data is erased. See Gift subscriptions.

When you send your own subscription email, create a link with POST /v1/subscriptions/{subscription_id}/access-links. Its url opens the subscription in your Flint-hosted customer account without a sign-in, for 14 days or 5 opens, whichever comes first.

  • subscription_view, or no body, is read-only and needs commerce.subscriptions.read.
  • With subscription_manage, the buyer can also cancel, pause, or undo a scheduled cancellation, as your store's buyer settings and the subscription's state allow. It needs commerce.subscriptions.write, including for partner app tokens.

Neither purpose allows other changes, such as plans, quantities, or delivery, or opens another subscription. The url is a bearer credential: Flint returns it only in the response and in a retry with the same Idempotency-Key, and a different purpose or return_url needs a new key. A store whose customer_account.mode is merchant_hosted gets 409 ACTION_NOT_ALLOWED with reason merchant_hosted_customer_accounts. See Link the buyer to their order.

cURL
curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_1kmn0aExample/access-links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: subscription-link-sub_1kmn0aExample" \
  -d '{"purpose": "subscription_manage", "return_url": "https://shop.example/account"}'

Optionally send return_url for a destination on your site. It must be a nonempty absolute HTTPS URL without credentials, up to 2,048 characters. Test mode also accepts HTTP loopback URLs. Query strings and fragments are allowed, with no host allowlist. Invalid values return 400 INVALID_REQUEST, detail INVALID_VALUE, at return_url. The response includes return_url, or null when omitted; order and Return access links always return null. The destination belongs to the browser session the link starts, until sign-out or session end. A later sign-in by emailed code has no return URL.

Subscriptions on a test clock#

In a sandbox, a subscription whose customer was created on a test clock reports test_clock_id, copied from the customer and never changed. POST /v1/subscriptions doesn't take it; create the customer on the clock instead. The subscription bills at the clock's time, so advancing the clock runs its trials, renewals, notices, and retries. billing_start is checked against that time too: starts_at must be after it, and period_started_at before it. Merchant responses and webhooks include test_clock_id; buyer responses omit it. GET /v1/subscriptions?test_clock_id= lists one clock's subscriptions, and a live credential sending that filter gets 403 FORBIDDEN with reason test_mode_required.

  • While the clock is advancing, creating a subscription on it, and every write to its subscriptions from your API key or the buyer's account, returns 409 ACTION_NOT_ALLOWED with resource_type: "test_clock" and reason in_progress. Wait for test_clock.ready and send the same request with the same Idempotency-Key.
  • A failed or archived clock takes no new subscriptions (reason terminal_status or archived), but writes to existing ones, such as a cancel, still work.
  • A clock holds up to 10 subscriptions that aren't canceled. One more returns 409 LIMIT_REACHED with reason test_clock_subscriptions, param: "customer_id", and limit: 10. A subscription a checkout creates on the clock is never refused, but counts toward the limit.

What follows the clock lists what reads the clock's time, and Test subscriptions and renewals walks through a trial and a failed renewal.

List and expand#

GET /v1/subscriptions filters by status, customer, plan, offer, terms_type, schedule, billing window, delivery method, and hold reason; Retrieve and list shows which filter finds what. List and retrieve both take expand, which adds each related record beside its ID, or null when the subscription has no such ID. Each path needs commerce.subscriptions.read plus its own read scope, or the request fails with 403 INSUFFICIENT_SCOPE and param: "expand":

expandAlso needs
customercustomers.read
payment_methodpayments.payment_methods.read
subscription_plancommerce.subscription_plans.read
cURL
curl -G https://api.withflintpay.com/v1/subscriptions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  --data-urlencode "status=past_due" \
  --data-urlencode "expand=customer,payment_method"

Expand related records covers how Flint batches each page and reports failures.

The Subscription object#

A customer's recurring purchase.

Returned by GET /v1/subscriptions/{subscription_id} and carried by the endpoints below.

Attributes

billing_anchor_dayinteger

UTC day of the month used for monthly and yearly billing. Applies only to Flint-owned schedules.

billing_holdobject

Configuration issue or automatic retry delaying billing, with the first detection time. Flint retries automatically without starting payment recovery. Cleared when billing succeeds, the schedule is replaced, the subscription is paused or canceled, or a card decline starts payment recovery. Included only in merchant responses.

Not returned with a checkout credential or a customer session

billing_intervalenumRequired

How often the subscription bills now. Read with billing_interval_count: monthly with a count of 3 bills quarterly. A change applies from the next renewal that has not been paid; next_billing_at does not move.

  • daily
  • weekly
  • monthly
  • yearly
billing_interval_countintegerRequired

Number of billing_interval units between charges. Changes with billing_interval.

billing_interval_optionsarray of object

Billing interval and count pairs the subscription can switch to. For a subscription on a plan, they follow the plan's current billing_interval_options. A subscription that came from an offer keeps the pairs the offer had at signup. Prices of lines that ship are per delivery. Each option charges for all deliveries in its period. Changing the interval does not change the per-delivery price.

billing_schedule_ownerenumRequired

Who supplies billing dates: flint advances the schedule after each paid renewal; external uses dates you supply. Change it with billing_schedule on PATCH /v1/subscriptions/{subscription_id}.

  • flint
  • external
billing_schedule_waiting_started_atstring

RFC3339 timestamp.

Not returned with a checkout credential or a customer session

cancel_at_period_endbooleanRequired

True when the subscription is scheduled to cancel at scheduled_cancel_at. Schedule with POST /v1/subscriptions/{subscription_id}/cancel; undo with PATCH and cancel_at_period_end false.

canceled_atstring

RFC3339 timestamp.

cancellation_detailsobject

Who asked to cancel, when, and why. Present once a cancellation is requested, whether it takes effect at the end of the billing period or right away. Omitted when no one asked, and removed when a scheduled cancellation is undone. See cancellation_reason for voluntary and payment-related cancellations.

cancellation_reasonenum

Why the subscription is canceled or scheduled to cancel. Uses signup_order_refunded when an automatic inventory refund fully refunds the signup order, end_after_reached when the automatic ending agreement is reached, cancellation_details.requested_by when recorded, payment_failed for other canceled subscriptions without a requester, and other for a scheduled cancellation without a requester. Omitted otherwise.

  • buyer
  • merchant
  • integration
  • payment_failed
  • other
  • end_after_reached
  • signup_order_refunded
completed_cyclesintegerRequired

Billing cycles charged so far, including cycles imported with `billing_start.completed_cycles`. The next renewal order's `subscription_cycle` is this number plus one.

contract_end_atstring

When the recorded contract term ends. Does not move when the subscription pauses or changes plan. Flint does not stop the buyer from canceling earlier.

contract_start_atstring

When the recorded contract term started. Does not move when the subscription pauses or changes plan.

created_atstringRequired

RFC3339 timestamp.

current_period_end_atstring

RFC3339 timestamp.

current_period_start_atstring

RFC3339 timestamp.

customerobject or null

Present only when `expand` includes `customer`; `null` when expanded and there is no related customer.

Not returned with a checkout credential or a customer session

customer_idstringRequired

The customer this subscription bills.

deliveries_per_periodintegerRequired

Deliveries paid for by one billing period, from 1 to 24. One when no separate delivery cadence is set. Prices of lines that ship are per delivery.

deliveryobject

Saved delivery preference with the current delivery method display. Write responses use the same display as GET: fixed shipping reflects the current method configuration, and quoted shipping shows the last paid shipping amount when available.

delivery_holdobject

Current delivery issue that blocks collection. Mutually exclusive with upcoming_delivery_hold.

delivery_intervalenum or nullRequired

Delivery cadence frozen from the plan. Null when no separate delivery cadence is set; one delivery is made per billing period.

  • daily
  • weekly
  • monthly
  • yearly
  • null
delivery_interval_countinteger or nullRequired

Number of delivery intervals between deliveries. Null when no separate delivery cadence is set.

early_termination_fee_moneyobject

The fee in the recorded contract terms. Present whenever those terms include a fee. It applies only to a cancellation before contract_end_at. Flint never charges it. Later plan changes do not change this fee.

end_afterone of or nullRequired

Recorded automatic end condition. Null when no automatic end is set. Cycles count charged billing periods, including imported completed_cycles. Pauses and skips do not use cycles. Already-paid prepaid deliveries continue on their shifted dates, even beyond the end date, and cancellation waits for the last remaining delivery. Skipping defers a delivery without consuming its entitlement. Ending never refunds.

expires_atstring or nullRequired

Projected end under the current schedule and committed plan changes, including an earlier scheduled cancellation. A date limit preserves already-paid entitlement without requiring a future charge schedule. A reached cycle limit uses the last paid period end, or current_period_end_at when no paid history exists; that fallback includes any skip or pause extension. A cycle limit with cycles left needs a future charge schedule unless a known scheduled cancellation determines the end. Paid deliveries extend the end to the last paid delivery when it is later. An indefinite pause with paid deliveries owed makes the end unknown. Null when the end cannot be determined or the subscription is canceled.

external_reference_idstring

Caller-owned identifier for this resource in an external system.

Not returned with a checkout credential or a customer session

gift_recipientobject or nullRequired

Who receives the gift, when this is a gift subscription. customer_id stays the purchaser. Flint clears it when the subscription ends and when the purchaser's data is erased. Null when the subscription isn't a gift.

idempotency_keystring or nullRequired

The Idempotency-Key of the request that created this resource. `null` when that request sent no key, Flint created the resource, the reader isn't the caller that created it (another app install, a buyer, or the merchant reading an app's or buyer's record), or the caller that created an older record is unknown. Filter its list with `idempotency_key` to find it. Recorded payloads, including replayed responses and webhook events, can return `null`. To find a key that a replay returns as `null`, read the resource. Buyer sessions on routes shared with merchants get `null`. `/v1/me` responses do not include this field.

inventory_waitobject

Renewal or prepaid delivery waiting for stock. Buyers receive only started_at.

is_awaiting_billing_scheduleboolean

True while an active or trialing subscription on an external billing schedule has no next billing date.

last_payment_errorobject

Latest renewal payment failure, present only while status is past_due and the latest payment failed. Buyer responses omit merchant remediation and sensitive decline signals.

line_itemsarray of objectRequired

What each renewal bills. Plan edits do not change it. Adding, changing or swapping a line takes that variant's current catalog price, which then stays until the line changes again.

merchant_idstringRequired

ID of the merchant this resource belongs to.

metadatamap of string

Stored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.

Not returned with a checkout credential or a customer session

missed_billing_atstring

The billing date whose payment failed, as an RFC3339 timestamp. Present only while status is past_due.

next_billing_atstring

When Flint next starts a scheduled renewal charge, as an RFC3339 timestamp. Present only while a trialing or active subscription has a billing date and isn't set to cancel at the end of its period. Absent when no renewal is scheduled: a subscription in its final billing cycle ends at expires_at, a paused subscription resumes at scheduled_resume_at, a past_due one reports the failed billing date in missed_billing_at and retries at next_retry_at, an incomplete one retries at next_retry_at, a scheduled start begins at starts_at, one set to cancel ends at scheduled_cancel_at, and an external schedule awaiting a date reports is_awaiting_billing_schedule.

next_delivery_atstring or nullRequired

When the next prepaid delivery order is due, shifted by a timed pause. Null when the subscription has an indefinite pause, no delivery is scheduled, or the subscription is canceled.

next_retry_atstring or nullRequired

Recorded automatic payment retry time. Null when no retry time is available.

open_renewal_order_idstring

ID of the paid renewal order whose shipment has not been dispatched. It keeps its committed delivery destination after preference changes and cancellation. Absent when no such renewal order exists. Only renewal orders count; the signup order is not included.

outstanding_moneyobject

Unpaid balance of the failed renewal order, including tax, shipping and discounts, after payments and credits. Present only while status is past_due and a positive balance remains.

pause_reasonenum

Why the subscription is paused: merchant for a pause made with your API key or dashboard, buyer for the buyer's own pause, delivery_action_required for a pause during or after a delivery hold, and payment_failed when renewal payment retries ran out and your dunning settings pause the subscription. Omitted when the subscription is not paused.

  • buyer
  • delivery_action_required
  • merchant
  • payment_failed
paused_atstring

RFC3339 timestamp.

paused_delivery_holdobject or nullRequired

The delivery hold that expired and paused the subscription. Null when no stored expiry reason exists, including a manual pause during an active hold, or the subscription is no longer paused for delivery action.

payment_link_idstring

The payment link that started this subscription, when there was one.

Not returned with a checkout credential or a customer session

payment_methodobject or null

Present only when `expand` includes `payment_method`; `null` when expanded and there is no related payment method.

Not returned with a checkout credential or a customer session

payment_method_due_atstring or nullRequired

First charge boundary while no card is bound: the later of trial_end_at and next_billing_at during a trial, or the next billing date for an imported period, even when that cycle's charge is zero. Recomputed when the schedule changes. A trial still without a card at its boundary cancels without an order or payment attempt. At that boundary, an imported subscription with a positive charge that still has no card enters its normal dunning schedule without a payment attempt. For an imported subscription, a zero charge completes the renewal without a card and the deadline advances to the following boundary. Null when a card is bound, collection is not scheduled (paused, canceled, or set to cancel at period end), an active or trialing subscription is in its final end_after cycle, or an external schedule has no known boundary.

payment_method_idstring or nullRequired

Saved payment method used for renewal charges. Null when no card is bound. Bind a card to this subscription with PATCH; changing the customer's default alone does not bind it.

platform_fee_ruleobject

The active platform fee rule for the subscription.

Not returned with a checkout credential or a customer session

promotionsarray of objectRequired

Recurring promotions applying to the next charged cycle. Scheduled attachments are listed in scheduled_promotions. Empty when none apply; signup-only and exhausted promotions are excluded.

prorate_first_periodbooleanRequired

Whether this subscription was created to prorate its first anchored paid period. Set at creation and never changes; starting on the anchor day still bills a normal full period.

recurring_subtotal_moneyobject or nullRequired

What one billing period's items cost before discounts, shipping, and tax: each line's price with modifiers, times quantity. It changes when items, quantity, or the plan change; editing the plan doesn't change it. For the next charge, use a subscription preview in next_renewal mode. `null` when a cancellation succeeds but Flint couldn't load the billing snapshot afterward, so the cancel response returns it as null. Retrieve the subscription again to get it.

remaining_cyclesinteger or nullRequired

Charges left for a cycle limit, bounded by an earlier scheduled cancellation. Null when there is no cycle limit or the subscription is canceled.

remaining_prepaid_deliveriesintegerRequired

Paid deliveries whose delivery order Flint hasn't created yet. A paid period starts with deliveries_per_period minus one. When delivery_hold is present and this count is positive, fixing delivery releases an already-paid delivery with shipping waived and no new charge. A next_renewal preview still estimates the next paid billing cycle. Skips, holds, and pauses consume none. Frozen on cancellation for manual refunds.

resume_requested_atstring or nullRequired

When Flint accepted a pending resume request. Set only while paused with a resume Flint has not applied yet. Clears when Flint resumes the subscription or refuses the request. `null` when the subscription isn't paused or no resume request is pending.

scheduled_cancel_atstring or nullRequired

When the scheduled cancellation takes effect: trial_end_at while trialing, current_period_end_at while active, or next_retry_at while past_due. Paid deliveries extend it to the last paid delivery when it is later. Null when cancel_at_period_end is false or no cancellation time is available.

scheduled_plan_changeobject or nullRequired

Frozen target terms for the next charged renewal. Null when no plan change is scheduled. Cancel with scheduled_plan_change: null on PATCH; replace through change-plan.

scheduled_promotionsarray of objectRequired

Attached promotions whose first_cycle is after the next charged cycle, completed_cycles + 1. Always present; empty when no promotions are scheduled.

scheduled_resume_atstring or nullRequired

When a pause with a length (pause_duration_cycles) resumes on its own: that many delivery intervals after paused_at on a prepaid subscription, or billing intervals otherwise. Null when the subscription is not paused or the pause has no length, such as a pause until you resume it or the pause Flint starts when a delivery hold runs out.

service_locationobject

Omitted for a checkout session credential that doesn't act for the customer the buyer verified.

starts_atstring

When a scheduled start's first billing period begins. Present only until that first payment succeeds.

statusenumRequired

Where the subscription is in its lifecycle. Each value says what it means.

  • trialing
  • active
  • paused
  • past_due
  • canceled
  • incomplete
  • scheduled
subscription_idstringRequired

Stable identifier of the subscription.

subscription_planobject or null

Present only when `expand` includes `subscription_plan`; `null` when expanded and there is no related subscription plan.

subscription_plan_idstring

Subscription plan ID. Omitted when terms_type is subscription_offer.

supported_actionsarray of enum

Merchant actions allowed by the subscription's state. A route can still refuse a listed action for a transient reason, such as a renewal already in progress, with its own error. Always present with merchant credentials.

Not returned with a checkout credential or a customer session

  • cancel
  • pause
  • resume
  • skip_cycle
  • renew
  • change_plan
  • change_quantity
taxobject or null

The tax the subscription's renewal, setup fee and plan change orders use. `null` when they follow `tax.default_enabled` and `tax.default_calculation` from your settings. Returned only to merchant credentials; omitted for buyer credentials. Always present with merchant credentials.

Not returned with a checkout credential or a customer session

terms_typeenumRequired

Terms come from the subscription plan in subscription_plan_id, or from subscription offers identified on each offer line by subscription_offer_id.

  • subscription_plan
  • subscription_offer
test_clock_idstring

ID of the test clock the subscription's customer was created on. The subscription bills at the clock's time. Present only when the customer is on a test clock. Included only in merchant responses and omitted from buyer responses.

Not returned with a checkout credential or a customer session

trial_end_atstring

RFC3339 timestamp.

upcoming_delivery_holdobject

Delivery issue forecast for the next renewal at renewal_at. Mutually exclusive with delivery_hold.

updated_atstringRequired

RFC3339 timestamp.

versionintegerRequired

Goes up with every change to the subscription, including renewals and other changes Flint makes. Send it as `expected_version` to apply an update only if nothing changed.

JSON
{
  "billing_anchor_day": 15,
  "billing_interval": "monthly",
  "billing_interval_count": 1,
  "billing_schedule_owner": "flint",
  "cancel_at_period_end": false,
  "completed_cycles": 0,
  "created_at": "2026-03-17T14:30:00Z",
  "current_period_end_at": "2026-04-17T14:30:00Z",
  "current_period_start_at": "2026-03-17T14:30:00Z",
  "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
  "deliveries_per_period": 1,
  "delivery_interval": null,
  "delivery_interval_count": null,
  "end_after": null,
  "expires_at": null,
  "gift_recipient": null,
  "idempotency_key": null,
  "line_items": [
    {
      "allow_quantity_adjustment": false,
      "base_subtotal_money": {
        "amount": 4500,
        "currency": "USD"
      },
      "modifier_total_money": {
        "amount": 0,
        "currency": "USD"
      },
      "name": "Membership",
      "product_id": "prod_01KEZF7C00027JTCXQ7TQF86X8",
      "quantity": 1,
      "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
      "subscription_line_item_id": "sli_01KEZF7C00VQ081BX7W2T96R71",
      "subscription_plan_line_item_id": "spli_01KEZF7C00CEPTZ7FN2H9F4SF9",
      "subtotal_money": {
        "amount": 4500,
        "currency": "USD"
      },
      "type": "variant",
      "unit_price_money": {
        "amount": 4500,
        "currency": "USD"
      },
      "variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
    }
  ],
  "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
  "metadata": {
    "source": "api"
  },
  "next_billing_at": "2026-04-17T14:30:00Z",
  "next_delivery_at": null,
  "next_retry_at": null,
  "paused_delivery_hold": null,
  "payment_method_due_at": null,
  "payment_method_id": "pm_01KEZF7C00WX8CKEVFDMRMYMBM",
  "promotions": [],
  "prorate_first_period": false,
  "recurring_subtotal_money": {
    "amount": 4500,
    "currency": "USD"
  },
  "remaining_cycles": null,
  "remaining_prepaid_deliveries": 0,
  "resume_requested_at": null,
  "scheduled_cancel_at": null,
  "scheduled_plan_change": null,
  "scheduled_promotions": [],
  "scheduled_resume_at": null,
  "status": "active",
  "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
  "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
  "supported_actions": [
    "cancel",
    "pause",
    "skip_cycle",
    "renew",
    "change_plan",
    "change_quantity"
  ],
  "tax": null,
  "terms_type": "subscription_plan",
  "updated_at": "2026-03-17T14:30:00Z",
  "version": 0
}

The Subscription delivery migration object#

A move of subscribers from one delivery method to another.

Returned by GET /v1/subscription-delivery-migrations/{subscription_delivery_migration_id} and carried by the endpoints below.

Attributes

completed_atstring

RFC3339 timestamp.

created_atstringRequired

RFC3339 timestamp.

failed_countintegerRequired

Subscriptions that could not be moved. See `failure_reason_counts`, or list the failures for each subscription.

failure_reason_countsarray of objectRequired

Failed subscriptions grouped by reason. Empty when none failed.

from_delivery_method_idstringRequired

ID of the delivery method the subscriptions moved away from.

moved_countintegerRequired

Subscriptions now using the new method.

pending_countintegerRequired

Subscriptions not yet moved or failed, including ones Flint is retrying.

statusenumRequired

Progress of the delivery method migration across its subscriptions.

  • pending
  • processing
  • completed
subscription_delivery_migration_idstringRequired

Unique identifier for this subscription delivery migration, prefixed `sdmig_`.

subscription_plan_idstring

Plan the migration was limited to. Omitted when it covered every plan.

to_delivery_method_idstringRequired

ID of the delivery method the subscriptions move to.

total_countintegerRequired

Number of active, paused, and past due subscriptions on the original method when the migration started.

updated_atstringRequired

RFC3339 timestamp.

JSON
{
  "completed_at": "2026-08-03T00:00:00Z",
  "created_at": "2026-08-02T00:00:00Z",
  "failed_count": 1,
  "failure_reason_counts": [
    {
      "count": 1,
      "reason": "destination_not_served"
    }
  ],
  "from_delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
  "moved_count": 1,
  "pending_count": 0,
  "status": "completed",
  "subscription_delivery_migration_id": "sdmig_01KEZF7C009D4380TJ2E6XZFSX",
  "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
  "to_delivery_method_id": "dmet_01KEZF7C00F34Q6CJF6MF7HWGT",
  "total_count": 2,
  "updated_at": "2026-08-03T00:00:00Z"
}

List subscription delivery migrations#

GET/v1/subscription-delivery-migrations

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Each subscription is previewed before its delivery method changes. Progress and per-subscription failures remain available after completion. Default order: created_at descending, then subscription_delivery_migration_id descending.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

from_delivery_method_idstring

Filter by the delivery method subscriptions are moving from.

statusarray of enum

Filter by migration status: pending, processing, or completed. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • pending
  • processing
  • completed

Response · 200

Delivery migration result.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/subscription-delivery-migrations \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Delivery migration result.

JSON
{
  "data": [
    {
      "completed_at": "2026-08-03T00:00:00Z",
      "created_at": "2026-08-02T00:00:00Z",
      "failed_count": 1,
      "failure_reason_counts": [
        {
          "count": 1,
          "reason": "destination_not_served"
        }
      ],
      "from_delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
      "moved_count": 1,
      "pending_count": 0,
      "status": "completed",
      "subscription_delivery_migration_id": "sdmig_01KEZF7C009D4380TJ2E6XZFSX",
      "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
      "to_delivery_method_id": "dmet_01KEZF7C00F34Q6CJF6MF7HWGT",
      "total_count": 2,
      "updated_at": "2026-08-03T00:00:00Z"
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Move subscribers to another delivery method#

POST/v1/subscription-delivery-migrationsIdempotent

Requires scope commerce.subscriptions.write

Rate limit: write

Each subscription is previewed before its delivery method changes. Progress and per-subscription failures remain available after completion.

Request body

from_delivery_method_idstringRequired

ID of the delivery method whose subscriptions to move. One migration can run for a method at a time.

subscription_plan_idstring

Limit the migration to this plan's live subscriptions.

to_delivery_method_idstringRequired

ID of the active delivery method to move them to. A subscription the new method can't serve is reported as a failure and keeps its current method.

Response · 202

Delivery migration result.

  • Retry-After: Whole seconds to wait before retrying or polling again, at least 1.
dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/subscription-delivery-migrations \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "from_delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
    "to_delivery_method_id": "dmet_01KEZF7C00F34Q6CJF6MF7HWGT"
  }'

Get subscription delivery migration#

GET/v1/subscription-delivery-migrations/{subscription_delivery_migration_id}

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Each subscription is previewed before its delivery method changes. Progress and per-subscription failures remain available after completion.

Path parameters

subscription_delivery_migration_idstringRequired

Subscription delivery migration ID. Must be a valid ID with prefix sdmig_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

Delivery migration result.

  • Retry-After: Whole seconds to wait before retrying or polling again, at least 1.

Same response as Move subscribers to another delivery method.

curl https://api.withflintpay.com/v1/subscription-delivery-migrations/sdmig_01KEZF7C00H8KGVKXANJWJVDH7 \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Delivery migration result.

JSON
{
  "data": {
    "completed_at": "2026-08-03T00:00:00Z",
    "created_at": "2026-08-02T00:00:00Z",
    "failed_count": 1,
    "failure_reason_counts": [
      {
        "count": 1,
        "reason": "destination_not_served"
      }
    ],
    "from_delivery_method_id": "dmet_01K1P6G4M7H2N8Q9R3S5T6V7WX",
    "moved_count": 1,
    "pending_count": 0,
    "status": "completed",
    "subscription_delivery_migration_id": "sdmig_01KEZF7C009D4380TJ2E6XZFSX",
    "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
    "to_delivery_method_id": "dmet_01KEZF7C00F34Q6CJF6MF7HWGT",
    "total_count": 2,
    "updated_at": "2026-08-03T00:00:00Z"
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

List subscriptions that could not be moved#

GET/v1/subscription-delivery-migrations/{subscription_delivery_migration_id}/failures

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Each subscription is previewed before its delivery method changes. Progress and per-subscription failures remain available after completion. Default order: subscription_id ascending; this key uniquely orders the results.

Path parameters

subscription_delivery_migration_idstringRequired

Subscription delivery migration ID. Must be a valid ID with prefix sdmig_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

reasonarray of enum

Filter by the reason a subscription could not be moved. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • method_not_offered
  • destination_not_served
  • rate_unavailable
  • method_unavailable
  • no_longer_applicable
  • not_movable

Response · 200

Delivery migration result.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/subscription-delivery-migrations/sdmig_01KEZF7C00H8KGVKXANJWJVDH7/failures \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Delivery migration result.

JSON
{
  "data": [
    {
      "message": "The new delivery method does not serve this subscription's destination.",
      "reason": "destination_not_served",
      "subscription_id": "sub_7WEHCDFNGQMXC4DPBTZGB6ZTXT"
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Preview subscription#

POST/v1/subscription-previews

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Estimates the next renewal, a plan change, or a promotion attachment, or evaluates a proposed subscription, delivery destination, or delivery method update without saving changes. next_renewal returns current recurring promotions, shipping, and tax for the next charged cycle. plan_change uses the same checks and pricing as change-plan, including unused paid item credit for billing_starts now or prorated_now. quantity_change accepts the change-quantity inputs and previews the same prorated charge without changing the subscription. promotion_apply uses the same checks as applying a promotion and returns the proposed attachment and the renewal estimate for its first_cycle; its refusals return HTTP errors. Tax is null when tax can't be calculated yet; a tax service failure returns 502 EXTERNAL_SERVICE_ERROR. Malformed JSON, unknown fields and request-level problems (a missing or unsupported mode, fields that belong to another mode) return 400. Create mode returns SubscriptionCreatePreview with first_charge, first_period_charge, and recurring estimates, all null when validation prevents pricing. first_charge is the first Flint collection, including any separate setup fee; recurring is the first normal full-period collection without setup fees. With prorate_first_period, the prorated first period is first_charge, or first_period_charge when a setup fee is collected first, and recurring is cycle 2 at the end of that period. is_valid means valid and priceable inputs, not payment readiness. Card validation matches creation, including cardless imports. In create mode, every problem with the proposed subscription is returned in errors with is_valid false, including CUSTOMER_EMAIL_REQUIRED when the customer has no email and promotion refusals under subscription.promotions. A create preview attaches no promotions and counts no uses. In delivery_options, shipping_countries lists countries potentially served by the subscription shipping and local delivery methods; omit destination on the buyer preview to read coverage before entering an address. Other address, cart, customer and rate checks still apply. A preview does not reserve inventory or guarantee a future shipping rate.

Request body

Send exactly one of these

The `delivery_options` variant of `CreateSubscriptionPreviewRequest`.

destinationone ofRequired

Address to evaluate each method against: one of the customer's saved addresses or a new address.

modeenumRequired

Selects the delivery options preview.

  • delivery_options
subscription_idstringRequired

ID of the subscription to list delivery methods for.

Response · 200

Subscription result.

dataone ofRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/subscription-previews \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "mode": "create",
    "subscription": {
      "billing_start": {
        "completed_cycles": 10,
        "period_started_at": "2026-10-01T00:00:00Z",
        "type": "imported"
      },
      "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
      "terms": {
        "billing_interval": "monthly",
        "billing_interval_count": 1,
        "line_items": [
          {
            "quantity": 2,
            "subscription_offer_id": "soffer_01KEZF7C00FTQ2R9QRKEJZM6WJ",
            "variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
          }
        ],
        "type": "subscription_offer"
      }
    }
  }'

List subscriptions#

GET/v1/subscriptions

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Returns a paginated list of subscriptions for the authenticated merchant. Subscriptions without a next_billing_at never match next_billing_after or next_billing_before, and sort last with sort_by=next_billing_at in either direction. Default order: created_at descending, then subscription_id descending.

Query parameters

idempotency_keystring

Filter by the original Idempotency-Key, after trimming surrounding whitespace. Matching is exact and case-sensitive. Returns only resources created in your caller namespace, plus resources created before caller scoping under the original key. Returns current authorized resources, not the recorded response. A pending resource does not prove that the operation succeeded, and an empty list does not prove that it had no effect. A match can show `idempotency_key: null` when that request sent no key, Flint created the resource, the reader isn't the caller that created it (another app install, a buyer, or the merchant reading an app's or buyer's record), or the caller that created an older record is unknown.

terms_typearray of enum

Filter by where the subscription terms come from: a subscription plan or subscription offers. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • subscription_plan
  • subscription_offer
page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

statusarray of enum

Filter by subscription status. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • trialing
  • active
  • paused
  • past_due
  • canceled
  • incomplete
  • scheduled
billing_schedule_ownerarray of enum

Filter by the system that supplies billing dates. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • flint
  • external
is_awaiting_billing_scheduleboolean

Filter external schedules by whether they need another billing date.

cancel_at_period_endboolean

When true, returns subscriptions scheduled to cancel at the end of the current period that are not yet canceled. When false, returns every other subscription.

customer_idstring

Filter by Flint customer ID.

delivery_method_idstring

Filter by the subscription's selected delivery method.

hold_reasonarray of enum

Filter by the reason of the current delivery_hold. Does not match upcoming delivery issues. Values are trimmed and deduplicated in first-seen order; empty or unknown entries are rejected. Values within this filter are ORed; separate filters are ANDed.

  • method_unavailable
  • destination_not_served
  • rate_unavailable
subscription_offer_idstring

Filter by Flint subscription offer ID.

subscription_plan_idstring

Filter by Flint subscription plan ID.

external_reference_idstring

Exact-match filter on the caller-owned external reference ID.

test_clock_idstring

Sandbox only. Exact-match filter on `test_clock_id`. A live credential gets `403 FORBIDDEN` with reason `test_mode_required`.

querystring

Search across subscription ID, external reference ID, customer, and plan. Text fields match any part of the value, and %, _ and \ are ordinary characters, not wildcards. IDs match from the start and need the type prefix, such as sub_01.

sort_byenum

Field to sort by. Defaults to created_at; ties are broken by subscription_id.

  • created_at
  • updated_at
  • next_billing_at
sort_directionenum

Sort direction. Defaults to desc.

  • asc
  • desc
created_afterstring

Inclusive lower bound on created_at.

created_beforestring

Exclusive upper bound on created_at.

updated_afterstring

Inclusive lower bound on updated_at.

updated_beforestring

Exclusive upper bound on updated_at.

next_billing_afterstring

Inclusive lower bound on next_billing_at.

next_billing_beforestring

Exclusive upper bound on next_billing_at.

needs_attentionboolean

True matches subscriptions with a delivery hold, an upcoming delivery hold, an inventory wait, a billing configuration hold, or a delivery-action-required pause, plus past_due subscriptions and active or incomplete subscriptions whose billing date passed more than 24 hours ago without payment. False is the exact complement. Other filters still apply.

expandarray of enum

Include related objects in the response. Supported expansions: customer, payment_method, subscription_plan. Include the requested related resources using scoped batch reads for this page. Each relationship requires its existing target read scopes. Expansion changes the representation without changing pagination tokens. Limits: at most 10 unique expand paths per request.

  • customer
  • payment_method
  • subscription_plan

Response · 200

A page of subscriptions.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/subscriptions \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

A page of subscriptions.

JSON
{
  "data": [
    {
      "billing_anchor_day": 15,
      "billing_interval": "monthly",
      "billing_interval_count": 1,
      "billing_schedule_owner": "flint",
      "cancel_at_period_end": false,
      "completed_cycles": 0,
      "created_at": "2026-03-17T14:30:00Z",
      "current_period_end_at": "2026-04-17T14:30:00Z",
      "current_period_start_at": "2026-03-17T14:30:00Z",
      "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
      "deliveries_per_period": 1,
      "delivery_interval": null,
      "delivery_interval_count": null,
      "end_after": null,
      "expires_at": null,
      "gift_recipient": null,
      "idempotency_key": null,
      "line_items": [
        {
          "allow_quantity_adjustment": false,
          "base_subtotal_money": {
            "amount": 4500,
            "currency": "USD"
          },
          "modifier_total_money": {
            "amount": 0,
            "currency": "USD"
          },
          "name": "Membership",
          "product_id": "prod_01KEZF7C00027JTCXQ7TQF86X8",
          "quantity": 1,
          "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
          "subscription_line_item_id": "sli_01KEZF7C00VQ081BX7W2T96R71",
          "subscription_plan_line_item_id": "spli_01KEZF7C00CEPTZ7FN2H9F4SF9",
          "subtotal_money": {
            "amount": 4500,
            "currency": "USD"
          },
          "type": "variant",
          "unit_price_money": {
            "amount": 4500,
            "currency": "USD"
          },
          "variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
        }
      ],
      "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
      "metadata": {
        "source": "api"
      },
      "next_billing_at": "2026-04-17T14:30:00Z",
      "next_delivery_at": null,
      "next_retry_at": null,
      "paused_delivery_hold": null,
      "payment_method_due_at": null,
      "payment_method_id": "pm_01KEZF7C00WX8CKEVFDMRMYMBM",
      "promotions": [],
      "prorate_first_period": false,
      "recurring_subtotal_money": {
        "amount": 4500,
        "currency": "USD"
      },
      "remaining_cycles": null,
      "remaining_prepaid_deliveries": 0,
      "resume_requested_at": null,
      "scheduled_cancel_at": null,
      "scheduled_plan_change": null,
      "scheduled_promotions": [],
      "scheduled_resume_at": null,
      "status": "active",
      "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
      "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
      "supported_actions": [
        "cancel",
        "pause",
        "skip_cycle",
        "renew",
        "change_plan",
        "change_quantity"
      ],
      "tax": null,
      "terms_type": "subscription_plan",
      "updated_at": "2026-03-17T14:30:00Z",
      "version": 0
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM60AJWQJM53CQ52J38WDED"
}

Create subscription#

POST/v1/subscriptionsKey required

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Creates a subscription for a customer outside checkout. For `billing_start.type: imported`, an `external_reference_id` already used by a subscription that has not ended in this merchant environment returns `409 ALREADY_EXISTS`, even with a new idempotency key. `details[0].current_resource` identifies the existing subscription; retrieve it and continue with its ID. A scheduled cancellation still blocks reimport until the subscription ends. Send `customer_id`, the `terms` (a subscription plan or subscription offers), and `billing_start`, which says whether billing begins now, on a later date, or continues a period the buyer already paid elsewhere. Renewals charge `payment_method_id`, or the customer's default payment method when you omit it. Free trials without an upfront charge and `imported` starts can begin without a card when the customer has no default payment method; other starts fail with `INVALID_REQUEST` naming `payment_method_id`. A setup fee or other creation-time charge requires a card; scheduled starts also require one. Bind a card before `payment_method_due_at`: a trial without one cancels at that boundary without an attempted charge, while an imported subscription follows its normal dunning schedule. Flint requests the card three days before the boundary, or when a shorter trial begins. A default payment method that can't be used fails the request on every start. The payment method must belong to the customer, be active, and allow charges without the buyer present. A plan that is not active fails with `ACTION_NOT_ALLOWED`. Subscriptions require a customer with an email address in both customer account modes; otherwise creation returns 409 CUSTOMER_EMAIL_REQUIRED. Optional promotions (up to five) freeze current terms and qualify against the projected order for first_cycle. Imports alone accept consumed_cycles to carry over the buyer's used allowance. Attaching counts one promotion use and, when sent by code, one code use.

Request body

billing_anchor_dayinteger

UTC day of the month used for monthly and yearly billing. Applies only to Flint-owned schedules.

billing_scheduleone of

Who sets billing dates: `flint` computes each next billing date; `external` waits for you to set `next_billing_at`. Omit it to use your subscription settings' `default_billing_schedule_owner`.

billing_startone ofRequired

When billing begins. `immediate` starts now; `scheduled` starts at `starts_at` and charges nothing before then; `imported` continues a period the buyer already paid elsewhere, from `period_started_at`, without charging. Each type takes only its own fields.

customer_idstringRequired

The customer to bill. The payment method must belong to this customer.

deliveryobject

Delivery preference for the subscription's physical items: the delivery method, destination and recipient. Subscription offers with physical lines require it. Omit it for a subscription with nothing to deliver.

end_afterone of or null

Automatic end condition. Omit it to inherit the plan default; send null for no automatic end. Imported subscriptions accept the same condition.

external_reference_idstring

Caller-owned identifier for this resource in an external system.

gift_recipientobject or null

Who receives the gift. customer_id stays the purchaser. Omit it or send null for a subscription that isn't a gift. Imported subscriptions accept it too.

metadatamap of string

Caller-owned metadata. Values can't be empty strings. Keys starting with flint_ are reserved for Flint, are not returned, and cannot be written through the public API.

payment_method_idstring

Saved payment method for renewals. Omit it to use the customer's default. A free trial without an upfront charge or an imported paid period may start without either; other starts require a card. An explicit method must belong to the customer, be active, and allow charges without the buyer present.

platform_fee_ruleobject

The platform fee rule for the subscription. Only a partner app install token can set or remove a platform fee rule.

promotionsarray of object

Promotions to attach with their current terms frozen. Duplicate promotions are invalid. An offer's own promotion attaches automatically; listing it again returns already_applied.

prorate_first_periodboolean

Prorate the first paid period to the next billing anchor. Requires `billing_anchor_day`, a monthly or yearly interval, `billing_schedule.owner: flint`, and no shipping. Imported billing starts are not allowed. Trials and scheduled starts prorate from their first paid start; setup fees remain full.

service_locationone of

Where the service is performed, for a subscription to a service at a place. Send a saved customer address or an inline address; Flint copies it.

taxobject

The tax the subscription's renewal, setup fee and plan change orders use. Omit it to follow `tax.default_enabled` and `tax.default_calculation` from your settings.

termsone ofRequired

What the subscription bills for, from a subscription plan or from subscription offers, selected by `type`.

Response · 201

The created subscription.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/subscriptions \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "billing_anchor_day": 15,
    "billing_schedule": {
      "owner": "flint"
    },
    "billing_start": {
      "type": "immediate"
    },
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "metadata": {
      "source": "api"
    },
    "payment_method_id": "pm_01KEZF7C00WX8CKEVFDMRMYMBM",
    "terms": {
      "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
      "type": "subscription_plan"
    }
  }'

Get subscription#

GET/v1/subscriptions/{subscription_id}

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Returns a single subscription by ID. A paid checkout session's credential can retrieve only the subscription created by its source order. Checkout credentials cannot expand related resources.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

expandarray of enum

Include related objects in the response. Supported expansions: customer, payment_method, subscription_plan. Expansion requires commerce.subscriptions.read plus the read scope for each expanded resource. Limits: at most 10 unique expand paths per request. Checkout session credentials cannot use expand on this route.

  • customer
  • payment_method
  • subscription_plan

Response · 200

The requested subscription.

Same response as Create subscription.

curl https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The requested subscription.

JSON
{
  "data": {
    "billing_anchor_day": 15,
    "billing_interval": "monthly",
    "billing_interval_count": 1,
    "billing_schedule_owner": "flint",
    "cancel_at_period_end": false,
    "completed_cycles": 0,
    "created_at": "2026-03-17T14:30:00Z",
    "current_period_end_at": "2026-04-17T14:30:00Z",
    "current_period_start_at": "2026-03-17T14:30:00Z",
    "customer_id": "cus_01KEZF7C003ACYXT6Q5EQZ78EE",
    "deliveries_per_period": 1,
    "delivery_interval": null,
    "delivery_interval_count": null,
    "end_after": null,
    "expires_at": null,
    "gift_recipient": null,
    "idempotency_key": null,
    "line_items": [
      {
        "allow_quantity_adjustment": false,
        "base_subtotal_money": {
          "amount": 4500,
          "currency": "USD"
        },
        "modifier_total_money": {
          "amount": 0,
          "currency": "USD"
        },
        "name": "Membership",
        "product_id": "prod_01KEZF7C00027JTCXQ7TQF86X8",
        "quantity": 1,
        "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
        "subscription_line_item_id": "sli_01KEZF7C00VQ081BX7W2T96R71",
        "subscription_plan_line_item_id": "spli_01KEZF7C00CEPTZ7FN2H9F4SF9",
        "subtotal_money": {
          "amount": 4500,
          "currency": "USD"
        },
        "type": "variant",
        "unit_price_money": {
          "amount": 4500,
          "currency": "USD"
        },
        "variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
      }
    ],
    "merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
    "metadata": {
      "source": "api"
    },
    "next_billing_at": "2026-04-17T14:30:00Z",
    "next_delivery_at": null,
    "next_retry_at": null,
    "paused_delivery_hold": null,
    "payment_method_due_at": null,
    "payment_method_id": "pm_01KEZF7C00WX8CKEVFDMRMYMBM",
    "promotions": [],
    "prorate_first_period": false,
    "recurring_subtotal_money": {
      "amount": 4500,
      "currency": "USD"
    },
    "remaining_cycles": null,
    "remaining_prepaid_deliveries": 0,
    "resume_requested_at": null,
    "scheduled_cancel_at": null,
    "scheduled_plan_change": null,
    "scheduled_promotions": [],
    "scheduled_resume_at": null,
    "status": "active",
    "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
    "subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
    "supported_actions": [
      "cancel",
      "pause",
      "skip_cycle",
      "renew",
      "change_plan",
      "change_quantity"
    ],
    "tax": null,
    "terms_type": "subscription_plan",
    "updated_at": "2026-03-17T14:30:00Z",
    "version": 0
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM60AJWQJM53CQ52J38WDED"
}

Update subscription#

PATCH/v1/subscriptions/{subscription_id}Idempotent

Requires scope commerce.subscriptions.write

Rate limit: write

Updates metadata, external_reference_id, payment_method_id, delivery, billing interval, cancel_at_period_end: false to undo a scheduled cancellation, or scheduled_plan_change: null to keep the current plan. If a retained card is unusable, undoing cancellation requires a usable replacement in payment_method_id; otherwise ACTION_NOT_ALLOWED has reason payment_method_required. Send billing_interval and billing_interval_count together. A billing_schedule update must be the only mutable field. Delivery and cadence changes apply to future unpaid renewals. Send expected_version to reject concurrent changes. Schedule a cancellation with POST /v1/subscriptions/{subscription_id}/cancel, change the plan with /change-plan, and manage lines through the line-items collection. A card whose setup hasn't finished fails with `ACTION_NOT_ALLOWED` and reason `status_not_reached`. Once setup finishes, send a new request with a new idempotency key.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

The current subscription version. Required when end_after or platform_fee_rule is present.

Response · 200

The updated subscription.

Same response as Create subscription.

curl -X PATCH https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "billing_schedule": {
      "next_billing_at": "2026-05-17T14:30:00Z",
      "owner": "external"
    }
  }'

Cancel subscription#

POST/v1/subscriptions/{subscription_id}/cancelIdempotent

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Cancels a subscription and records who asked, why, and when in cancellation_details. With cancel_immediately: true it ends now. Otherwise, trialing ends at trial_end_at, active at current_period_end_at (or now when a renewal delivery hold has expired), and past_due at next_retry_at instead of that retry. Scheduled, incomplete, paused, and past_due without next_retry_at require cancel_immediately: true or fail with `ACTION_NOT_ALLOWED` and reason `period_end_unavailable`. Paid deliveries extend a scheduled cancellation to the last paid delivery when it is later. A merchant can cancel immediately without an automatic refund. A buyer cannot cancel immediately while prepaid deliveries remain and period-end cancellation is available; the refusal reason is `prepaid_deliveries_remaining`. Read scheduled_cancel_at for the scheduled end time. A buyer's cancellation follows the store's customer_account.buyer_capabilities. Send expected_version to reject a concurrent change.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

cancel_immediatelyboolean

When true, ends the subscription now. Otherwise, schedules cancellation at trial_end_at while trialing, current_period_end_at while active, or next_retry_at while past_due, instead of that charge. An active subscription with an expired renewal delivery hold ends now. A scheduled, incomplete, or paused subscription, or a past_due subscription without next_retry_at, requires cancel_immediately: true; otherwise returns 409 ACTION_NOT_ALLOWED with reason period_end_unavailable. A buyer may cancel immediately when the store allows buyer_chooses or no scheduled cancellation time is available. Under end_of_period, a trial continues until trial_end_at.

cancellation_commentstring

Free text about the cancellation, up to 500 characters after surrounding spaces are trimmed. Recorded in cancellation_details.comment, which only merchant credentials read.

cancellation_reason_codeenum

Optional. Why the subscription is being canceled. When the store lists customer_account.buyer_capabilities.cancellation_reasons, a reason a buyer sends must be one of them; merchant credentials may send any code. Recorded in cancellation_details.reason_code.

  • too_expensive
  • missing_features
  • switched_service
  • unused
  • customer_service
  • too_complex
  • low_quality
  • other
expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

initiated_byenum

Who asked to cancel: buyer, merchant, or integration. Defaults to merchant. Attribution only; this does not apply the store's buyer limits. To enforce them, use a customer session on POST /v1/me/subscriptions/{subscription_id}/cancel. Recorded in cancellation_details.requested_by and cancellation_reason.

  • buyer
  • merchant
  • integration

Response · 200

The canceled subscription state.

Same response as Create subscription.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/cancel \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "cancel_immediately": false,
    "cancellation_reason_code": "too_expensive"
  }'

Change subscription plan#

POST/v1/subscriptions/{subscription_id}/change-planKey required

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Replaces the subscription's lines and recurring options with the active target plan's current terms. Paired lines keep their quantities unless line_items overrides them. Pair by the same line on the same plan. When switching between plans with adjustable lines, pair those lines and use the target quantities for fixed lines. Send a quantity for the target adjustable line if the carried quantity is outside its bounds. Other changes pair by variant or bundle, then the only line on each side. Unpaired target lines use their plan quantity. If an adjusted current line cannot be paired, send quantities for every target line; otherwise the request fails with quantity_not_carried before any change. With billing_starts next_renewal, changes terms now without charging and keeps the current period and next billing date. With billing_starts prorated_now, charges the new terms for the rest of the current period, less unused paid item credit, while keeping the billing period and anchor; the resulting interval must stay unchanged. With billing_starts now, charges a new period and credits unused paid item time after promotions; the plan changes only when payment succeeds. If the credit exceeds the new item charge, choose next_renewal. Omit the interval pair to keep the current interval when the target plan offers it, otherwise use the target default. Contract terms and existing recurring promotions are preserved. Requires Idempotency-Key; retry with the same key to recover the same result. Returns status 200 for a decline, with a closed unpaid order, failed order_payment_attempt, and unchanged subscription. Inspect order_payment_attempt.last_payment_error and update the subscription payment method before trying again. Send expected_version to reject a concurrent change. A competing paid change returns 409. The same key replays that conflict. Read the subscription and use a new key if you still want to make the change.

Path parameters

subscription_idstringRequired

Subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

billing_intervalenum

Send with billing_interval_count to choose a target plan option. Omit both to keep the current interval if the target offers that pair, otherwise use the target plan's default interval and count.

  • daily
  • weekly
  • monthly
  • yearly
billing_interval_countinteger

Required when billing_interval is sent; billing_interval is required when this field is sent.

billing_startsenumRequired

now bills a new period with credit for unused paid item time. next_renewal changes the plan immediately and keeps the current paid period and next billing date. period_end keeps the current plan until the next charged renewal, then applies and bills the scheduled terms. prorated_now charges the new terms for the rest of the current period, less unused paid item credit, and keeps the billing period and anchor.

  • now
  • next_renewal
  • period_end
  • prorated_now
expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

line_itemsarray of object

Optional quantities for target plan lines, with no duplicate IDs. Omitted lines carry their paired current line's quantity, or use the target line's quantity when unpaired. If an adjusted current quantity cannot be paired, send a quantity for every target line.

subscription_plan_idstringRequired

The target subscription plan.

Response · 200

Subscription result.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/change-plan \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "billing_interval": "monthly",
    "billing_interval_count": 1,
    "billing_starts": "next_renewal",
    "expected_version": 1,
    "subscription_plan_id": "plan_01KEZF7C00H4XP3KVYSYYWA181"
  }'

Change subscription quantity#

POST/v1/subscriptions/{subscription_id}/change-quantityKey required

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Changes existing subscription line quantities with the chosen billing timing. billing_starts is required: prorated_now charges now, next_renewal changes quantities immediately without charging, and period_end schedules them for the next billing boundary in scheduled_plan_change. Cancel pending quantities with PATCH scheduled_plan_change: null. A pending change locks quantity edits with plan_change_scheduled. Keeps the current billing period, next billing date, anchor and completed cycles. Omitted quantities stay unchanged. Send 1 to 50 distinct line_items, each with an existing subscription_line_item_id and its new quantity. With prorated_now, a shipping line cannot be changed. Physical quantities can use next_renewal or period_end. Digital line quantities can be changed on a subscription with other lines that ship; its shipping lines stay unchanged and this charge creates no shipment or shipping charge. Use next_renewal to change quantities without charging now. Requires Idempotency-Key; retry with the same key to recover the original outcome. Returns 200 on decline with a closed unpaid order, failed order_payment_attempt, and unchanged subscription. Inspect order_payment_attempt.last_payment_error before trying again. The order and order_payment_attempt are null when the net charge is zero. Send expected_version to reject a concurrent change. A competing prorated_now request returns 409. The same key replays that conflict. Read the subscription and use a new key if you still want to change the quantity. If the outcome remains uncertain, retrieve the subscription and its orders; contact Flint support with the original key and request ID when those reads cannot establish the result.

Path parameters

subscription_idstringRequired

Subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

billing_startsenumRequired

prorated_now charges the prorated difference now and keeps the current period and anchor; next_renewal changes quantities now without charging; period_end schedules them for the next billing boundary.

  • prorated_now
  • next_renewal
  • period_end
expected_versioninteger

Reject the request if the subscription version has changed.

line_itemsarray of objectRequired

Quantities for existing subscription lines, with distinct IDs. Omitted lines keep their quantities. line_items is required.

Response · 200

The subscription and its quantity-change outcome, including a declined payment.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/change-quantity \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "billing_starts": "prorated_now",
    "expected_version": 1,
    "line_items": [
      {
        "quantity": 2,
        "subscription_line_item_id": "sli_01KEZF7C00VQ081BX7W2T96R71"
      }
    ]
  }'

List subscription line items#

GET/v1/subscriptions/{subscription_id}/line-items

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Returns the subscription's line items sorted by ID in ascending order. Default order: subscription_line_item_id ascending.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

Response · 200

A page of subscription line items.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/line-items \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

A page of subscription line items.

JSON
{
  "data": [],
  "meta": {
    "api_version": "2026-09-07"
  },
  "next_page_token": "example",
  "request_id": "req_01KWM6WAHG3N9Q8T2V5XRZ7C4D"
}

Add subscription line item#

POST/v1/subscriptions/{subscription_id}/line-itemsIdempotent

Requires scope commerce.subscriptions.write

Rate limit: write

Adds a catalog variant or bundle to future subscription renewals. Current prices and delivery eligibility are checked before the line is saved. Already-created orders keep their lines.

Path parameters

subscription_idstringRequired

Subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

Send exactly one of these

The `variant` variant of `CreateSubscriptionLineItemRequest`.

expected_subscription_versioninteger

Subscription version last read. A stale version returns VERSION_CONFLICT.

quantityintegerRequired

Whole-number quantity; fractional quantities are not supported.

typeenumRequired

The catalog source of the new line: variant or bundle.

  • variant
variant_idstringRequired

ID of the catalog variant to add. Required when `type` is `variant`; not accepted when it is `bundle`. The line is priced from the variant's catalog price for the subscription's customer when it is added.

Response · 200

Subscription result.

Same response as Create subscription.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/line-items \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_subscription_version": 2,
    "quantity": 1,
    "type": "variant",
    "variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
  }'

Update subscription line item#

PATCH/v1/subscriptions/{subscription_id}/line-items/{subscription_line_item_id}Idempotent

Requires scope commerce.subscriptions.write

Rate limit: write

Swaps a subscription line variant for future renewals while keeping its quantity. Use change-quantity to change line quantities. Send expected_version to reject a concurrent change. Already-created orders keep their lines.

Path parameters

subscription_idstringRequired

Subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

subscription_line_item_idstringRequired

Subscription line item ID. Must be a valid ID with prefix sli_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

variant_idstring

ID of the catalog variant to swap the line to. The line keeps its quantity unless `quantity` is also sent, and is priced from the variant's catalog price for the subscription's customer.

Response · 200

Subscription result.

Same response as Create subscription.

curl -X PATCH https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/line-items/sli_01KEZF7C00PPWVJ2N321V84ASA \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_version": 1,
    "variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
  }'

Remove subscription line item#

DELETE/v1/subscriptions/{subscription_id}/line-items/{subscription_line_item_id}Idempotent

Requires scope commerce.subscriptions.write

Rate limit: write

Removes a line from future subscription renewals. The final line cannot be removed. Send expected_version as a query parameter to reject a concurrent change.

Path parameters

subscription_idstringRequired

Subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

subscription_line_item_idstringRequired

Subscription line item ID. Must be a valid ID with prefix sli_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

expected_versioninteger

Reject the deletion if the subscription version has changed.

Response · 200

Subscription result.

Same response as Create subscription.

curl -X DELETE https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/line-items/sli_01KEZF7C00PPWVJ2N321V84ASA \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

Pause subscription#

POST/v1/subscriptions/{subscription_id}/pauseIdempotent

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Pauses a subscription immediately. pause_duration_cycles counts delivery intervals on prepaid subscriptions and billing intervals otherwise; omit it for an indefinite pause. A pause with a duration resumes automatically at scheduled_resume_at. Repeating the stored pause length returns the paused subscription; a different length returns ACTION_NOT_ALLOWED with reason field_locked and param pause_duration_cycles and requires resuming first. A buyer's pause follows the store's customer_account.buyer_capabilities. Send expected_version to reject a concurrent change.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

pause_duration_cyclesinteger

Billing cycles to pause for, at least 1. Omit it to pause until the subscription is resumed. A pause with a duration resumes automatically at scheduled_resume_at. Repeating the same pause length returns the paused subscription; changing the length requires resuming first. When the store's customer_account.buyer_capabilities.pause.max_cycles is set, a buyer must send a value from 1 to that limit.

Response · 200

The paused subscription.

Same response as Create subscription.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/pause \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "pause_duration_cycles": 2
  }'

List subscription payment retries#

GET/v1/subscriptions/{subscription_id}/payment-retries

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Returns a subscription's manual payment retries, newest first. Default order: created_at descending, then subscription_payment_retry_id descending.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Query parameters

page_sizeinteger

Maximum number of results to return, from 1 to 100. Defaults to 20.

page_tokenstring

Opaque, signed next_page_token from the previous response, bound to the list and caller. Omit on the first request. You may change `page_size` between pages. Reuse it with the same endpoint, filters, sort, and request context. Do not parse or construct tokens. An altered, invalid, expired, or mismatched token returns a validation error.

idempotency_keystring

Filter by the original Idempotency-Key, after trimming surrounding whitespace. Matching is exact and case-sensitive. Returns only resources created in your caller namespace, plus resources created before caller scoping under the original key. Returns current authorized resources, not the recorded response. A pending resource does not prove that the operation succeeded, and an empty list does not prove that it had no effect. A match can show `idempotency_key: null` when that request sent no key, Flint created the resource, the reader isn't the caller that created it (another app install, a buyer, or the merchant reading an app's or buyer's record), or the caller that created an older record is unknown.

Response · 200

A page of retry attempts.

dataarray of objectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

next_page_tokenstring

Opaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/payment-retries \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

A page of retry attempts.

JSON
{
  "data": [
    {
      "created_at": "2026-04-17T14:31:00Z",
      "idempotency_key": "retry-2026-04-17",
      "status": "pending",
      "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
      "subscription_payment_retry_id": "spr_01KEZF7C00S62WNPD7F6JKSQC7",
      "updated_at": "2026-04-17T14:31:00Z"
    }
  ],
  "meta": {
    "api_version": "2026-09-07"
  },
  "next_page_token": "example",
  "request_id": "req_01KWM6MBBZTM36JBTRNM8S60MV"
}

Retry subscription payment#

POST/v1/subscriptions/{subscription_id}/payment-retriesKey required

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Starts one manual collection attempt on a past-due subscription. Send no body, or an empty object. Poll the returned retry for the outcome.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 201

The durable retry attempt.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/payment-retries \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{}'

Get subscription payment retry#

GET/v1/subscriptions/{subscription_id}/payment-retries/{subscription_payment_retry_id}

Requires scope commerce.subscriptions.read or commerce.subscriptions.write

Rate limit: read

Returns one durable manual subscription payment retry.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

subscription_payment_retry_idstringRequired

Flint subscription payment retry ID. Must be a valid ID with prefix spr_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Response · 200

The retry attempt.

Same response as Retry subscription payment.

curl https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/payment-retries/spr_01KEZF7C00YXMSBXGYEMYDD0AA \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY"

The retry attempt.

JSON
{
  "data": {
    "created_at": "2026-04-17T14:31:00Z",
    "idempotency_key": "retry-2026-04-17",
    "status": "pending",
    "subscription_id": "sub_01KEZF7C00XFDKARBRFQGP4ZCW",
    "subscription_payment_retry_id": "spr_01KEZF7C00S62WNPD7F6JKSQC7",
    "updated_at": "2026-04-17T14:31:00Z"
  },
  "meta": {
    "api_version": "2026-09-07"
  },
  "request_id": "req_01KWM6QH71CPMT36PXDQXGCWAK"
}

Apply subscription promotion#

POST/v1/subscriptions/{subscription_id}/promotionsIdempotent

Requires scope commerce.subscriptions.write

Rate limit: write

Attaches a promotion to a subscription for future charged cycles. Send exactly one of promotion.promotion_id or promotion.promotion_code. first_cycle defaults to completed_cycles + 1, or completed_cycles + 2 while past_due, and cannot exceed completed_cycles + 120. Use replace_promotion_id to replace an active or scheduled promotion from first_cycle forward. The unpaid past_due order keeps its price. Promotion terms are frozen when attached; reattachment keeps consumed cycles. Offer promotions cannot be replaced. Requires commerce.subscriptions.write.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Apply only if this matches the subscription's current version.

first_cycleinteger

First charged cycle eligible for this promotion. Defaults to the next cycle without a renewal order, which is also the minimum: completed_cycles + 1, or completed_cycles + 2 while past_due. The maximum is completed_cycles + 120. The unpaid past_due order keeps its price.

promotionone ofRequired

Promotion to attach. Reattaching a removed promotion freezes its current terms and keeps its consumed cycles.

replace_promotion_idstring

Active or scheduled promotion to replace. It stops applying from first_cycle and continues to apply to earlier cycles. Must differ from the new promotion. An offer's own promotion cannot be replaced.

Response · 200

The updated subscription.

Same response as Create subscription.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/promotions \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "promotion": {
      "promotion_code": "RETENTION20"
    }
  }'

Remove subscription promotions#

POST/v1/subscriptions/{subscription_id}/promotions/removeIdempotent

Requires scope commerce.subscriptions.write

Rate limit: write

Removes 1 to 5 unique active or scheduled promotions from a subscription. Future renewal orders omit them; paid orders and the unpaid past_due order keep their discounts. Removal keeps consumed cycles for reattachment and does not return a promotion use. Offer promotions cannot be removed. Requires commerce.subscriptions.write.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Remove only if this matches the subscription's current version.

promotion_idsarray of stringRequired

Active or scheduled promotions to remove. Renewal orders created after removal omit them; paid orders and the unpaid past_due order keep their discounts. Consumed cycles are kept for reattachment.

Response · 200

The updated subscription.

Same response as Create subscription.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/promotions/remove \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "promotion_ids": [
      "promo_01ARZ3NDEKTSV4RRFFQ69G5FAV"
    ]
  }'

Renew subscription now#

POST/v1/subscriptions/{subscription_id}/renewKey required

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Starts a new billing period now and schedules the next charge one billing interval later. Ships the renewal when the subscription has delivery. For subscriptions without delivery, Flint credits unused paid item time against the charge. Available while the subscription is active on a Flint-owned billing schedule (billing_schedule_owner is flint), is not set to cancel at the end of its period, is not in a trial, and has no delivery hold or renewal in progress. The subscription's payment method must be active and allow off-session charges. Requires an idempotency key; retry with the same key to recover the same attempt. Returns the subscription, renewal order, and payment attempt, including when the payment is declined. Inspect order_payment_attempt.last_payment_error for a failed payment.

Path parameters

subscription_idstringRequired

Subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

Response · 200

Subscription result.

dataobjectRequired

Resource, collection, or operation result returned by this request.

metaobject

Additional information about this response.

request_idstringRequired

Identifier of this API request, used to correlate logs and support requests.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/renew \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_version": 1
  }'

Resume subscription#

POST/v1/subscriptions/{subscription_id}/resumeIdempotent

Requires scope commerce.subscriptions.write

Rate limit: external_provider_action

Asks Flint to resume a paused subscription. The request is accepted while the subscription is still paused, with `resume_requested_at` set. Flint then makes it active, or past_due while an overdue period is collected, and sends subscription.resumed. While prepaid deliveries remain, resuming makes no charge and shifts later deliveries and the next charge by the length of the pause. If Flint can't resume it, it stays paused, resume_requested_at clears, and Flint sends subscription.updated. Any other status fails with `ACTION_NOT_ALLOWED`. To undo a scheduled cancellation, PATCH the subscription with cancel_at_period_end set to false.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

Response · 202

The paused subscription with its pending resume request.

  • Retry-After: Whole seconds to wait before retrying or polling again, at least 1.

Same response as Create subscription.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/resume \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "expected_version": 1
  }'

Skip subscription cycle#

POST/v1/subscriptions/{subscription_id}/skip-cycleIdempotent

Requires scope commerce.subscriptions.write

Rate limit: write

While prepaid deliveries remain, defers the next delivery and next charge by one delivery interval without consuming a delivery. Otherwise skips the next renewal without charging or shipping and moves the next billing date forward by one billing interval. A Flint-owned schedule keeps its billing_anchor_day, including when the skipped date falls in a shorter month. Available while the subscription is active, is not set to cancel at the end of its period, and has a next billing date.

Path parameters

subscription_idstringRequired

Flint subscription ID. Must be a valid ID with prefix sub_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.

Request body

expected_versioninteger

Version last read from the resource returned in `data` (the primary resource for a result object). The write fails with `VERSION_CONFLICT` if it has changed. Requiredness depends on the operation and fields being changed.

initiated_byenum

Who asked for the skip: buyer, merchant, or integration. Defaults to merchant. Attribution only; this does not apply the store's buyer limits. To enforce them, use a customer session on POST /v1/me/subscriptions/{subscription_id}/skip-cycle. Flint's skip email says the buyer skipped for buyer, and that the store skipped otherwise.

  • buyer
  • merchant
  • integration

Response · 200

The updated subscription.

Same response as Create subscription.

curl -X POST https://api.withflintpay.com/v1/subscriptions/sub_01KEZF7C00BVRE8YDBXQB74BBM/skip-cycle \
  -H "Flint-Version: 2026-09-07" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: a-unique-key" \
  -d '{
    "initiated_by": "merchant"
  }'

Was this helpful?