Skip to main content
POST
billing.subscription.update

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

Your subscription record ID.

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

Change the subscription state or plan (action form).

Available options:
pause,
activate,
change_plan
planId
string

Your replacement plan ID; required for change_plan.

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9_-]+$
nextScheduledAt
string<date-time>

Next charge time; required for activate.

Pattern: ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
customerId
string

Customer who owns the subscription (terms form).

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9_-]+$
amount
object

New recurring charge in minor units of an explicit currency (terms form).

interval
enum<string>

Unit between charges.

Available options:
day,
week,
month,
year
intervalCount
number
Required range: 1 <= x <= 365
description
string

New payment description (terms form).

Required string length: 1 - 255
times
number

New charge count (terms form).

Required range: 1 <= x <= 10000
startDate
string

New start date, YYYY-MM-DD (terms form).

Required string length: 1 - 10
Pattern: ^\d{4}-\d{2}-\d{2}$
mandateId
string

New authorization owned by the same customer (terms form).

Required string length: 1 - 128
Pattern: ^[A-Za-z0-9_-]+$
metadata
object

Optional business labels stored in your payment account; do not include secrets.

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.