Manage Subscription
Manage an existing subscription by activating it, cancelling it immediately, or scheduling it to stop renewing at the end of the current paid period.
Subscription Details
| Field | Data Type | Required | Description |
|---|---|---|---|
| action | enum | Yes | Action to perform. Values: activate, cancel, cancel_at_period_end. |
Actions
| Action | Behavior |
|---|---|
| activate | Reactivates the subscription, sets status to ACTIVE, clears pastDueAt, and schedules renewal. |
| cancel | Cancels the subscription immediately, sets status to CANCELLED, sets isActive to false, and stops future renewals. |
| cancel_at_period_end | Keeps the subscription active for the current paid period, sets status to NON_RENEWING, and prevents renewal after the period ends. |
Make a PATCH request to our subscriptions endpoint.
Note : Before making a post request, the secret key should be specified in the header.
-H "x-api-key: your_secret_key".
{{host}}/v1/subscriptions
Path Parameters
| Field | Data type | Description |
|---|---|---|
| subscriptionIdOrCode | string. | The subscription ID or code you want to manage. |
You can make API calls using this sample request. once all parameters are meet you would also get the response below;
{
"action": "cancel"
}
{
"action": "cancel_at_period_end"
}
{
"action": "activate"
}
{
"status": true,
"message": "Success",
"code": 200,
"data": {
"id": "7697cabd-ee1b-435a-9ae3-82b926cc5334",
"code": "SUB_7263269_W-dnE2xtS015ETu",
"status": "CANCELLED",
"isActive": false,
"startDate": "2026-05-01T00:00:00.000Z",
"previousPaymentDate": "2026-05-01T00:00:00.000Z",
"nextPaymentDate": "2026-06-01T00:00:00.000Z",
"cancelledAt": "2026-05-10T12:00:00.000Z",
"cancelReason": "cancel"
}
}
Access Behavior
Immediate Cancellation
status = CANCELLEDisActive = false- The customer should lose access immediately.
Cancellation at Period End
status = NON_RENEWINGisActive = true- The customer may keep access until
currentPeriodEnd, but the subscription will not renew.
Activation
status = ACTIVEisActive = true- The subscription becomes eligible for future renewals again.
Webhook Events
| Action | Event |
|---|---|
| activate | subscription.active |
| cancel | subscription.cancelled |
| cancel_at_period_end | subscription.not_renewing |
Error Responses
| HTTP Status | Error Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Invalid request body. |
| 401 | UNAUTHORIZED | Invalid or missing API key. |
| 422 | UNPROCESSABLE_ENTITY | Invalid subscription ID or code. |
| 422 | UNPROCESSABLE_ENTITY | Unsupported action. |
Updated 3 days ago
