Partner API Documentation
Integrate cryptocurrency exchange functionality into your platform
Quick Start
The 0xSwap Partner API allows you to integrate cryptocurrency exchange functionality into your platform. All API requests require authentication using API keys.
Base URL:
https://0xswap.exchange/api/partnerVersion:
v1.0Authentication
Include your API keys in the request headers for all API calls:
X-API-Public-Key: partner_abc123...X-API-Secret-Key: c105e76650fda1b9...Content-Type: application/jsonSecurity Warning
Never expose your secret key in client-side code. All API calls must be made from your backend server.
API Endpoints
Get Available Currencies
GET /api/partner/cciesRetrieve the list of all available cryptocurrencies for exchange.
Response:
{
"code": 0,
"data": [
{
"code": "USDTERC20",
"coin": "USDT",
"network": "ETH",
"name": "Tether (ERC20)",
"recv": true,
"send": true,
"min": "10",
"max": "100000"
}
]
}Get Exchange Rate
POST /api/partner/priceCalculate the exchange rate between two currencies for a specific amount.
Request:
{
"fromCcy": "USDTERC20",
"toCcy": "USDTTRC",
"direction": "from",
"amount": 100
}Response:
{
"code": 0,
"data": {
"from": {
"code": "USDTERC20",
"amount": "100",
"min": "10",
"max": "135678.42"
},
"to": {
"code": "USDTTRC",
"amount": "99.179"
}
}
}Create Exchange Order
POST /api/partner/create-orderCreate a new exchange order with the specified parameters.
Request:
{
"fromCcy": "USDTERC20",
"toCcy": "USDTTRC",
"direction": "from",
"amount": 100,
"toAddress": "TXYZPrarV6ahiFkhEK3z6XZHzqKRr5ksj5",
"email": "[email protected]"
}Response:
{
"code": 0,
"data": {
"orderNumber": "UHWVPB",
"status": "NEW",
"from": {
"code": "USDTERC20",
"amount": "100",
"address": "0x742d35Cc...",
"txId": null
},
"to": {
"code": "USDTTRC",
"amount": "99.179",
"address": "TXYZPrarV6...",
"txId": null
},
"timeLeft": 900
}
}Get Order Status
GET /api/partner/order/:orderNumberTrack the status of an existing order.
Response:
{
"code": 0,
"data": {
"orderNumber": "UHWVPB",
"status": "DONE",
"from": {
"txId": "0xabc123..."
},
"to": {
"txId": "def456..."
}
}
}Important: Currency Codes
USDT has multiple variants based on blockchain network. Always use the full code:
USDTERC20USDT on Ethereum (ERC20)
USDTTRCUSDT on Tron (TRC20)
USDTBSCUSDT on BSC (BEP20)
USDTMATICUSDT on Polygon
Error Codes
0Success
Request completed successfully
1Bad Request
Invalid parameters or validation error
2Unauthorized
Invalid or missing API credentials
3Not Found
Order or resource not found
5Internal Server Error
Unexpected server error occurred
Order Statuses
NEWOrder created, waiting for deposit
PENDINGDeposit received, waiting confirmations
EXCHANGEFunds being exchanged
DONEExchange completed successfully
EXPIREDOrder expired (no deposit)
EMERGENCYIssue detected, contact support
Rate Limiting
API requests are rate limited to ensure fair usage and system stability:
60 requests / minute10 requests / secondSupport & Resources
Need help getting started or have questions about the API?