Deposits
Cancel a Deposit
POST /v1/deposits/:id/cancel — cancel a still-PENDING deposit and release the amount slot; own + same-mode only
POST /v1/deposits/:id/cancel
Cancel a still-PENDING deposit of your own (releasing the amount slot so the customer can create a new one). It works only for your own deposit and the same mode. The request body is empty; the call is HMAC-signed.
Behavior
- Success →
200returns{ "id": "...", "status": "CANCELLED" }. - If the deposit is not
PENDING(already credited/expired/cancelled) →409NOT_CANCELLABLE. - id not found / not yours / cross-mode →
404NOT_FOUND.
Example request
cURL
curl -X POST 'https://api.unkpay.co/v1/deposits/8f2b1c4e-7a90-4d2f-9b3a-1c2d3e4f5a6b/cancel' \
-H 'X-Api-Key: unk_live_xxxxxxxxxxxx' \
-H 'X-Timestamp: 1718790200' \
-H 'X-Signature: <hex hmac-sha256 over "POST\n/v1/deposits/8f2b1c4e.../cancel\n1718790200\nsha256(empty)">'
The cancel body is empty, so the canonical string's body hash is the empty-body SHA-256 constant
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. See Authentication.Example response
{ "id": "8f2b1c4e-7a90-4d2f-9b3a-1c2d3e4f5a6b", "status": "CANCELLED" }
Error codes
| HTTP | code | Cause |
|---|---|---|
| 409 | NOT_CANCELLABLE | The deposit is no longer PENDING (already credited/expired/cancelled). |
| 404 | NOT_FOUND | id not found / not yours / cross-mode. |
