Cancel OTC Deal
Cancels one of the user's own open OTC offers. The offer is named by its deal_id in the path (take it from List User OTC Offers); there is no request body. The cancel is signed by the wallet recorded on the offer, so no wallet_id is sent.
The call is asynchronous: it records a user transaction (type = 7, cancel OTC offer) and answers with its transaction_id. Poll Get User Transaction until status is 3 (done) or 4 (error); the offer is canceled only after 3.
Only an open offer of this user can be canceled. An offer of another user, one that is not open, or one that names no wallet is answered as not found.
Required permission: otc:trade
Request
POST /v2/users/{user_id}/otcs/tokens/{token_id}/deals/{deal_id}/cancel
Parameters
| Name | Type | In | Description |
|---|---|---|---|
user_id | string | path | Required. Seller's user ID |
token_id | string | path | Required. Token ID |
deal_id | integer | path | Required. Deal ID of the offer to cancel |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Example
curl --request POST \
--url '{{baseUrl}}/v2/users/680c02896d91ca0145cfeb81/otcs/tokens/68ae06cfcccf4e8fc19362d1/deals/12/cancel' \
--header 'Authorization: Bearer <access_token>'
Response
{
"transaction_id": "6913872755654191dede37da"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | User transaction that cancels the offer. Poll it with Get User Transaction |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | deal_id is missing or not a positive integer — see details |
| 400 | 10016 | token_id is not a valid 24-character hex id |
| 400 | 10001 | Token not found (domain 5) |
| 400 | 11001 | Domain 11: no such offer for this user on this token, the offer is not open, or it names no wallet |
| 500 | 10000 | Unexpected server-side failure |
See Errors for the error format and common codes.