curl --request POST 'https://tumipay-card-payments.uat.topup.com.co/production/api/subscription/card/cancel' \
--header 'Token-Top: your_auth_token' \
--header 'Authorization: Basic your_auth_key' \
--header 'X-Merchant-ID: your_merchant_id' \
--header 'X-Request-ID: your-request-id' \
--header 'Content-Type: application/json' \
--data-raw '{
"subscription_id": "sub_93af8f63-97d1-4be0-9e0d-f6fd8c2d92a0"
}'
{
"code": "SUCCESS",
"status": true,
"message": "Suscripción cancelada exitosamente",
"data": {
"subscription_id": "550e8400-e29b-41d4-a716-446655440000",
"cancellation_date": "2025-12-23T10:30:45.123Z"
}
}
{
"code": "ALREADY_CANCELLED",
"status": true,
"message": "La suscripción ya estaba cancelada",
"data": {
"subscription_id": "550e8400-e29b-41d4-a716-446655440000",
"cancellation_date": "2025-12-23T10:30:45.123Z"
}
}
{
"code": "VALIDATION_ERROR",
"status": false,
"message": "subscription_id is required."
}
{
"message": "Missing required header: X-Merchant-ID"
}
{
"message": "Missing required header: X-Request-ID"
}
{
"code": "UNAUTHORIZED",
"status": false,
"message": "Unauthorized."
}
{
"code": "NOT_FOUND",
"status": false,
"message": "No se pudo localizar la suscripción solicitada con UUID: 550e8400-e29b-41d4-a716-446655440000"
}
{
"code": "INVALID_STATE",
"status": false,
"message": "Esta operación de suscripción no se puede realizar. Estado actual: FAILED"
}
{
"code": "SERVICE_ERROR",
"status": false,
"message": "Ocurrió un error inesperado"
}
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.
curl --request POST 'https://tumipay-card-payments.uat.topup.com.co/production/api/subscription/card/cancel' \
--header 'Token-Top: your_auth_token' \
--header 'Authorization: Basic your_auth_key' \
--header 'X-Merchant-ID: your_merchant_id' \
--header 'X-Request-ID: your-request-id' \
--header 'Content-Type: application/json' \
--data-raw '{
"subscription_id": "sub_93af8f63-97d1-4be0-9e0d-f6fd8c2d92a0"
}'
{
"code": "SUCCESS",
"status": true,
"message": "Suscripción cancelada exitosamente",
"data": {
"subscription_id": "550e8400-e29b-41d4-a716-446655440000",
"cancellation_date": "2025-12-23T10:30:45.123Z"
}
}
{
"code": "ALREADY_CANCELLED",
"status": true,
"message": "La suscripción ya estaba cancelada",
"data": {
"subscription_id": "550e8400-e29b-41d4-a716-446655440000",
"cancellation_date": "2025-12-23T10:30:45.123Z"
}
}
{
"code": "VALIDATION_ERROR",
"status": false,
"message": "subscription_id is required."
}
{
"message": "Missing required header: X-Merchant-ID"
}
{
"message": "Missing required header: X-Request-ID"
}
{
"code": "UNAUTHORIZED",
"status": false,
"message": "Unauthorized."
}
{
"code": "NOT_FOUND",
"status": false,
"message": "No se pudo localizar la suscripción solicitada con UUID: 550e8400-e29b-41d4-a716-446655440000"
}
{
"code": "INVALID_STATE",
"status": false,
"message": "Esta operación de suscripción no se puede realizar. Estado actual: FAILED"
}
{
"code": "SERVICE_ERROR",
"status": false,
"message": "Ocurrió un error inesperado"
}
ALREADY_CANCELLED status without generating an error.
curl --request POST 'https://tumipay-card-payments.uat.topup.com.co/production/api/subscription/card/cancel' \
--header 'Token-Top: your_auth_token' \
--header 'Authorization: Basic your_auth_key' \
--header 'X-Merchant-ID: your_merchant_id' \
--header 'X-Request-ID: your-request-id' \
--header 'Content-Type: application/json' \
--data-raw '{
"subscription_id": "sub_93af8f63-97d1-4be0-9e0d-f6fd8c2d92a0"
}'
{
"code": "SUCCESS",
"status": true,
"message": "Suscripción cancelada exitosamente",
"data": {
"subscription_id": "550e8400-e29b-41d4-a716-446655440000",
"cancellation_date": "2025-12-23T10:30:45.123Z"
}
}
{
"code": "ALREADY_CANCELLED",
"status": true,
"message": "La suscripción ya estaba cancelada",
"data": {
"subscription_id": "550e8400-e29b-41d4-a716-446655440000",
"cancellation_date": "2025-12-23T10:30:45.123Z"
}
}
{
"code": "VALIDATION_ERROR",
"status": false,
"message": "subscription_id is required."
}
{
"message": "Missing required header: X-Merchant-ID"
}
{
"message": "Missing required header: X-Request-ID"
}
{
"code": "UNAUTHORIZED",
"status": false,
"message": "Unauthorized."
}
{
"code": "NOT_FOUND",
"status": false,
"message": "No se pudo localizar la suscripción solicitada con UUID: 550e8400-e29b-41d4-a716-446655440000"
}
{
"code": "INVALID_STATE",
"status": false,
"message": "Esta operación de suscripción no se puede realizar. Estado actual: FAILED"
}
{
"code": "SERVICE_ERROR",
"status": false,
"message": "Ocurrió un error inesperado"
}
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"
Show child attributes
Show child attributes