Making Requests

Request format, headers, pagination, and response structure

Making Requests

This guide covers the request and response format for the PRIME REST API.

Base URL

https://api.t-dx.com/api/rest/v1/

All endpoints are prefixed with /api/rest/v1/.


Request Headers

Required Headers

HeaderValueDescription
AuthorizationBearer <token> or TDXV1-HMAC-SHA256 ...Authentication
Content-Typeapplication/jsonRequired for POST/PUT/PATCH

Optional Headers

HeaderValueDescription
Acceptapplication/jsonResponse format (default)
X-Correlation-IDUUIDRequest tracing (auto-generated if omitted)

Example Request

curl -X GET "https://api.t-dx.com/api/rest/v1/instruments" \
  -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIs..." \
  -H "Accept: application/json"

Naming Conventions

The API uses different naming conventions for different contexts:

ContextConventionExample
JSON body fieldscamelCasesubAccountId, pairId, createdAt
Query parameterssnake_casepair_id, instrument_id, created_at
URL path segmentskebab-case/sub-accounts, /client-accounts

Request Body

For POST, PUT, and PATCH requests, send JSON in the request body. Use camelCase for all field names.

curl -X POST "https://api.t-dx.com/api/rest/v1/orders" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "subAccountId": "uuid",
    "pairId": "uuid",
    "side": "SIDE_BUY",
    "type": "TYPE_LIMIT",
    "quantity": "1.5",
    "price": "45000.00"
  }'

Decimal Values

Decimal values (prices, quantities, amounts) are sent as strings to preserve precision:

{
  "quantity": "1.50000000",
  "price": "45000.00"
}

Response Format

Success Response

Response bodies use camelCase field names:

{
  "id": "resource-uuid",
  "field1": "value1",
  "field2": "value2",
  "createdAt": "2024-01-15T10:30:00Z"
}

List Response with Pagination

{
  "items": [
    { "id": "uuid-1", ... },
    { "id": "uuid-2", ... }
  ],
  "pagination": {
    "cursors": {
      "self": "eyJTb3J0cyI6...",
      "first": "eyJTb3J0cyI6...",
      "last": "eyJTb3J0cyI6...",
      "next": "eyJTb3J0cyI6...",
      "previous": ""
    }
  }
}

Pagination

The API uses cursor-based pagination for list endpoints.

Query Parameters

ParameterTypeDescription
limitintegerResults per page (1-500, default varies)
cursorstringBase64-encoded cursor from previous response

Example: First Page

GET /api/rest/v1/instruments?limit=50

Example: Next Page

GET /api/rest/v1/instruments?limit=50&cursor=eyJTb3J0cyI6W3si...

Cursor Structure

Cursors are Base64-encoded JSON containing:

  • Sort configuration
  • Filter state
  • Position markers

Do not construct cursors manually. Always use cursors from the API response.

Pagination Response

{
  "pagination": {
    "cursors": {
      "self": "current-page-cursor",
      "first": "first-page-cursor",
      "last": "last-page-cursor",
      "next": "next-page-cursor",
      "previous": "previous-page-cursor"
    }
  }
}
  • Empty next = no more pages forward
  • Empty previous = no more pages backward

Sorting

Sort results using the sort query parameter.

Format

sort=<field>-<direction>

Directions

DirectionDescription
ascAscending (oldest first, A-Z)
descDescending (newest first, Z-A)

Example

GET /api/rest/v1/orders?sort=created_at-desc

Common Sort Fields

FieldDescription
created_atCreation timestamp
updated_atLast update timestamp
nameAlphabetical by name
symbolAlphabetical by symbol

Filtering

Filter results using query parameters or the query parameter.

Simple Filters

GET /api/rest/v1/orders?status=STATUS_OPEN&side=SIDE_BUY

Range Filters

GET /api/rest/v1/trades?from=2024-01-01T00:00:00Z&to=2024-01-31T23:59:59Z

Multiple Values

GET /api/rest/v1/instruments?type=CRYPTO_CURRENCY&type=CURRENCY

Filter Types

TypeDescriptionExample
ValueSingle value matchstatus=STATUS_OPEN
ValuesMultiple value match (OR)status=STATUS_OPEN&status=STATUS_FILLED
RangeBetween two valuesfrom=...&to=...
BooleanTrue/falsetradable=true

Date and Time

All timestamps use ISO 8601 format in UTC:

2024-01-15T10:30:00Z

Query Parameter Format

GET /api/rest/v1/trades?from=2024-01-01T00:00:00Z&to=2024-01-31T23:59:59Z

Response Format

{
  "createdAt": "2024-01-15T10:30:00Z",
  "updatedAt": "2024-01-15T14:22:00Z"
}

HTTP Methods

MethodUsage
GETRetrieve resources
POSTCreate resources
PUTReplace resources
PATCHPartial update
DELETERemove resources

Status Codes

Success Codes

CodeDescription
200Success (GET, PUT, PATCH, DELETE)
201Created (POST)
204No Content (DELETE with no body)

Client Error Codes

CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Authentication required
403Forbidden - Insufficient permissions
404Not Found - Resource doesn't exist
409Conflict - Resource already exists
422Unprocessable Entity - Validation failed
429Too Many Requests - Rate limited

Server Error Codes

CodeDescription
500Internal Server Error
503Service Unavailable

Rate Limiting

The API implements rate limiting to ensure fair usage.

Response Headers

When rate limited, the response includes:

HTTP/1.1 429 Too Many Requests
Retry-After: 60

Best Practices

  1. Implement exponential backoff on 429 responses
  2. Cache responses where appropriate
  3. Use WebSocket for real-time data instead of polling
  4. Batch requests where possible

CORS

The API supports Cross-Origin Resource Sharing (CORS) for browser-based clients.

Allowed Headers

  • Content-Type
  • Accept
  • Authorization

Preflight Requests

OPTIONS requests are handled automatically for CORS preflight.




  © 2025 Taurus SA. All rights reserved.