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/partner

Version:

v1.0

Authentication

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/json

Security 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/ccies

Retrieve 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/price

Calculate 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-order

Create 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/:orderNumber

Track 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:

USDTERC20

USDT on Ethereum (ERC20)

USDTTRC

USDT on Tron (TRC20)

USDTBSC

USDT on BSC (BEP20)

USDTMATIC

USDT on Polygon

Error Codes

0

Success

Request completed successfully

1

Bad Request

Invalid parameters or validation error

2

Unauthorized

Invalid or missing API credentials

3

Not Found

Order or resource not found

5

Internal Server Error

Unexpected server error occurred

Order Statuses

NEW

Order created, waiting for deposit

PENDING

Deposit received, waiting confirmations

EXCHANGE

Funds being exchanged

DONE

Exchange completed successfully

EXPIRED

Order expired (no deposit)

EMERGENCY

Issue detected, contact support

Rate Limiting

API requests are rate limited to ensure fair usage and system stability:

Rate Limit:
60 requests / minute
Burst:
10 requests / second

Support & Resources

Need help getting started or have questions about the API?