Cancel Payment
Cancels a payment in PENDING status.
Endpoint
POST /v1/payments/{id}/cancel
Request Example
curl -X POST https://api.bopay.io/v1/payments/550e8400-e29b-41d4-a716-446655440000/cancel \
-H "X-Identity: your-api-key" \
-H "X-Signature: your-signature"
Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"ext_id": "order_12345",
"amount": 5000,
"currency": "RUB",
"status": "CANCELLED",
"method": "SBP",
"requisites": {
"type": "sbp",
"value": "+79001234567",
"bank": "sberbank",
"holder": "Ivan I."
},
"payment_url": null,
"valid_until": "2026-01-30T12:30:00Z",
"created_at": "2026-01-30T12:15:00Z"
}
Restrictions
- Only payments in
PENDINGstatus can be cancelled - Cancelled payments cannot be restored
Errors
| Code | HTTP | Description |
|---|---|---|
PAY_006 | 404 | Payment not found |
PAY_007 | 400 | Payment cannot be cancelled (status is not PENDING) |