REST API Reference
The ZenOTC REST API allows you to programmatically access trading, portfolio, and market data functionality. This reference documents all available endpoints for direct API integration without using the SDK.
Base URL
| Environment | Base URL |
|---|---|
| Production | https://api.zenotc.com |
| Staging | https://api-staging.zenotc.com |
Staging Environment
Use the staging environment for development and testing. It provides the same functionality with test data.
API Resources
| Resource | Description |
|---|---|
| Orders | Create, manage, and cancel trading orders |
| Quotes | Submit and manage two-sided quotes (market making) |
| Market Data | Get prices, order books, and trading pairs |
| Portfolio | View balances, positions, and trade history |
| Risk | Check risk limits and run pre-trade validations |
Authentication
All API requests require authentication using API key headers. See Authentication for details.
curl https://api.zenotc.com/api/sdk/portfolio/balances \
-H "X-API-Key: your_api_key" \
-H "X-API-Timestamp: 1705312200000" \
-H "X-API-Signature: your_signature"
Request Format
- All request bodies must be JSON with
Content-Type: application/json - Query parameters should be URL-encoded
- Timestamps are in ISO 8601 format or Unix milliseconds
Response Format
All responses are JSON with the following structure:
{
"data": { ... },
"timestamp": "2024-01-15T10:30:00.000Z"
}
Error responses:
{
"statusCode": 400,
"message": "Invalid order parameters",
"error": "Bad Request",
"details": { ... }
}
Rate Limits
| Endpoint Category | Rate Limit |
|---|---|
| Market Data | 30 requests/second |
| All Other Endpoints | 10 requests/second |
Rate limit headers are included in all responses:
| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests per window |
X-RateLimit-Remaining | Requests remaining in current window |
X-RateLimit-Reset | Unix timestamp when window resets |
When rate limited, you'll receive a 429 Too Many Requests response.
API Key Scopes
API keys are created with specific scopes that control access:
| Scope | Description |
|---|---|
READ | Read-only access to all data |
TRADE | Create, amend, and cancel orders |
MARKET_MAKING | Submit and manage quotes |
WITHDRAW | Initiate withdrawals |
HTTP Status Codes
| Code | Description |
|---|---|
200 | Success |
201 | Created |
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing authentication |
403 | Forbidden - Insufficient permissions |
404 | Not Found - Resource doesn't exist |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal Server Error |
Pagination
List endpoints support pagination:
| Parameter | Type | Default | Description |
|---|---|---|---|
page | integer | 1 | Page number (1-indexed) |
limit | integer | 50 | Items per page (max 100) |
Response includes pagination metadata:
{
"data": [...],
"pagination": {
"page": 1,
"limit": 50,
"total": 150,
"totalPages": 3
}
}