Skip to main content

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​

NameTypeInDescription
user_idstringpathRequired. Seller's user ID
token_idstringpathRequired. Token ID
deal_idintegerpathRequired. Deal ID of the offer to cancel

Headers​

NameDescription
AuthorizationRequired. 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​

FieldTypeDescription
transaction_idstringUser transaction that cancels the offer. Poll it with Get User Transaction

Errors​

StatusCodeDescription
40010015deal_id is missing or not a positive integer — see details
40010016token_id is not a valid 24-character hex id
40010001Token not found (domain 5)
40011001Domain 11: no such offer for this user on this token, the offer is not open, or it names no wallet
50010000Unexpected server-side failure

See Errors for the error format and common codes.