Sell On OTC
Create an OTC (Over-The-Counter) sell offer for tokens owned by a user.
Endpoint
POST /v2/users/otcs/users/{user_id}/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,
"price_id": "6913307ec95e268b239b2d8b",
"price_amount": 12
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| quantity | integer | Yes | Number of tokens to sell |
| price_id | string | Yes | Currency token ID |
| price_amount | number | Yes | Price amount per token |
Example
Request
curl --location 'https://test-integration-api.tokenizationtr.com/v2/users/otcs/users/6913872755654191dede37da/tokens/691331aec95e268b239b2d91/sell' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJjbGllbnRJRCI6Ijk3MWNlZGVmLWVlZDctNDcwZi04YWIzLTBhZTM3ZDc0NTY4NCIsImV4cGlyYXRpb24iOjE3NjMwODM3NjcsInN1cGVydmlzb3JFbWFpbCI6ImRldkBydWRpcS5jb20iLCJzdXBlcnZpc29ySUQiOiI2OGQyODBiYmM1ODA3M2NkZjU2NDJkMjAiLCJzdXBlcnZpc29yTm9kZUlEIjoiNjY1YWU1MzZhNjM5MmI3NWNmZDQwMzUyIiwic3VwZXJ2aXNvck5vZGVJbnRJRCI6MSwic3VwZXJ2aXNvck5vZGVQYXRoIjoiMSIsInN1cGVydmlzb3JSb2xlSUQiOiI2NjVhZTc5NjEwY2UyMTZkYmMzNWM5M2IiLCJzdXBlcnZpc29yUm9sZVByaW9yaXR5IjoxMDB9.0l-NJTDICHXuhwb0PGX6wwXO50zhMysxepUntC1sxJY' \
--data '{
"quantity": 3,
"price_id": "6913307ec95e268b239b2d8b",
"price_amount": 12
}'
Response
Returns a transaction ID for async processing. The OTC offer is processed asynchronously; use the transaction ID to poll for status.
{
"transaction_id": "6913872755654191dede37da"
}
Response Fields
| Field | Type | Description |
|---|---|---|
transaction_id | string | Transaction ID for polling - use to check offer status |
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:
price_idis the currency token ID,price_amountis the price per token