Skip to main content
POST
billing.subscription.cancel

Authorizations

Authorization
string
header
required

API key: sk_live_…

Headers

Idempotency-Key
string
required

Required: this capability has an external effect.

Maximum string length: 255
Pramaan-Account
string

Optional. One of your account ids (GET /v1/accounts): run on that account, whatever your routing rules say. The response header X-Pramaan-Account names the account that ran.

Pramaan-End-User
string

Optional. Your own tag for your end user: a sticky: end_user rule keeps them on the account that first served them.

Maximum string length: 256
Pramaan-End-User-Group
string

Optional. Your end user's group, matched by rules with endUserGroup.

Maximum string length: 64

Body

application/json
subscriptionId
string
required

The subscription to cancel, as returned by billing.subscriptions.list.

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9_-]+$
when
enum<string> | null

"period_end" keeps it active until the paid period ends; "now" ends it immediately. A canceled subscription cannot be reinstated. Default "period_end".

Available options:
period_end,
now

Response

The result

subscriptionId
string
required

The subscription's id.

status
enum<string>
required

Subscription state. Never "active" unless the billing account said so; anything unrecognized is "unknown".

Available options:
active,
trialing,
past_due,
paused,
canceled,
expired,
pending,
failed,
unknown
customerId
string

The customer it belongs to.

recurringAmount
object

Charge per billing period, before tax.

interval
enum<string>

Billing period unit.

Available options:
day,
week,
month,
year
intervalCount
number

Number of intervals between charges.

quantity
number

Units subscribed to.

cancelAtPeriodEnd
boolean

True when the subscription ends at the end of the current period.

currentPeriodEnd
string

End of the current paid period, ISO 8601.

nextBillingAt
string

Next charge time, ISO 8601.

canceledAt
string

When it was canceled, ISO 8601.

createdAt
string

When it was created, ISO 8601.