Update a subscription

Pause, resume or cancel a subscription billed by the platform.

Private API key only

Call this endpoint from your server with your private API key in the x-api-key header. A public key is refused with 401 and code 111022.

Allowed changes

FromTo
started, active, past_duepaused, cancelled
pausedactive, cancelled

Any other change is refused with 400 and code 111012, in particular from created, incomplete, cancelled and completed.

Pause

The offer must allow pausing. pause_cycles rebills are skipped and the subscription resumes by itself on its resume_date. The calendar does not shift.

Resume

status: active restarts billing on the next date of the unchanged calendar. It is refused when that date would fall after the end date of the offer: the subscription stays paused.

Cancel

The subscription becomes cancelled, a final status. cancelled_by is set by the platform (api for a cancellation through this endpoint) and is never accepted in the request.

Result

The response gives the new state of the subscription. A subscription webhook is sent for the change of status. See Subscription lifecycle, Failed rebills and retries, Update the payment method.

Examples

Select a card to show its request and response in the panels on the right. "Pause for 2 billing cycles" is shown by default.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
Defaults to 6a1f3c9e8b2d4a7f1c0e5b93

Identifier of the subscription (subscription_id).

Body Params
string
enum
required
Defaults to paused

New status: paused, active (resume) or cancelled.

Allowed:
integer
1 to 60
Defaults to 2

Number of billing cycles to skip, from 1 to 60. Required to pause; only accepted with status: paused.

string
enum

Reason for the cancellation. Optional, with status: cancelled.

Allowed:
Responses

Language
Credentials
Header
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json