v1

latestOpenAPI 3.1.02026-07-24104338.0 KB
Plans

Create a subscription plan

Create a plan your subscribers can subscribe to.

post/api/v3/subscriptions/plans

Request body

namestring required
type'FIXED' | 'VARIABLE' required

How a plan's billed amount is determined. FIXED — the plan carries a fixed price; every subscription bills it. VARIABLE — the plan carries only an asset; the amount is set per subscription at creation.

assetstring

Billing asset for a VARIABLE plan (the amount is supplied per subscription). Required when type is VARIABLE; ignored for FIXED (asset is taken from price.asset).

billingInterval'MONTHLY' | 'ANNUAL' required

How often the subscription is billed.

termCyclesinteger nullable

Number of billing cycles before the subscription term ends. Unit follows billingInterval. Null or omitted means the subscription renews indefinitely.

gracePeriodstring required

ISO-8601 calendar period. Examples: P7D (7 days), P1M (1 month), P1Y (1 year). Sub-day precision is not supported.

Example request

{
  "price": {
    "amount": "29.00",
    "asset": "USD"
  },
  "asset": "USD",
  "gracePeriod": "P3D"
}

Response

Plan created.

idstring uuid required
namestring required
type'FIXED' | 'VARIABLE' required

How a plan's billed amount is determined. FIXED — the plan carries a fixed price; every subscription bills it. VARIABLE — the plan carries only an asset; the amount is set per subscription at creation.

assetstring required

The plan's billing asset. Always present (equals price.asset for FIXED plans).

billingInterval'MONTHLY' | 'ANNUAL' required

How often the subscription is billed.

termCyclesinteger nullable

Number of billing cycles in the plan's term; null means it renews indefinitely.

gracePeriodstring required

ISO-8601 calendar period. Examples: P7D (7 days), P1M (1 month), P1Y (1 year). Sub-day precision is not supported.

status'ACTIVE' | 'ARCHIVED' required

ACTIVE — open for new subscriptions. ARCHIVED — closed to new subscriptions; existing subscriptions keep billing.

createdAtinteger required

Unix epoch seconds.

updatedAtinteger required

Unix epoch seconds.

Example response

{
  "asset": "USD",
  "price": {
    "amount": "29.00",
    "asset": "USD"
  },
  "gracePeriod": "P3D",
  "createdAt": 1748513400,
  "updatedAt": 1748513400
}