Cancel OTC Offer
Cancels an open OTC offer on a token. The offer is addressed by its deal ID within the token; the node is read off the offer. The token's node must be inside your API key's node subtree, and the offer must be open (status 0). The call takes no body.
The call is asynchronous: it records a cancel transaction (OTC transaction type 2) on the token's network, publishes it and returns its ID. The offer turns 2 (cancelled) only when that transaction settles. Poll Get OTC Transaction until it reaches status 3 (Done) or 4 (Error).
Required permission: otc:cancel
Request
POST /v2/admin/otcs/tokens/{token_id}/deals/{deal_id}/cancel
Parameters
| Name | Type | In | Description |
|---|---|---|---|
token_id | string | path | Required. Token the offer is on (24-character hex) |
deal_id | integer | path | Required. On-chain deal ID of the offer, greater than 0 |
Headers
| Name | Description |
|---|---|
Authorization | Required. Bearer <access_token> |
Example
curl --request POST \
--url '{{baseUrl}}/v2/admin/otcs/tokens/68ae06cfcccf4e8fc19362d1/deals/2/cancel' \
--header 'Authorization: Bearer <access_token>'
Response
{
"transaction_id": "6a8b5e13f9129816a6cc7a13"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | The OTC transaction this call started. A 200 means the cancel was queued, not that the offer is cancelled |
Errors
| Status | Code | Description |
|---|---|---|
| 400 | 10015 | Validation failed — see details. Includes a deal_id that is not a positive integer |
| 400 | 10016 | token_id is not a 24-character hex ID |
| 400 | 11001 (domain 11) | No offer with this deal ID on this token |
| 400 | 11002 (domain 11) | The offer is not open (already accepted, cancelled or rejected, or not yet confirmed) |
| 400 | 10001 (domain 5) | The offer's token was not found |
| 400 | 10001 (domain 2) | The token's node was not found |
| 403 | 10005 (domain 2) | The token's node is outside your API key's node subtree |
| 500 | 10000 | Unexpected server error |
See Errors for the error format and common codes.