Skip to main content
POST

Authorizations

X-API-KEY
string
header
required

Your secret API key obtained from the Clink dashboard (Developers section)

Headers

X-Timestamp
string
required

Current timestamp in milliseconds since Unix epoch (required for request signing)

Example:

"1783513683000"

Path Parameters

id
string
required

Unique identifier of the subscription

Body

application/json

Subscription update confirmation request

Parameters required to confirm a subscription upgrade or downgrade. Use the same quantity, promotionCode, and billing options as the preview request; priceSnapshotId does not preserve these options.

priceSnapshotId
string
required

Target price snapshot ID returned by the preview API.

quantity
integer
default:1

Number of units for the target price. Optional; defaults to 1 when omitted. null and values below 1 are invalid.

Required range: x >= 1
promotionCode
string

Promotion code to apply to the updated subscription.

immediate
boolean | null

Whether to force the update to take effect immediately. true requests an immediate update; false schedules it for the end of the current billing or trial period. Omitted or null lets the system decide. Explicit true requires both current and target prices to use flat_rate pricing. Outside a free trial, the target full-cycle amount (unit amount multiplied by quantity) must be greater than the current full-cycle amount; immediate downgrades and equal-amount changes are rejected.

Example:

true

billingCycleAnchor
enum<string> | null

Billing cycle anchor for an immediate update. A non-null value requires immediate=true. now starts a new full billing cycle at the update time; unchanged preserves the current period end. Outside a free trial, omitted or null uses unchanged. For an immediate free-trial update, omit this field if the target still has trial time remaining; when switching directly to paid billing, only now or omitted/null is allowed, and now is used.

Available options:
now,
unchanged,
null
Example:

"now"

prorationBehavior
enum<string> | null

Proration policy for an immediate update. A non-null value requires immediate=true. always_invoice credits the unused portion of the current plan and charges the target plan for the remaining period with unchanged, or a full cycle with now. none gives no credit for the current plan and charges the target plan's full-cycle amount with either anchor; it does not waive payment. Discounts and tax are applied afterward. Outside a free trial, omitted or null uses always_invoice. For an immediate free-trial update, omit this field if the target still has trial time remaining; when switching directly to paid billing, only none or omitted/null is allowed, and none is used.

Available options:
always_invoice,
none,
null
Example:

"always_invoice"

Response

Subscription update confirmed successfully

code
integer<int32>

Response status code, 200 when success

Example:

200

msg
string

Brief description of what happened, 'success' when happy case

Example:

"success"

data
object

Result returned after confirming a subscription update.