Admin Accept OTC Deal
Accepts an OTC offer on a token. The acceptance 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}/accept
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.
Parameters
| Name | Type | In | Description |
|---|---|---|---|
token_id | string | path | Required. The ID of the token the offer is on |
deal_id | integer | path | Required. The deal ID of the offer to accept |
Headers
| Name | Type | Description |
|---|---|---|
Authorization | Required. Bearer token for authentication | |
Content-Type | Required. application/json |
Example
curl --location --request POST '\{\{baseUrl\}\}/v2/admin/otcs/tokens/68ae06cfcccf4e8fc19362d1/deals/2/accept' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
Response
{
"transaction_id": "6a8b5e13f9129816a6cc7a12"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | The OTC transaction started by this call. Poll it with Get Otc Transaction to see whether the acceptance settled |
Status Codes
| Status Code | Description |
|---|---|
| 200 | Success - the acceptance has been started |
| 400 | Bad Request - unknown token or deal, or the offer is not in an acceptable state |
| 401 | Unauthorized - invalid or missing authentication token |
| 500 | Internal Server Error |
Notes
- This endpoint requires admin privileges.
- A
200means the transaction was started, not that the offer is accepted. The offer reaches its final state only when the transaction reportsstatus: 3(Done); a failed attempt reportsstatus: 4(Error) and can be retried. - This call used to answer
200with an empty body, which left no way to follow the settlement. - The offer's full history is available at List Otc Transactions.