POST Cancel Subscription
Cancels a subscription given its identifier. The operation is idempotent: if the subscription is already cancelled, the system returns the ALREADY_CANCELLED status.
ALREADY_CANCELLED status without generating an error.
Required Headers
Request Body Parameters
Validation Rules
Required Fields
| Field | Type | Rules | Description |
|---|---|---|---|
subscription_id | string | required, max:36 | UUID of the subscription to cancel |
Common Validation Error Messages
The following are common validation error messages returned by the API (in Spanish)::attribute es obligatorio.- Required field missing:attribute debe ser una cadena de texto.- Invalid data type (expected string):attribute no puede tener más de :max caracteres.- Maximum length exceeded:attribute no es válido.- Invalid value
Response Fields
Success Response (200 OK)
"SUCCESS": Subscription cancelled successfully"ALREADY_CANCELLED": The subscription was already cancelled (idempotent operation)
true when successful (even if already cancelled)HTTP Status Codes
| Status Code | Description | Response Body |
|---|---|---|
200 OK | Successful operation (cancelled or already cancelled) | status: true, code: "SUCCESS" or "ALREADY_CANCELLED" |
400 Bad Request | Missing required header (X-Merchant-ID or X-Request-ID) | Simple error message |
401 Unauthorized | Authentication failed (invalid Token-Top or Authorization) | code: "UNAUTHORIZED" |
404 Not Found | Subscription not found | code: "NOT_FOUND" |
409 Conflict | Invalid state (subscription cannot be cancelled) | code: "INVALID_STATE" |
422 Unprocessable Entity | Validation error in request data | code: "VALIDATION_ERROR" |
500 Internal Server Error | Internal server error | code: "SERVICE_ERROR" |
Response Codes
| Code | Description |
|---|---|
SUCCESS | Subscription cancelled successfully |
ALREADY_CANCELLED | The subscription was already cancelled (idempotency) |
VALIDATION_ERROR | Validation error in sent data |
UNAUTHORIZED | Authentication error |
NOT_FOUND | Subscription not found |
INVALID_STATE | The subscription cannot be cancelled due to its current state |
SERVICE_ERROR | Internal server error |
Headers
Unique identifier of the Merchant invoking Card Payment services. Should not be used to authenticate end users.
Tracking identifier associated with the request, used to establish a correlation_id between ecosystem components.
Token for authentication.
Basic authentication.
Body
"sub_93af8f63-97d1-4be0-9e0d-f6fd8c2d92a0"
Response
Subscription cancelled successfully or was already cancelled (idempotency). Check 'code' field to distinguish between 'SUCCESS' and 'ALREADY_CANCELLED'.
Response to the cancellation process. The 'status' field is always true (even for ALREADY_CANCELLED) due to idempotency.
Response code. Values: 'SUCCESS' (cancelled successfully), 'ALREADY_CANCELLED' (was already cancelled)
SUCCESS, ALREADY_CANCELLED "SUCCESS"
Operation status. Always true for successful responses (even if already cancelled)
true
Descriptive message about the cancellation result
"Suscripción cancelada exitosamente"