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

FieldData TypeRequiredDescription
actionenumYesAction to perform. Values: activate, cancel, cancel_at_period_end.

Actions

ActionBehavior
activateReactivates the subscription, sets status to ACTIVE, clears pastDueAt, and schedules renewal.
cancelCancels the subscription immediately, sets status to CANCELLED, sets isActive to false, and stops future renewals.
cancel_at_period_endKeeps 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

FieldData typeDescription
subscriptionIdOrCodestring.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 = CANCELLED
  • isActive = false
  • The customer should lose access immediately.

Cancellation at Period End

  • status = NON_RENEWING
  • isActive = true
  • The customer may keep access until currentPeriodEnd, but the subscription will not renew.

Activation

  • status = ACTIVE
  • isActive = true
  • The subscription becomes eligible for future renewals again.

Webhook Events

ActionEvent
activatesubscription.active
cancelsubscription.cancelled
cancel_at_period_endsubscription.not_renewing

Error Responses

HTTP StatusError CodeDescription
400VALIDATION_ERRORInvalid request body.
401UNAUTHORIZEDInvalid or missing API key.
422UNPROCESSABLE_ENTITYInvalid subscription ID or code.
422UNPROCESSABLE_ENTITYUnsupported action.