Skip to main content

Cancel subscription

METHODURL
POST/subscriptions/{subscriptionId}/cancel
EXAMPLEhttps://test.api.revuppayments.com/v2/subscriptions/{subscriptionId}/cancel

Endpoint to cancel a subscription.

Request body example - Cancel subscription​

{
"cancellationDetail”: "Testing cancellation"
}

Success responses - Cancel subscription payments​

HTTP CODEDESCRIPTION
200Subscription has been cancelled and the response is in the body in JSON format.

Success response example - Cancel subscription​

{
"id": "0195146b-fb77-73b4-bb92-ba8bc2180433",
"planId": "4aa7c1e4-cf8c-4d1c-a6ad-451dd07411ee",
"status": "cancelled",
"cycle": 1,
"cancellation": {
"reason": "merchant_api",
"detail": "Testing cancellation",
"requestedAt": "2025-02-17T15:07:14.095549Z"
},
"createdAt": "2025-02-17T15:00:12.491953Z",
"modifiedAt": "2025-02-17T15:07:14.095555Z"
}

Error responses - Cancel subscription​

HTTP CODEERROR CODEERROR MESSAGEDESCRIPTION
5000900Internal Server ErrorThe server experienced an unexpected error.
4040020Subscription not foundSubscription %s not found

Bulk cancel subscriptions​

METHODURL
POST/subscriptions/bulk/cancel
EXAMPLEhttps://test.api.revuppayments.com/v2/subscriptions/bulk/cancel

Queues a cancel command for every subscription in the request. The endpoint validates the request, publishes one command per subscription and answers 202 Accepted: no cancellation logic runs synchronously, so 202 means the request was queued, never that it was completed.

curl --location 'https://test.api.revuppayments.com/v2/subscriptions/bulk/cancel' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {X_API_KEY}' \
--data '{
"subscriptions": [
"0195146b-fb77-73b4-bb92-ba8bc2180433",
"0195146c-1a2b-73b4-bb92-ba8bc2180999"
],
"cancellationDetail": "Customer request"
}'

Headers

NameDescriptionRequired
X_API_KEYMerchant API key. The merchant is resolved from this key; it is never sent in the path or body.YES
Content-TypeMust be application/json.YES

Body

NameDescriptionRequired
subscriptionsArray of subscription IDs (UUID) to cancel. Must contain at least 1 and at most 3000 identifiers. Every identifier must be a valid UUID.YES
cancellationDetailShort description about the cancellation reason, applied to every subscription in the request. Max 25 characters; only letters, digits and spaces.NO

Example Response — 202 Accepted

{
"requestId": "0195146b-fb77-73b4-bb92-ba8bc2180433",
"operation": "CANCEL",
"acceptedCount": 2
}
FieldDescription
requestIdCorrelation identifier shared by every command published for this request. Use it to trace the operation in the logs. It is not a bulk-job identifier and cannot be queried.
operationThe requested operation: CANCEL.
acceptedCountNumber of subscription commands successfully queued.
warning

Cancellation is irreversible: double-check the identifiers before sending the request.

Notes

  • The whole request is validated before anything is queued: a rejected request (400, 401, 422) dispatches nothing.
  • On 503, part of the commands may already be queued and will be processed. Because processing is idempotent, retrying the same request is safe.
  • Subscriptions that are already cancelled, archived, abandoned or that do not belong to the merchant are skipped without error; the 202 response does not report them individually.
  • Results are not returned synchronously and there is no status endpoint for a bulk request: check the individual subscriptions with GET /subscriptions/{subscriptionId}.