Get OTC Token
Get OTC (Over-The-Counter) deals for a specific token and user.
Endpoint
POST /v2/users/otcs/users/{user_id}/tokens/{token_id}
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 |
| token_id | string | Yes | The unique identifier of the token |
Request Body
{
"page": 1,
"per_page": 10
}
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| page | integer | Yes | Page number for pagination |
| per_page | integer | Yes | Number of items per page |
Response
Returns OTC deals for the specified token and user.
Success Response (200 OK)
{
"data": [
{
"deal_id": "number",
"quantity": "number",
"available_quantity": "number",
"price": {
"amount": "number",
"decimal": "number",
"symbol": "string"
},
"counterparty_id": "string",
"counterparty_name": "string",
"counterparty_rating": "number",
"deal_type": "string",
"status": "string",
"negotiable": "boolean",
"minimum_quantity": "number",
"expires_at": "string",
"created_at": "string",
"updated_at": "string",
"terms": {
"settlement_period": "string",
"payment_method": "string",
"additional_notes": "string"
}
}
],
"token_info": {
"id": "string",
"name": "string",
"symbol": "string",
"description": "string",
"current_market_price": {
"amount": "number",
"decimal": "number",
"symbol": "string"
}
},
"pagination": {
"current_page": 1,
"per_page": 10,
"total": "number",
"total_pages": "number"
}
}
Example
Request
curl -X POST "\{\{baseUrl\}\}/v2/users/otcs/users/680c02896d91ca0145cfeb81/tokens/68ae06cfcccf4e8fc19362d1" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer \{\{token\}\}" \
-d '{
"page": 1,
"per_page": 10
}'
Response
{
"data": [
{
"deal_id": 12,
"quantity": 100,
"available_quantity": 75,
"price": {
"amount": 12.0,
"decimal": 6,
"symbol": "USDT"
},
"counterparty_id": "680c02896d91ca0145cfeb82",
"counterparty_name": "Jane Smith",
"counterparty_rating": 4.8,
"deal_type": "buy_request",
"status": "active",
"negotiable": true,
"minimum_quantity": 10,
"expires_at": "2024-02-15T10:30:00Z",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"terms": {
"settlement_period": "24_hours",
"payment_method": "USDT",
"additional_notes": "Bulk purchase discount available"
}
}
],
"token_info": {
"id": "68ae06cfcccf4e8fc19362d1",
"name": "Real Estate Token",
"symbol": "RET",
"description": "Tokenized real estate investment",
"current_market_price": {
"amount": 11.5,
"decimal": 6,
"symbol": "USDT"
}
},
"pagination": {
"current_page": 1,
"per_page": 10,
"total": 1,
"total_pages": 1
}
}
Error Responses
400 Bad Request
{
"error": "Invalid request parameters"
}
401 Unauthorized
{
"error": "Authentication required"
}
403 Forbidden
{
"error": "Access denied"
}
404 Not Found
{
"error": "User or token not found"
}
500 Internal Server Error
{
"error": "Internal server error"
}