Skip to main content

Admin Cancel OTC Deal

Cancels an OTC offer on a token. The cancellation is settled on-chain asynchronously, so the response names the transaction that was started rather than the finished result.

Request

POST /v2/admin/otcs/tokens/{token_id}/deals/{deal_id}/cancel

The node segment is gone: a deal id is unique within a token contract, so the token is the precise scope and the node is derived from it. The call takes no request body.

Parameters

NameTypeInDescription
token_idstringpathRequired. The ID of the token the offer is on
deal_idintegerpathRequired. The deal ID of the offer to cancel

Headers

NameTypeDescription
AuthorizationRequired. Bearer token for authentication
Content-TypeRequired. application/json

Example

curl --location --request POST '\{\{baseUrl\}\}/v2/admin/otcs/tokens/68ae06cfcccf4e8fc19362d1/deals/2/cancel' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'

Response

{
"transaction_id": "6a8b5e13f9129816a6cc7a13"
}

Response Fields

FieldTypeDescription
transaction_idstringThe OTC transaction started by this call. Poll it with Get Otc Transaction to see whether the cancellation settled

Status Codes

Status CodeDescription
200Success - the cancellation has been started
400Bad Request - unknown token or deal, or the offer is not in a cancellable state
401Unauthorized - invalid or missing authentication token
500Internal Server Error

Notes

  • This endpoint requires admin privileges.
  • A 200 means the transaction was started, not that the offer is cancelled. The offer reaches its final state only when the transaction reports status: 3 (Done).
  • This call used to answer 200 with an empty body, which left no way to follow the settlement.
  • The offer's full history is available at List Otc Transactions.