Sell On OTC
Create an OTC (Over-The-Counter) sell offer for tokens owned by a user.
Endpoint
POST /v2/users/{user_id}/otcs/tokens/{token_id}/sell
Headers
| Header | Value |
|---|---|
| Content-Type | application/json |
| Authorization | Bearer {token} |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| user_id | string | Yes | The unique identifier of the user selling the tokens |
| token_id | string | Yes | The unique identifier of the token to sell |
Request Body
{
"quantity": 3,
"wallet_id": "6a89b68e0c46ca4c941271aa",
"currency_token_id": "6913307ec95e268b239b2d8b",
"unit_price": 12
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| quantity | integer | Yes | Number of tokens to sell |
| wallet_id | string | Yes | The seller's wallet whose holding backs the listing; the sale is validated against and settled from it |
| currency_token_id | string | Yes | The currency the listing is priced in (currency_tokens._id). Was price_id, which named no entity |
| unit_price | number | Yes | Price of one token in that currency — not the total. Was price_amount |
Example
Request
curl --location 'https://test-integration-api.tokenizationtr.com/v2/users/6913872755654191dede37da/otcs/tokens/691331aec95e268b239b2d91/sell' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJRCI6Ijk3MWNlZGVmLWVlZDctNDcwZi04YWIzLTBhZTM3ZDc0NTY4NCIsImV4cGlyYXRpb24iOjE3NjMwODM3NjcsInN1cGVydmlzb3JFbWFpbCI6ImRldkBydWRpcS5jb20iLCJzdXBlcnZpc29ySUQiOiI2OGQyODBiYmM1ODA3M2NkZjU2NDJkMjAiLCJzdXBlcnZpc29yTm9kZUlEIjoiNjY1YWU1MzZhNjM5MmI3NWNmZDQwMzUyIiwic3VwZXJ2aXNvck5vZGVJbnRJRCI6MSwic3VwZXJ2aXNvck5vZGVQYXRoIjoiMSIsInN1cGVydmlzb3JSb2xlSUQiOiI2NjVhZTc5NjEwY2UyMTZkYmMzNWM5M2IiLCJzdXBlcnZpc29yUm9sZVByaW9yaXR5IjoxMDB9.0l-NJTDICHXuhwb0PGX6wwXO50zhMysxepUntC1sxJY' \
--data '{
"quantity": 3,
"wallet_id": "6a89b68e0c46ca4c941271aa",
"currency_token_id": "6913307ec95e268b239b2d8b",
"unit_price": 12
}'
Response
Returns a transaction ID for async processing. A user transaction row is created with type = 6 (CreateOtcOffer), environment = 1 (OtcEnvironment), and status = 1 (Started).
{
"transaction_id": "6913872755654191dede37da"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | User transaction ID. Poll it via Get User Transactions (filter by types=6) until status reaches 3 (Done) or 4 (Error). |
Error Responses
400 Bad Request
{
"error": "Invalid parameters",
"details": "Quantity must be greater than 0"
}
401 Unauthorized
{
"error": "Authentication required"
}
403 Forbidden
{
"error": "Access denied",
"details": "Insufficient permissions to create OTC offers"
}
404 Not Found
{
"error": "Resource not found",
"details": "User or token not found"
}
422 Unprocessable Entity
{
"error": "Insufficient token balance",
"details": "User does not have enough tokens to create this offer"
}
500 Internal Server Error
{
"error": "Internal server error"
}
Important Notes
- Async Processing: OTC offer is created asynchronously; use
transaction_idto poll status - OTC Trading: Over-the-counter trading allows for direct negotiation between parties
- Token Ownership: User must own the tokens they want to sell
- Price:
currency_token_idis the currency token ID andunit_priceis the price of one token. These wereprice_idandprice_amount; the transactiondatapayload still records them under the old names, so a response may showprice_id/price_amountwhere the request takes the new ones - Polling: Get User Transactions, filter by
types=6(CreateOtcOffer). The offer becomes orderbook-visible only after the transaction reachesDone(3) - Transaction storage: OTC settlements are tracked in the separate
otc_transactionscollection. The user transaction (type=6) is the orchestration record