Cancel a Cancellation Request
API data
API Gateway
This API is used for payment gateway operations:
- Production: https://api.sopague.com.br/gateway
- Sandbox: https://api-hmg.sopague.com.br/gateway
- Architecture: Representational State Transfer (REST)
Cancel a pending cancellation request
Used to cancel a cancellation request that is in PENDENTE status. After cancellation, the request will no longer be processed.
POST /v1/refund/cancel
Data dictionary - Request body
| FIELD | DESCRIPTION | TYPE | SIZE | NOTES |
|---|---|---|---|---|
| Id | Unique identifier of the cancellation request | guid | - | Required. |
- 🟢 200 - OK
- 🔴 400 - Not Found
- 🔴 400 - Invalid Status
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"status": "CANCELADO",
"message": "Status alterado para CANCELADO com sucesso",
"lastModifiedOn": "2024-11-12T14:30:00"
}
{
"error": "Pedido de cancelamento não encontrado"
}
{
"error": "Não é possível cancelar. Status atual: 'APROVADO'. Apenas pedidos com status 'PENDENTE' podem ser cancelados."
}
Data dictionary - Response
| FIELD | DESCRIPTION | TYPE | NOTES |
|---|---|---|---|
| id | Unique identifier of the request | guid | - |
| status | New request status | string | - |
| message | Confirmation message | string | - |
| lastModifiedOn | Date and time of last modification | datetime | - |
Cancellation rules
- Only requests with PENDENTE status can be canceled
- Once canceled, the request cannot be reverted
Status flow
A cancellation request can have the following statuses:
- PENDENTE: Waiting to be processed
- CANCELADO: Canceled by the user (via this API)
- APROVADO: Processed and approved by the team
- REJEITADO: Processed and rejected by the team
This API can only change requests from PENDENTE to CANCELADO.