Subscription plans
Subscription plans are reusable billing templates: they define what to charge, how often to bill, and any trial or contract terms. A plan's line items can reference your catalog (variants or bundles) or be defined ad hoc with a name and unit price, and the plan can add a setup fee, a trial period, a contract term, and an early termination fee. Flint charges the setup fee when a subscription starts. contract_term_months (1 to 120) and early_termination_fee_money are terms you agree with the buyer: Flint shows them at checkout and records them on each new subscription, but doesn't stop the buyer from canceling early and never charges the fee. early_termination_fee_money requires contract_term_months. See Collect an early termination fee. A plan can also offer several intervals for the buyer to choose from at signup, and one line can let the buyer choose its quantity, such as seats. Every money field on a plan must use the plan's currency.
One plan can be sold through multiple channels: create subscriptions against it directly, or pass its subscription_plan_id to a checkout session (with type: "subscription_plan") or payment link for Flint-hosted signup. To sell subscriptions on any product in a cart instead, use a subscription offer. A plan's status is active, inactive, or archived. Set status to inactive to stop new signups while current subscribers keep renewing, and back to active to sell it again. Archive a plan with DELETE once nothing bills or sells on it; archiving is permanent, and archived plans stay readable. See Stop selling a plan.
Start with the Subscription billing guide. For selling plans through hosted links, see subscription signup links.
Prepaid delivery cadence#
Set delivery_interval and delivery_interval_count together on create or PATCH. Null means one delivery per billing period. Omit both on PATCH to keep the cadence; send both as null to clear it. Every billing option must be a whole multiple in the same unit family, with 1 to 24 deliveries per period. Days/weeks and months/years are the two families. Prices of lines that ship are per delivery. Existing subscriptions keep their frozen terms. See Prepaid deliveries.
Replace plan line items#
line_items is an owned collection. Create a plan with inline items, then replace the collection with PATCH /v1/subscription-plans/{subscription_plan_id} and the plan's current expected_version.
{
"expected_version": 3,
"line_items": [{
"type": "custom",
"subscription_plan_line_item_id": "spli_01J00000000000000000000000",
"name": "Monthly support",
"unit_price_money": {"amount": 2500, "currency": "USD"},
"quantity": 1
}]
}
Include an existing subscription_plan_line_item_id to retain that item's identity. Omit the ID for a new item; Flint generates it. Members omitted from the array are removed. Duplicate IDs and IDs belonging to another plan are rejected. Omit line_items to keep the collection unchanged. An empty array or null is invalid because a plan needs at least one item.
Each ad hoc item supplies its name and price. Catalog items supply variant_id or bundle_id instead. A retained catalog item with the same source keeps its recorded price, tax, display, and fulfillment snapshot; omitting modifiers retains their recorded choices. Changing the source requires an explicit modifiers array and creates a fresh catalog snapshot. Existing subscriptions keep the line-item snapshots taken when they were created.
Replacement and scalar changes in the same request commit atomically. A missing version fence returns 400; a stale version returns 409 VERSION_CONFLICT with the plan's current version in details[0].current_version. Archived plans cannot be edited. Every item must use the plan currency and a quantity from 1 through 9999. Use the same Idempotency-Key and body to recover a lost response with the original new item IDs.
Buyer line quantity policy#
Each plan line accepts allow_quantity_adjustment, min_quantity, and max_quantity on create and collection replacement through PATCH. allow_quantity_adjustment defaults to false; at most one line per plan may set it to true. Bounds default to 1 and 9,999, must each be within that range, and must enclose the line's quantity. A plan with several lines does not automatically allow buyer adjustment.
{
"type": "custom",
"name": "Seats",
"unit_price_money": {"amount": 1500, "currency": "USD"},
"quantity": 2,
"allow_quantity_adjustment": true,
"min_quantity": 1,
"max_quantity": 25
}
The policy is copied into new subscription lines and checkout terms. Editing a plan does not change an existing subscription's policy or a checkout's frozen terms. Bounds describe buyer permissions; merchants may set any subscription line quantity from 1 to 9,999. The adjustable line quantity is the seat count. There is no subscription multiplier or quantity_options.
Intervals and quantities#
billing_interval_options lists up to 12 distinct pairs of billing_interval and billing_interval_count. It must include the plan's own pair, which is the default. Send [] to offer only that pair. On PATCH, omission keeps its value and an array replaces it; changing the plan's billing_interval to a pair the stored options don't include needs the new options in the same request. Responses return the effective list with the plan's own pair first. Invalid options return 400 INVALID_REQUEST with INVALID_VALUE on billing_interval_options. These options apply to every plan, not only plans that ship.
Without a delivery cadence, every interval option bills the same line prices once per period: a USD 15.00 line bills USD 15.00 per month on monthly and USD 15.00 per year on yearly, before quantities, discounts, shipping, and tax. With a delivery cadence, the charge covers all deliveries in that period. For a different price per interval, create separate plans and move subscribers with change-plan. If the interval pair is omitted on a plan change, Flint keeps the current pair when the target offers it, otherwise selects the target plan's own default pair.
Creating or updating a plan with more than one option and no lines that ship returns meta.warnings[] with code billing_interval_options_same_price and severity warning.
The buyer chooses an interval and, when the plan has an adjustable line, that line's quantity at signup. Use change-quantity to change existing subscription lines. next_renewal changes merchant-selected quantities immediately without charging; period_end schedules them for the next charged renewal; prorated_now charges an eligible digital line's difference now. Buyers may use period_end or prorated_now within the frozen line bounds. Physical boxes use bundle lines, with the number of boxes as the line quantity.
Variant swaps#
A catalog line can list swap_variant_ids: up to 25 other variants of the same product that a subscriber may switch the line to after signup. [] means no swaps. Only variant lines can list swaps; bundle and ad hoc lines can't (400 INVALID_REQUEST). A subscriber can always swap back to the line's own variant_id. See Change cadence, quantity, and items.
Buyer plan changes#
plan_change_options lists up to 25 plans subscribers may switch to. Each entry requires subscription_plan_id and billing_starts: now starts and bills a new period with credit for unused paid item time; prorated_now keeps the current period and billing date and charges the target plan's items for the rest of the period, less that credit; next_renewal changes the plan immediately and charges its price on the next unpaid renewal; period_end keeps the current plan until the next charged renewal, then applies the target terms frozen at scheduling. You choose the timing for each target. Flint returns 409 ACTION_NOT_ALLOWED if you set prorated_now and either plan requires delivery.
{
"expected_version": 3,
"plan_change_options": [
{"subscription_plan_id": "plan_01J00000000000000000000000", "billing_starts": "prorated_now"},
{"subscription_plan_id": "plan_01J00000000000000000000001", "billing_starts": "period_end"}
]
}
Responses always include the list, defaulting to [], which turns buyer plan changes off. On PATCH, omission keeps the list; an array replaces it and requires expected_version. Send [] to clear it. null, duplicate targets, the plan itself, and targets in another currency are invalid. Unknown targets return 404 RESOURCE_NOT_FOUND; archived targets return 409 ACTION_NOT_ALLOWED with reason archived. You may save an inactive target, but buyers can choose it only after it becomes active. Archiving a referenced plan is allowed. Environment and sandbox copies remap copied targets and drop targets that weren't copied.
The merchant change-plan endpoint can use any eligible target, regardless of this list. Buyer options are further limited by the subscription's state and delivery requirements. A pending period_end change appears in the required nullable scheduled_plan_change snapshot. Buyers can clear only changes they scheduled themselves, using scheduled_plan_change: null when cancel_plan_change is available. See Schedule or clear a pending change for pauses, skips, archived targets, and edit restrictions.
Discounts#
Physical plans can't have a trial. Discount shipments with a promotion applied at signup: recurrence.type once covers the first shipment, repeating the first period_count charged cycles, and forever every cycle. See Discounts and first-shipment offers.
Gifts#
gifts_enabled lets checkout buyers name a gift recipient for the subscription they buy. It defaults to false. Each checkout session freezes it when it's created, so changing it doesn't affect sessions already open. With your API key you can set a subscription's gift_recipient whatever the plan says. See Gift subscriptions.
Physical products#
A catalog line whose variant or bundle is physical makes the plan ship every cycle. A catalog item with no kind counts as physical. Each renewal order then carries the subscriber's address, a shipping charge, tax for that address, and a fulfillment. See Ship physical products.
delivery_required is true when at least one line ships. subscription_delivery_method_ids lists the delivery methods subscribers can choose. Empty means the store's checkout default methods. Removing a method changes what new subscribers can choose; current subscribers keep it until it is archived or stops serving their address. delivery_method_subscription_counts reports, for each method that live subscriptions on the plan use, how many are active, paused, or past_due. The canceling and billing_hold counts describe subsets of active.
Create, line item changes, method changes, and trial changes validate the plan's physical lines:
| Error | Cause |
|---|---|
ACTION_NOT_ALLOWED with details[0].reason: configuration_required | A physical line has no delivery profile. |
ACTION_NOT_ALLOWED with details[0].reason: configuration_required | A line's delivery profile needs an action before it can be used. |
INVALID_REQUEST (NOT_ALLOWED) | A line's profile allows only pickup. Subscriptions ship with shipment or local_delivery. |
400 INVALID_REQUEST with detail code NOT_ALLOWED for request fields, or 409 ACTION_NOT_ALLOWED with reason configuration_required for stored configuration | The physical lines would ship separately, so one method can't cover a renewal. |
INVALID_REQUEST (NOT_ALLOWED) | No offered method can price every shipment without the buyer present, or a listed method uses caller_supplied pricing or delivery windows. |
INVALID_REQUEST (NOT_ALLOWED) | trial_period_days is above 0. Use a promotion for a first-shipment offer instead. |
Each error names what failed with fields on its details[0]:
variant_idandproduct_idname a variant line, or the item inside a bundle line that failed.blocking_resourcescan list the line's variant or bundle, withresource_typeproduct_variantorbundle. A bundle line is always named this way.delivery_method_idnames a listed method that fails the check. A method that can't be used at all, such as an archived one, is named bydelivery_method_idwith no line fields.
The trial and combination checks, and a method that can't serve the lines, apply to the whole plan, so their line fields name the plan's first physical line. An error with none of these fields names the failing input in param only.
Stock source#
inventory_routing_source says where tracked stock for the plan's orders comes from. Its type picks one of three shapes:
type | ID field | Stock comes from |
|---|---|---|
fixed_location | location_id | One Location. |
policy | inventory_allocation_policy_id | An allocation policy. |
policy_revision | inventory_allocation_policy_revision_id | One immutable revision of an allocation policy. |
{
"inventory_routing_source": { "type": "fixed_location", "location_id": "loc_01J00000000000000000000000" }
}
A policy source follows the policy's configuration as it is when each order is made. A policy_revision source keeps routing through that revision even after the policy's configuration changes. Take the revision ID from the policy's current_inventory_allocation_policy_revision_id, or list its revisions.
When any line item tracks inventory, an omitted source uses and stores settings.inventory.default_routing_source. If no default is set, Flint uses the active Location in the current environment that has had inventory allocation enabled the longest. The plan resolves that fallback again each time it is used. With no eligible Location and no default, creating such a plan without a source returns INVALID_REQUEST with param inventory_routing_source, and replacing line_items with tracked items on a plan that has no source returns 409 ACTION_NOT_ALLOWED with reason configuration_required on the plan. Neither saves anything. A plan whose lines don't track inventory can omit it, and a source you send anyway is validated and stored.
On PATCH, omit the field to keep the stored source. A new object replaces it as a whole, and the check runs against the plan's line items after any line_items replacement in the same request. The source can't be cleared: null returns 400 INVALID_REQUEST (detail INVALID_VALUE) on create and on update. A field from another type, or any other unknown field, returns 400 INVALID_REQUEST with detail UNKNOWN_FIELD and its full path in param, such as inventory_routing_source.location_id. An unknown type, a missing ID, or a malformed ID returns 400 INVALID_REQUEST on inventory_routing_source.
Responses include inventory_routing_source when the plan has one and omit it otherwise. A policy_revision source in a response also carries inventory_allocation_policy_id, the policy that revision belongs to, so you can read the revision with GET /v1/inventory-allocation-policies/{inventory_allocation_policy_id}/revisions/{inventory_allocation_policy_revision_id}. Requests don't accept that field: build a replacement source from its type and the one ID that type takes, instead of sending a stored source back whole. New subscriptions copy the plan's source when they're created, and new payment links for the plan copy it unless they send their own. Subscriptions and payment links that already exist keep the source they copied.
The Subscription plan object#
The recurring price and billing terms offered to customers.
Returned by GET /v1/subscription-plans/{subscription_plan_id} and carried by the endpoints below.
Attributes
billing_intervalenumRequiredUnit of the plan's default billing period. Read with `billing_interval_count`: monthly with a count of 3 bills every three months. A new subscription starts on the pair the buyer chose from `billing_interval_options`, or on this one when they chose none.
dailyweeklymonthlyyearly
billing_interval_countintegerRequiredNumber of `billing_interval` units between charges on the plan's default pair.
billing_interval_optionsarray of objectRequiredOffered billing interval and count pairs, including the plan's default pair. Prices of lines that ship are per delivery. Each option charges for all deliveries in its period. Use separate plans or promotions for different prices per interval.
billing_intervalenumRequiredUnit of the billing period. Together with billing_interval_count it sets the period one charge covers.
dailyweeklymonthlyyearly
billing_interval_countintegerRequiredNumber of interval units per billing period, from 1 to 365. It doesn't change the price of one delivery. With a delivery cadence, it changes how many deliveries one charge covers; without one, it doesn't change the charge.
contract_term_monthsintegerA commitment period you agree with the buyer, 1 to 120 months. Flint shows it at checkout and records it on each new subscription (contract_start_at, contract_end_at). Flint does not stop the buyer from canceling earlier.
created_atstringRequiredRFC3339 timestamp.
currencystringRequiredISO 4217 currency code.
delivery_intervalenum or nullRequiredDelivery cadence. Null when no separate delivery cadence is set; one delivery is made per billing period. Every billing option must be a whole multiple in the same unit family (days/weeks or months/years), with 1 to 24 deliveries per period. Existing subscriptions keep their frozen cadence.
dailyweeklymonthlyyearlynull
delivery_interval_countinteger or nullRequiredNumber of delivery intervals between deliveries. Null when no separate delivery cadence is set.
delivery_method_subscription_countsarray of objectRequiredHow many of this plan's subscriptions use each delivery method, by status. Counts only subscriptions that are active, paused, or past due and have a delivery method.
delivery_method_idstringRequiredID of the delivery method.
subscription_countsobjectRequiredLive subscriptions that use the method, by status.
delivery_requiredbooleanRequiredWhether any line on the plan needs delivery, so each renewal ships or delivers items. Flint works it out from the lines and sets it; you can't send it.
descriptionstringDescription of the plan. Omitted when none is set.
early_termination_fee_moneyobjectA fee you agree the buyer owes for canceling before the contract term ends. Flint shows it at checkout and records it on each new subscription, but never charges it. To collect it, charge the buyer yourself, for example with an order on their saved payment method. Requires contract_term_months.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredThree-letter uppercase ISO 4217 currency code for this amount, such as USD.
end_afterobject or nullRequiredDefault automatic end for new subscriptions. Counts charged billing cycles, from 1 to 1200. Send null for no automatic end. Existing subscriptions keep their recorded condition. Null when no default automatic end is set.
cycle_countintegerRequiredTotal charged billing cycles, including imported completed cycles.
typeenumRequiredHow this automatic end is measured.
cycles
external_reference_idstringCaller-owned identifier for this resource in an external system.
gifts_enabledbooleanRequiredWhether checkout buyers can name a gift recipient. Checkout sessions freeze it when they are created. Defaults to false. You can set gift_recipient on a subscription through the API either way.
imagesarray of objectRequiredImages of the plan in display order. The first image is the plan's primary image.
altstringAlternative text describing the image for accessibility.
file_idstringIdentifier of the file attached as this image.
heightintegerRequiredImage height in pixels, when known.
source_referencestringCaller-owned reference identifying this attachment within its gallery.
urlstringRequiredURL of the image.
widthintegerRequiredImage width in pixels, when known.
inventory_routing_sourceobjectWhere tracked demand from this plan is routed. New subscriptions and payment links for the plan copy it. Absent when the plan has no stored source, including when its demand uses the implicit single-Location fallback.
inventory_allocation_policy_idstringID of the allocation policy that routes demand.
inventory_allocation_policy_revision_idstringID of the allocation policy revision that routes demand.
location_idstringID of the fixed Location that serves all demand.
typeenumRequiredHow Flint routes demand to Locations.
fixed_locationpolicypolicy_revision
line_itemsarray of one ofThe lines a subscription on this plan bills each period, in the order you set them. Flint copied each catalog line's details from the catalog when it added the line.
One of these shapes
A line item on a subscription plan.
allow_quantity_adjustmentbooleanWhether buyers may adjust this line quantity. Defaults to false. At most one line per plan may allow adjustment.
bundle_componentsarray of objectComponents of the bundle, fixed when the line was added. Omitted on variant and custom lines.
categoriesarray of objectCatalog categories of the product or bundle, fixed when the line was added. Omitted on custom lines.
descriptionstringDescription of the line. A variant line uses the product description and a bundle line uses the bundle description; Flint copied it when the line was added. A custom line uses the description you sent. Omitted when there is none.
imageobjectPrimary image of the variant (or its product) or bundle, fixed when the line was added. Omitted on custom lines and when the item has no image.
max_quantityintegerMaximum buyer quantity. Defaults to 9999. Merchants may set any line quantity from 1 to 9999. Whole-number quantity; fractional quantities are not supported.
min_quantityintegerMinimum buyer quantity. Defaults to 1. The bounds must enclose the plan line quantity. Whole-number quantity; fractional quantities are not supported.
modifiersarray of objectModifiers chosen for the line, with their prices, fixed when the line was added or last changed. Omitted when the line has none.
namestringName of the line. A variant line uses the product name, followed by the variant name when the variant has options, and a bundle line uses the bundle name; Flint copied it when the line was added. A custom line uses the name you sent.
product_idstringID of the product the line's variant belongs to. Present on a variant line; absent on bundle and custom lines, which have no parent product.
quantityintegerRequiredWhole-number quantity; fractional quantities are not supported.
selected_optionsarray of objectOption values that identify the variant, such as size and color, fixed when the line was added. Omitted on bundle and custom lines.
skustringSKU of the variant or bundle, fixed when the line was added. Omitted on custom lines and when the item has no SKU.
subscription_plan_line_item_idstringRequiredUnique identifier for this subscription plan line item, prefixed `spli_`.
swap_variant_idsarray of stringRequiredIDs of the variants a subscriber can swap this line to, in the order you set. Empty when none are set, and always empty on bundle and custom lines.
swap_variantsarray of objectCurrent sellable alternatives in swap_variant_ids order, excluding the line's own variant and variants priced in a different currency. Present on variant lines, including an empty array.
taxobjectHow tax applies to the line. A variant line takes its taxable setting and tax category from the variant, and a bundle line from its components; Flint copied them when the line was added. A taxable variant or bundle line with no tax category gets your default line item tax category, or `general`. A custom line has the tax you sent.
typeenumRequiredHow the line is sold: from a catalog variant, from a catalog bundle, or as a custom line.
variant
unit_price_moneyobjectPrice of one unit in the plan's currency, before modifiers, discounts, and tax. A variant or bundle line keeps the catalog price from when the line was added.
variant_idstringRequiredID of the catalog variant the line sells. Present on a variant line.
merchant_idstringRequiredID of the merchant this resource belongs to.
metadatamap of stringStored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.
namestringRequiredName of the plan. Buyers see it at checkout and on their subscription.
plan_change_optionsarray of objectRequiredPlans subscribers may switch to, in display order, with the billing timing for each target. Empty means plan changes are off. Omission on PATCH keeps the options; an array replaces them and requires expected_version. Send [] to clear. Null is invalid.
billing_startsenumRequiredThe store's billing timing for this target: now collects a new period with unused-time credit; next_renewal changes the plan now and keeps the current paid period and next billing date; period_end keeps the current plan until the next charged renewal; prorated_now charges the difference for the rest of the current period and keeps the period and anchor. Neither plan may require delivery when billing_starts is prorated_now.
nownext_renewalperiod_endprorated_now
subscription_plan_idstringRequiredThe target subscription plan offered for buyer plan changes.
setup_fee_moneyobjectOne-time fee charged with the first payment of a new subscription, except one that continues an imported paid period. Omitted when the plan has no setup fee.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredThree-letter uppercase ISO 4217 currency code for this amount, such as USD.
statusenumRequiredActive plans accept new signups. Inactive plans refuse new signups with ACTION_NOT_ALLOWED while existing subscriptions keep renewing. Archived plans are read-only and their status is set only by DELETE /v1/subscription-plans/{subscription_plan_id}.
activeinactivearchived
subscription_delivery_method_idsarray of stringRequiredIDs of the delivery methods a subscriber can choose for this plan's lines that ship. When empty, the delivery methods in your checkout settings apply.
subscription_plan_idstringRequiredUnique identifier for this subscription plan, prefixed `plan_`.
trial_period_daysintegerDays of free trial before the first recurring charge. Omitted or 0 when the plan has no trial.
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredCurrent version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.
{
"billing_interval": "monthly",
"billing_interval_count": 1,
"billing_interval_options": [
{
"billing_interval": "monthly",
"billing_interval_count": 1
}
],
"created_at": "2026-03-17T14:30:00Z",
"currency": "USD",
"delivery_interval": null,
"delivery_interval_count": null,
"delivery_method_subscription_counts": [],
"delivery_required": false,
"end_after": null,
"gifts_enabled": false,
"images": [],
"line_items": [
{
"allow_quantity_adjustment": false,
"name": "Membership",
"product_id": "prod_01KEZF7C00027JTCXQ7TQF86X8",
"quantity": 1,
"subscription_plan_line_item_id": "spli_01KEZF7C00CEPTZ7FN2H9F4SF9",
"swap_variant_ids": [],
"swap_variants": [],
"type": "variant",
"unit_price_money": {
"amount": 2500,
"currency": "USD"
},
"variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
}
],
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"metadata": {
"segment": "gold"
},
"name": "Monthly Membership",
"plan_change_options": [],
"status": "active",
"subscription_delivery_method_ids": [],
"subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
"updated_at": "2026-03-17T14:30:00Z",
"version": 1
}List subscription plans#
/v1/subscription-plansRequires scope commerce.subscription_plans.read or commerce.subscription_plans.write
Rate limit: read
Returns a paginated list of subscription plans for the authenticated merchant. Default order: created_at descending, then subscription_plan_id descending.
Query parameters
page_sizeintegerMaximum number of results to return, from 1 to 100. Defaults to 20.
page_tokenstringOpaque, 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 enumFilter by status. Omitted, the list leaves out archived rows; name archived to include them. 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.
activeinactivearchived
external_reference_idstringExact-match filter on the caller-owned external reference ID.
querystringSearch across subscription plan ID, external reference ID, name, and description. 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 plan_01.
sort_byenumField to sort by. Defaults to created_at; ties are broken by subscription_plan_id.
namecreated_atupdated_at
sort_directionenumSort direction. Defaults to desc.
ascdesc
created_afterstringInclusive lower bound on created_at.
created_beforestringExclusive upper bound on created_at.
updated_afterstringInclusive lower bound on updated_at.
updated_beforestringExclusive upper bound on updated_at.
Response · 200
A page of subscription plans.
dataarray of objectRequiredResource, collection, or operation result returned by this request.
billing_intervalenumRequiredUnit of the plan's default billing period. Read with `billing_interval_count`: monthly with a count of 3 bills every three months. A new subscription starts on the pair the buyer chose from `billing_interval_options`, or on this one when they chose none.
dailyweeklymonthlyyearly
billing_interval_countintegerRequiredNumber of `billing_interval` units between charges on the plan's default pair.
billing_interval_optionsarray of objectRequiredOffered billing interval and count pairs, including the plan's default pair. Prices of lines that ship are per delivery. Each option charges for all deliveries in its period. Use separate plans or promotions for different prices per interval.
contract_term_monthsintegerA commitment period you agree with the buyer, 1 to 120 months. Flint shows it at checkout and records it on each new subscription (contract_start_at, contract_end_at). Flint does not stop the buyer from canceling earlier.
created_atstringRequiredRFC3339 timestamp.
currencystringRequiredISO 4217 currency code.
delivery_intervalenum or nullRequiredDelivery cadence. Null when no separate delivery cadence is set; one delivery is made per billing period. Every billing option must be a whole multiple in the same unit family (days/weeks or months/years), with 1 to 24 deliveries per period. Existing subscriptions keep their frozen cadence.
dailyweeklymonthlyyearlynull
delivery_interval_countinteger or nullRequiredNumber of delivery intervals between deliveries. Null when no separate delivery cadence is set.
delivery_method_subscription_countsarray of objectRequiredHow many of this plan's subscriptions use each delivery method, by status. Counts only subscriptions that are active, paused, or past due and have a delivery method.
delivery_requiredbooleanRequiredWhether any line on the plan needs delivery, so each renewal ships or delivers items. Flint works it out from the lines and sets it; you can't send it.
descriptionstringDescription of the plan. Omitted when none is set.
early_termination_fee_moneyobjectA fee you agree the buyer owes for canceling before the contract term ends. Flint shows it at checkout and records it on each new subscription, but never charges it. To collect it, charge the buyer yourself, for example with an order on their saved payment method. Requires contract_term_months.
end_afterobject or nullRequiredDefault automatic end for new subscriptions. Counts charged billing cycles, from 1 to 1200. Send null for no automatic end. Existing subscriptions keep their recorded condition. Null when no default automatic end is set.
external_reference_idstringCaller-owned identifier for this resource in an external system.
gifts_enabledbooleanRequiredWhether checkout buyers can name a gift recipient. Checkout sessions freeze it when they are created. Defaults to false. You can set gift_recipient on a subscription through the API either way.
imagesarray of objectRequiredImages of the plan in display order. The first image is the plan's primary image.
inventory_routing_sourceobjectWhere tracked demand from this plan is routed. New subscriptions and payment links for the plan copy it. Absent when the plan has no stored source, including when its demand uses the implicit single-Location fallback.
line_itemsarray of one ofThe lines a subscription on this plan bills each period, in the order you set them. Flint copied each catalog line's details from the catalog when it added the line.
merchant_idstringRequiredID of the merchant this resource belongs to.
metadatamap of stringStored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.
namestringRequiredName of the plan. Buyers see it at checkout and on their subscription.
plan_change_optionsarray of objectRequiredPlans subscribers may switch to, in display order, with the billing timing for each target. Empty means plan changes are off. Omission on PATCH keeps the options; an array replaces them and requires expected_version. Send [] to clear. Null is invalid.
setup_fee_moneyobjectOne-time fee charged with the first payment of a new subscription, except one that continues an imported paid period. Omitted when the plan has no setup fee.
statusenumRequiredActive plans accept new signups. Inactive plans refuse new signups with ACTION_NOT_ALLOWED while existing subscriptions keep renewing. Archived plans are read-only and their status is set only by DELETE /v1/subscription-plans/{subscription_plan_id}.
activeinactivearchived
subscription_delivery_method_idsarray of stringRequiredIDs of the delivery methods a subscriber can choose for this plan's lines that ship. When empty, the delivery methods in your checkout settings apply.
subscription_plan_idstringRequiredUnique identifier for this subscription plan, prefixed `plan_`.
trial_period_daysintegerDays of free trial before the first recurring charge. Omitted or 0 when the plan has no trial.
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredCurrent version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
next_page_tokenstringOpaque token to send as `page_token` to retrieve the next page. Omitted when there is no next page.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl https://api.withflintpay.com/v1/subscription-plans \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"A page of subscription plans.
{
"data": [
{
"billing_interval": "monthly",
"billing_interval_count": 1,
"billing_interval_options": [
{
"billing_interval": "monthly",
"billing_interval_count": 1
}
],
"created_at": "2026-03-17T14:30:00Z",
"currency": "USD",
"delivery_interval": null,
"delivery_interval_count": null,
"delivery_method_subscription_counts": [],
"delivery_required": false,
"end_after": null,
"gifts_enabled": false,
"images": [],
"line_items": [
{
"allow_quantity_adjustment": false,
"name": "Membership",
"product_id": "prod_01KEZF7C00027JTCXQ7TQF86X8",
"quantity": 1,
"subscription_plan_line_item_id": "spli_01KEZF7C00CEPTZ7FN2H9F4SF9",
"swap_variant_ids": [],
"swap_variants": [],
"type": "variant",
"unit_price_money": {
"amount": 2500,
"currency": "USD"
},
"variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
}
],
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"metadata": {
"segment": "gold"
},
"name": "Monthly Membership",
"plan_change_options": [],
"status": "active",
"subscription_delivery_method_ids": [],
"subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
"updated_at": "2026-03-17T14:30:00Z",
"version": 1
}
],
"meta": {
"api_version": "2026-09-07"
},
"next_page_token": "example",
"request_id": "req_01KWM6Y0F5BFYNFR1W2D54VKDX"
}Create subscription plan#
/v1/subscription-plansIdempotentRequires scope commerce.subscription_plans.write
Rate limit: write
Creates a subscription plan: the recurring price and terms customers sign up to. Send `name`, `currency`, the billing interval, and at least one line item from your catalog. An active plan accepts new signups; an inactive plan refuses them with `ACTION_NOT_ALLOWED` while existing subscriptions keep renewing. A free trial isn't allowed on a plan with lines that ship.
Request body
billing_intervalenumRequiredUnit of the plan's default billing period. Read with `billing_interval_count`: monthly with a count of 3 bills every three months. Add other choices with `billing_interval_options`.
dailyweeklymonthlyyearly
billing_interval_countintegerRequiredNumber of `billing_interval` units between charges on the plan's default pair, up to 365.
billing_interval_optionsarray of objectOffered billing interval and count pairs, including the plan's default pair. Prices of lines that ship are per delivery. Each option charges for all deliveries in its period. Use separate plans or promotions for different prices per interval.
billing_intervalenumRequiredUnit of the billing period. Together with billing_interval_count it sets the period one charge covers.
dailyweeklymonthlyyearly
billing_interval_countintegerRequiredNumber of interval units per billing period, from 1 to 365. It doesn't change the price of one delivery. With a delivery cadence, it changes how many deliveries one charge covers; without one, it doesn't change the charge.
contract_term_monthsintegerA commitment period you agree with the buyer, 1 to 120 months. Flint shows it at checkout and records it on each new subscription (contract_start_at, contract_end_at). Flint does not stop the buyer from canceling earlier.
currencystringRequiredISO 4217 currency code.
delivery_intervalenum or nullDelivery cadence, set together with delivery_interval_count. Null when no separate delivery cadence is set; one delivery is made per billing period. Each billing option must be a whole multiple in the same unit family (days/weeks or months/years), with 1 to 24 deliveries per period. Existing subscriptions keep their frozen cadence. Omit both fields on PATCH to keep the cadence; send both as null to clear it.
dailyweeklymonthlyyearlynull
delivery_interval_countinteger or nullPositive number of delivery intervals between deliveries. Set or clear together with delivery_interval. Null when no separate delivery cadence is set; one delivery is made per billing period.
descriptionstringDescription of the plan, up to 2,048 characters. Omit for none.
early_termination_fee_moneyobjectA fee you agree the buyer owes for canceling before the contract term ends. Flint shows it at checkout and records it on each new subscription, but never charges it. To collect it, charge the buyer yourself, for example with an order on their saved payment method. Requires contract_term_months.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredThree-letter uppercase ISO 4217 currency code for this amount, such as USD.
end_afterobject or nullDefault automatic end for new subscriptions. Counts charged billing cycles, from 1 to 1200. Send null for no automatic end. Existing subscriptions keep their recorded condition. Null when no default automatic end is set.
cycle_countintegerRequiredTotal charged billing cycles, including imported completed cycles.
typeenumRequiredHow this automatic end is measured.
cycles
external_reference_idstringCaller-owned identifier for this resource in an external system.
gifts_enabledbooleanWhether checkout buyers can name a gift recipient. Checkout sessions freeze it when they are created. Defaults to false. You can set gift_recipient on a subscription through the API either way.
imagesarray of one ofThe complete desired gallery in display order. The first image is primary. Send [] to clear the gallery.
Send exactly one of these
The `Source URL` variant of `ImageInput`.
altstringAlternative text describing the image for accessibility.
source_referencestringAn opaque reference for this attachment, unique within its gallery. Whitespace and case are preserved.
source_urlstringRequiredA public image URL for Flint to fetch, or an untransformed canonical image.url returned by Flint. Send exactly one of source_url or file_id. Canonical Flint URLs attach without another fetch. Flint doesn't download a source_url again while the image it produced is still in this field.
inventory_routing_sourceone ofWhere tracked demand from this plan is routed: a fixed Location, an allocation policy, or an immutable policy revision. When omitted for tracked demand, Flint stores settings.inventory.default_routing_source if set. Otherwise, Flint uses the active Location in the current environment that has had inventory allocation enabled the longest. The plan resolves that fallback again each time it is used. If no Location is eligible, send a routing source or configure the merchant default. New subscriptions and payment links for the plan copy an explicit or stored default source, unless the payment link sends its own.
Send exactly one of these
The `fixed_location` variant of `InventoryRoutingSourceInput`.
location_idstringRequiredID of the fixed Location that serves all demand.
typeenumRequiredHow Flint routes demand to Locations.
fixed_location
line_itemsarray of one ofRequiredThe lines a subscription on this plan bills each period. At least one. Each line sells a catalog variant, a catalog bundle, or a custom item you price yourself.
Send exactly one of these
The `variant` variant of `SubscriptionPlanLineItemInput`.
allow_quantity_adjustmentbooleanWhether buyers may adjust this line quantity. Defaults to false. At most one line per plan may allow adjustment.
max_quantityintegerMaximum buyer quantity. Defaults to 9999. Merchants may set any line quantity from 1 to 9999. Whole-number quantity; fractional quantities are not supported.
min_quantityintegerMinimum buyer quantity. Defaults to 1. The bounds must enclose the plan line quantity. Whole-number quantity; fractional quantities are not supported.
modifiersarray of one ofModifiers to apply to a variant or bundle line. Omit to apply the catalog item's default modifiers; send an empty array to skip the defaults. Not allowed on a custom line, and `null` is rejected.
quantityintegerWhole-number quantity; fractional quantities are not supported.
swap_variant_idsarray of stringVariants a subscriber can swap this line to. Only for a variant line. At most 25, with no repeats, none equal to the line's own variant, and all from the same product. Omit for none.
typeenumRequiredThe kind of line to add. It must match the other fields: `variant` needs `variant_id`, `bundle` needs `bundle_id`, and `custom` needs `name` and `unit_price_money`.
variant
variant_idstringRequiredID of the catalog variant to sell on this line. Send it with `type` variant and without `bundle_id`, `name`, `unit_price_money`, `description`, or `tax`: Flint takes those from the variant.
metadatamap of stringCaller-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.
namestringRequiredName of the plan. Buyers see it at checkout and on their subscription. Required, and can't be empty. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
plan_change_optionsarray of objectPlans subscribers may switch to, in display order, with the billing timing for each target. Empty means plan changes are off. Omission on PATCH keeps the options; an array replaces them and requires expected_version. Send [] to clear. Null is invalid.
billing_startsenumRequiredThe store's billing timing for this target: now collects a new period with unused-time credit; next_renewal changes the plan now and keeps the current paid period and next billing date; period_end keeps the current plan until the next charged renewal; prorated_now charges the difference for the rest of the current period and keeps the period and anchor. Neither plan may require delivery when billing_starts is prorated_now.
nownext_renewalperiod_endprorated_now
subscription_plan_idstringRequiredThe target subscription plan offered for buyer plan changes.
setup_fee_moneyobjectOne-time fee charged with the first payment of a new subscription, except one that continues an imported paid period. Must be above zero and in the plan's currency. Omit for no setup fee.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredThree-letter uppercase ISO 4217 currency code for this amount, such as USD.
statusenumActive plans accept new signups. Inactive plans refuse new signups with ACTION_NOT_ALLOWED while existing subscriptions keep renewing. Archived plans are read-only and their status is set only by DELETE /v1/subscription-plans/{subscription_plan_id}.
activeinactive
subscription_delivery_method_idsarray of stringIDs of the delivery methods a subscriber can choose for this plan's lines that ship. Omit to use the delivery methods in your checkout settings.
trial_period_daysintegerDays of free trial before the first charge, from 0 to 365; 0 means no trial. Not allowed on plans with lines that ship.
Response · 201
The created subscription plan.
dataobjectRequiredResource, collection, or operation result returned by this request.
billing_intervalenumRequiredUnit of the plan's default billing period. Read with `billing_interval_count`: monthly with a count of 3 bills every three months. A new subscription starts on the pair the buyer chose from `billing_interval_options`, or on this one when they chose none.
dailyweeklymonthlyyearly
billing_interval_countintegerRequiredNumber of `billing_interval` units between charges on the plan's default pair.
billing_interval_optionsarray of objectRequiredOffered billing interval and count pairs, including the plan's default pair. Prices of lines that ship are per delivery. Each option charges for all deliveries in its period. Use separate plans or promotions for different prices per interval.
contract_term_monthsintegerA commitment period you agree with the buyer, 1 to 120 months. Flint shows it at checkout and records it on each new subscription (contract_start_at, contract_end_at). Flint does not stop the buyer from canceling earlier.
created_atstringRequiredRFC3339 timestamp.
currencystringRequiredISO 4217 currency code.
delivery_intervalenum or nullRequiredDelivery cadence. Null when no separate delivery cadence is set; one delivery is made per billing period. Every billing option must be a whole multiple in the same unit family (days/weeks or months/years), with 1 to 24 deliveries per period. Existing subscriptions keep their frozen cadence.
dailyweeklymonthlyyearlynull
delivery_interval_countinteger or nullRequiredNumber of delivery intervals between deliveries. Null when no separate delivery cadence is set.
delivery_method_subscription_countsarray of objectRequiredHow many of this plan's subscriptions use each delivery method, by status. Counts only subscriptions that are active, paused, or past due and have a delivery method.
delivery_requiredbooleanRequiredWhether any line on the plan needs delivery, so each renewal ships or delivers items. Flint works it out from the lines and sets it; you can't send it.
descriptionstringDescription of the plan. Omitted when none is set.
early_termination_fee_moneyobjectA fee you agree the buyer owes for canceling before the contract term ends. Flint shows it at checkout and records it on each new subscription, but never charges it. To collect it, charge the buyer yourself, for example with an order on their saved payment method. Requires contract_term_months.
end_afterobject or nullRequiredDefault automatic end for new subscriptions. Counts charged billing cycles, from 1 to 1200. Send null for no automatic end. Existing subscriptions keep their recorded condition. Null when no default automatic end is set.
external_reference_idstringCaller-owned identifier for this resource in an external system.
gifts_enabledbooleanRequiredWhether checkout buyers can name a gift recipient. Checkout sessions freeze it when they are created. Defaults to false. You can set gift_recipient on a subscription through the API either way.
imagesarray of objectRequiredImages of the plan in display order. The first image is the plan's primary image.
inventory_routing_sourceobjectWhere tracked demand from this plan is routed. New subscriptions and payment links for the plan copy it. Absent when the plan has no stored source, including when its demand uses the implicit single-Location fallback.
line_itemsarray of one ofThe lines a subscription on this plan bills each period, in the order you set them. Flint copied each catalog line's details from the catalog when it added the line.
merchant_idstringRequiredID of the merchant this resource belongs to.
metadatamap of stringStored caller-owned key-value data. See `MetadataInput` for key, value, and size rules.
namestringRequiredName of the plan. Buyers see it at checkout and on their subscription.
plan_change_optionsarray of objectRequiredPlans subscribers may switch to, in display order, with the billing timing for each target. Empty means plan changes are off. Omission on PATCH keeps the options; an array replaces them and requires expected_version. Send [] to clear. Null is invalid.
setup_fee_moneyobjectOne-time fee charged with the first payment of a new subscription, except one that continues an imported paid period. Omitted when the plan has no setup fee.
statusenumRequiredActive plans accept new signups. Inactive plans refuse new signups with ACTION_NOT_ALLOWED while existing subscriptions keep renewing. Archived plans are read-only and their status is set only by DELETE /v1/subscription-plans/{subscription_plan_id}.
activeinactivearchived
subscription_delivery_method_idsarray of stringRequiredIDs of the delivery methods a subscriber can choose for this plan's lines that ship. When empty, the delivery methods in your checkout settings apply.
subscription_plan_idstringRequiredUnique identifier for this subscription plan, prefixed `plan_`.
trial_period_daysintegerDays of free trial before the first recurring charge. Omitted or 0 when the plan has no trial.
updated_atstringRequiredRFC3339 timestamp.
versionintegerRequiredCurrent version of this resource's owned state. Send it as `expected_version` when changing the resource to reject a stale write.
metaobjectAdditional information about this response.
api_versionstringAPI version used to produce this response.
idempotency_replayedbooleanWhether this response replays a stored result for the supplied Idempotency-Key.
trace_idstringTrace identifier to include when contacting Flint about this request.
warningsarray of objectConditions that need attention even though the request succeeded.
request_idstringRequiredIdentifier of this API request, used to correlate logs and support requests.
curl -X POST https://api.withflintpay.com/v1/subscription-plans \
-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,
"currency": "USD",
"line_items": [
{
"quantity": 1,
"type": "variant",
"variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
}
],
"metadata": {
"segment": "gold"
},
"name": "Monthly Membership"
}'Get subscription plan#
/v1/subscription-plans/{subscription_plan_id}Requires scope commerce.subscription_plans.read or commerce.subscription_plans.write
Rate limit: read
Returns a single subscription plan by ID.
Path parameters
subscription_plan_idstringRequiredFlint subscription plan ID. Must be a valid ID with prefix plan_. Malformed IDs return 400 INVALID_REQUEST with detail INVALID_VALUE; well-formed IDs that do not exist return 404 RESOURCE_NOT_FOUND.
curl https://api.withflintpay.com/v1/subscription-plans/plan_01KEZF7C004CY5ZR33XST2AASV \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"The requested subscription plan.
{
"data": {
"billing_interval": "monthly",
"billing_interval_count": 1,
"billing_interval_options": [
{
"billing_interval": "monthly",
"billing_interval_count": 1
}
],
"created_at": "2026-03-17T14:30:00Z",
"currency": "USD",
"delivery_interval": null,
"delivery_interval_count": null,
"delivery_method_subscription_counts": [],
"delivery_required": false,
"end_after": null,
"gifts_enabled": false,
"images": [],
"line_items": [
{
"allow_quantity_adjustment": false,
"name": "Membership",
"product_id": "prod_01KEZF7C00027JTCXQ7TQF86X8",
"quantity": 1,
"subscription_plan_line_item_id": "spli_01KEZF7C00CEPTZ7FN2H9F4SF9",
"swap_variant_ids": [],
"swap_variants": [],
"type": "variant",
"unit_price_money": {
"amount": 2500,
"currency": "USD"
},
"variant_id": "var_01KEZF7C00SDPKNHP9DAVYBQZ9"
}
],
"merchant_id": "mer_01KEZF7C00MPP0T9S0KH5BB4CC",
"metadata": {
"segment": "gold"
},
"name": "Monthly Membership",
"plan_change_options": [],
"status": "active",
"subscription_delivery_method_ids": [],
"subscription_plan_id": "plan_01KEZF7C00S177Q3KK6BKXGXV7",
"updated_at": "2026-03-17T14:30:00Z",
"version": 1
},
"meta": {
"api_version": "2026-09-07"
},
"request_id": "req_01KWM6D3SHRH9725P5F6AC5YEG"
}Update subscription plan#
/v1/subscription-plans/{subscription_plan_id}IdempotentRequires scope commerce.subscription_plans.write
Rate limit: write
Applies a sparse update to mutable subscription plan fields. Setting status to inactive returns RESOURCE_IN_USE while active payment links use the plan. Open checkout sessions do not block this change; buyers in those sessions are refused with ACTION_NOT_ALLOWED when they pay. Send line_items with expected_version to replace the plan's line items; omit line_items to keep them.
Path parameters
subscription_plan_idstringRequiredFlint subscription plan ID. Must be a valid ID with prefix plan_. 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_intervalenumNew unit of the plan's default billing period. Omit to keep it. A plan with its own `billing_interval_options` must list the new default pair among them, so send options that include it unless they already do. Existing subscriptions keep the interval they already bill on.
dailyweeklymonthlyyearly
billing_interval_countintegerNew number of `billing_interval` units between charges on the plan's default pair, up to 365. Omit to keep it. The same rule about `billing_interval_options` applies.
billing_interval_optionsarray of objectOmission leaves the choices unchanged. Send [] to reset to the plan's default billing interval and count. Null is invalid. Prices of lines that ship are per delivery. Each option charges for all deliveries in its period. Use separate plans or promotions for different prices per interval.
billing_intervalenumRequiredUnit of the billing period. Together with billing_interval_count it sets the period one charge covers.
dailyweeklymonthlyyearly
billing_interval_countintegerRequiredNumber of interval units per billing period, from 1 to 365. It doesn't change the price of one delivery. With a delivery cadence, it changes how many deliveries one charge covers; without one, it doesn't change the charge.
contract_term_monthsintegerA commitment period you agree with the buyer, 1 to 120 months. Flint shows it at checkout and records it on each new subscription (contract_start_at, contract_end_at). Flint does not stop the buyer from canceling earlier.
delivery_intervalenum or nullDelivery cadence, set together with delivery_interval_count. Null when no separate delivery cadence is set; one delivery is made per billing period. Each billing option must be a whole multiple in the same unit family (days/weeks or months/years), with 1 to 24 deliveries per period. Existing subscriptions keep their frozen cadence. Omit both fields on PATCH to keep the cadence; send both as null to clear it.
dailyweeklymonthlyyearlynull
delivery_interval_countinteger or nullPositive number of delivery intervals between deliveries. Set or clear together with delivery_interval. Null when no separate delivery cadence is set; one delivery is made per billing period.
descriptionstring or nullOmission leaves this field unchanged. Null clears it.
early_termination_fee_moneyobjectA fee you agree the buyer owes for canceling before the contract term ends. Flint shows it at checkout and records it on each new subscription, but never charges it. To collect it, charge the buyer yourself, for example with an order on their saved payment method. Requires contract_term_months.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredThree-letter uppercase ISO 4217 currency code for this amount, such as USD.
end_afterobject or nullDefault automatic end for new subscriptions. Counts charged billing cycles, from 1 to 1200. Send null for no automatic end. Existing subscriptions keep their recorded condition. Null when no default automatic end is set.
cycle_countintegerRequiredTotal charged billing cycles, including imported completed cycles.
typeenumRequiredHow this automatic end is measured.
cycles
expected_versionintegerResource version last read by the caller. Required when replacing an owned collection. Required when any of these fields is present: images, line_items, plan_change_options.
external_reference_idstring or nullCaller-owned identifier for this resource in an external system. Omission leaves this field unchanged. Null clears it.
gifts_enabledbooleanWhether checkout buyers can name a gift recipient. Checkout sessions that are already open keep the setting they were created with.
imagesarray of one ofThe complete desired gallery in display order. The first image is primary. Send [] to clear the gallery.
Send exactly one of these
The `Source URL` variant of `ImageInput`.
altstringAlternative text describing the image for accessibility.
source_referencestringAn opaque reference for this attachment, unique within its gallery. Whitespace and case are preserved.
source_urlstringRequiredA public image URL for Flint to fetch, or an untransformed canonical image.url returned by Flint. Send exactly one of source_url or file_id. Canonical Flint URLs attach without another fetch. Flint doesn't download a source_url again while the image it produced is still in this field.
inventory_routing_sourceone ofReplaces the plan's routing source. Subscriptions and payment links that already exist keep the source they copied. It can't be cleared.
Send exactly one of these
The `fixed_location` variant of `InventoryRoutingSourceInput`.
location_idstringRequiredID of the fixed Location that serves all demand.
typeenumRequiredHow Flint routes demand to Locations.
fixed_location
line_itemsarray of one ofReplaces all owned plan line items atomically. Requires expected_version. Omission leaves items unchanged; an empty array or null is invalid. Include subscription_plan_line_item_id to retain an item; omit it for a new server-generated ID. Omitted members are removed. Existing subscriptions keep their snapshots. Retained catalog items with the same source keep their catalog snapshot; omitted modifiers keep their recorded choices.
Send exactly one of these
The `variant` variant of `UpdateSubscriptionPlanLineItemInput`.
allow_quantity_adjustmentbooleanWhether buyers may adjust this line quantity. Defaults to false. At most one line per plan may allow adjustment.
max_quantityintegerMaximum buyer quantity. Defaults to 9999. Merchants may set any line quantity from 1 to 9999. Whole-number quantity; fractional quantities are not supported.
min_quantityintegerMinimum buyer quantity. Defaults to 1. The bounds must enclose the plan line quantity. Whole-number quantity; fractional quantities are not supported.
modifiersarray of one ofModifiers for a variant or bundle line. On a new line, omit to apply the catalog item's default modifiers. On a retained line with the same variant or bundle, omit to keep its recorded choices. Changing `variant_id` or `bundle_id` requires `modifiers`. Not allowed on a custom line, and `null` is rejected.
quantityintegerWhole-number quantity; fractional quantities are not supported. Omission uses 1.
subscription_plan_line_item_idstringID of an existing item on this plan to retain. Omit for a new item. Duplicate IDs and IDs from other plans are rejected.
swap_variant_idsarray of stringVariants a subscriber can swap this line to. Only for a variant line. At most 25, with no repeats, none equal to the line's own variant, and all from the same product. On a retained line with the same variant, omit to keep its current choices.
typeenumRequiredThe kind of line to keep or add. It must match the other fields: `variant` needs `variant_id`, `bundle` needs `bundle_id`, and `custom` needs `name` and `unit_price_money`.
variant
variant_idstringRequiredID of the catalog variant to sell on this line. Send it with `type` variant and without `bundle_id`, `name`, `unit_price_money`, `description`, or `tax`: Flint takes those from the variant. Changing it on a retained line needs `modifiers`.
metadatamap of string or nullCaller-owned metadata. Omit this field to leave metadata unchanged. Send an object to merge by key, set a key to null to remove it, or set metadata to null to clear all caller-owned metadata. An empty object makes no change. 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. This operation also limits the metadata object you send, before merging: at most 50 keys, counting null deletions, each key 1 to 256 Unicode code points, and at most 32768 UTF-8 bytes of keys plus values.
namestringNew name of the plan. Omit to keep it. Can't be empty. Surrounding whitespace is trimmed before length validation. A supplied value cannot be blank; use null where clearing is supported.
plan_change_optionsarray of objectPlans subscribers may switch to, in display order, with the billing timing for each target. Empty means plan changes are off. Omission on PATCH keeps the options; an array replaces them and requires expected_version. Send [] to clear. Null is invalid.
billing_startsenumRequiredThe store's billing timing for this target: now collects a new period with unused-time credit; next_renewal changes the plan now and keeps the current paid period and next billing date; period_end keeps the current plan until the next charged renewal; prorated_now charges the difference for the rest of the current period and keeps the period and anchor. Neither plan may require delivery when billing_starts is prorated_now.
nownext_renewalperiod_endprorated_now
subscription_plan_idstringRequiredThe target subscription plan offered for buyer plan changes.
setup_fee_moneyobjectNew one-time fee charged with the first payment of a new subscription, except one that continues an imported paid period. Must be above zero and in the plan's currency. Omit to keep it; send `null` to remove it.
amountintegerRequiredAmount in the currency's minor unit, such as cents for USD.
currencystringRequiredThree-letter uppercase ISO 4217 currency code for this amount, such as USD.
statusenumActive plans accept new signups. Inactive plans refuse new signups with ACTION_NOT_ALLOWED while existing subscriptions keep renewing. Archived plans are read-only and their status is set only by DELETE /v1/subscription-plans/{subscription_plan_id}.
activeinactive
subscription_delivery_method_idsarray of stringOmission leaves the delivery methods unchanged. Send [] to remove all delivery methods. Null is invalid.
trial_period_daysintegerDays of free trial before the first charge, from 0 to 365; 0 means no trial. Send 0 to remove the trial. Not allowed on plans with lines that ship.
curl -X PATCH https://api.withflintpay.com/v1/subscription-plans/plan_01KEZF7C004CY5ZR33XST2AASV \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: a-unique-key" \
-d '{
"description": "Updated recurring membership plan",
"metadata": {
"segment": "vip"
}
}'Archive a subscription plan#
/v1/subscription-plans/{subscription_plan_id}IdempotentRequires scope commerce.subscription_plans.write
Rate limit: write
Permanently archives a subscription plan from active or inactive status. Returns RESOURCE_IN_USE while active subscriptions, active payment links, or open checkout sessions reference the plan. To stop selling a plan while keeping its subscribers, set status to inactive.
Path parameters
subscription_plan_idstringRequiredFlint subscription plan ID. Must be a valid ID with prefix plan_. 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_versionintegerOptional subscription plan version last read by the caller.
curl -X DELETE https://api.withflintpay.com/v1/subscription-plans/plan_01KEZF7C004CY5ZR33XST2AASV \
-H "Flint-Version: 2026-09-07" \
-H "Authorization: Bearer YOUR_API_KEY"Was this helpful?