Cancel Order
https://userapi.sepay.vn/v2/bank-accounts/{ba_xid}/orders/{order_xid}Only orders with Pending status can be cancelled. On cancel, the system also moves every Unpaid VA of the order to Cancelled.
Path Parameters
Bank account UUID
Order UUID
Code Examples
curl --request DELETE \--url https://userapi.sepay.vn/v2/bank-accounts/f9e8d7c6-b5a4-3210-fedc-ba0987654321/orders/b2c3d4e5-f6a7-8901-bcde-f12345678902 \--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
Response (HTTP 204)
Empty body.
Cancellation rules by bank
| Behavior | BIDV | Sacombank | Vietcombank | VietinBank | Shinhan Bank |
|---|---|---|---|---|---|
Cancel order and Unpaid VAs | Yes | Yes | Yes | Yes | Yes |
| May refuse to cancel | No | No | Yes: 403 vcb_cancel_not_allowed, 500 vcb_cancel_error, or 503 vcb_connection_error | No | Yes: 500 shinhan_cancel_error or 503 shinhan_connection_error |
A Vietcombank order may not be cancellable if the invoice is already paid or cancelled on the Vietcombank side. See the error table below.
SePay cancels every Unpaid VA of the order at the bank first, then closes the order. Those VA numbers therefore stop accepting money the moment you get a successful response. If the bank refuses the cancellation, the order stays Pending and you can retry, because repeating the cancellation has no side effect.
Errors
| HTTP | error_code | Description |
|---|---|---|
| 403 | vcb_cancel_not_allowed | Vietcombank: invoice is already paid or cancelled, can no longer be cancelled. Contact SePay if you need help. |
| 422 | invalid_state | Order status does not allow cancellation (only Pending orders can be cancelled) |
| 500 | vcb_cancel_error | Vietcombank: unexpected error while cancelling. Contact SePay support. |
| 503 | vcb_connection_error | Vietcombank: service temporarily disrupted. Please try again in a few minutes. |