Skip to main content

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

HeaderValue
Content-Typeapplication/json
AuthorizationBearer {token}

Path Parameters

ParameterTypeRequiredDescription
user_idstringYesThe unique identifier of the user selling the tokens
token_idstringYesThe unique identifier of the token to sell

Request Body

{
"quantity": 3,
"price_id": "6913307ec95e268b239b2d8b",
"price_amount": 12
}

Parameters

ParameterTypeRequiredDescription
quantityintegerYesNumber of tokens to sell
price_idstringYesCurrency token ID
price_amountnumberYesPrice 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

FieldTypeDescription
transaction_idstringTransaction 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_id to 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_id is the currency token ID, price_amount is the price per token