Cancel subscription
| METHOD | URL |
|---|---|
| POST | /subscriptions/{subscriptionId}/cancel |
| EXAMPLE | https://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 CODE | DESCRIPTION |
|---|---|
| 200 | Subscription 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 CODE | ERROR CODE | ERROR MESSAGE | DESCRIPTION |
|---|---|---|---|
| 500 | 0900 | Internal Server Error | The server experienced an unexpected error. |
| 404 | 0020 | Subscription not found | Subscription %s not found |
Bulk cancel subscriptions
| METHOD | URL |
|---|---|
| POST | /subscriptions/bulk/cancel |
| EXAMPLE | https://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
| Name | Description | Required |
|---|---|---|
| X_API_KEY | Merchant API key. The merchant is resolved from this key; it is never sent in the path or body. | YES |
| Content-Type | Must be application/json. | YES |
Body
| Name | Description | Required |
|---|---|---|
| subscriptions | Array of subscription IDs (UUID) to cancel. Must contain at least 1 and at most 3000 identifiers. Every identifier must be a valid UUID. | YES |
| cancellationDetail | Short 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
}
| Field | Description |
|---|---|
| requestId | Correlation 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. |
| operation | The requested operation: CANCEL. |
| acceptedCount | Number 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
202response 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}.