Quickstart

Make your first request

Three steps from zero to a settled trade order. If you only have ten minutes, this is the page to read.

1

Authenticate

POST your Bitrus-issued credentials to /auth/password-login. The response includes a JWT bearer token valid for 60 minutes.

cURL

curl -X POST https://api.bitrus.com/api/v1/auth/password-login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "you@yourcompany.com",
    "password": "<password issued by Bitrus>"
  }'

Python

import os
import requests

response = requests.post(
    "https://api.bitrus.com/api/v1/auth/password-login",
    json={
        "email": os.environ["BITRUS_EMAIL"],
        "password": os.environ["BITRUS_PASSWORD"],
    },
)
response.raise_for_status()
token = response.json()["data"]["access_token"]
print(token)
2

Create a quote

POST /quotes/ with base asset, quote asset, side, and quantity. The response is a binding price valid for 60 seconds — submit the trade order before expires_at or you will need to re-quote.

cURL

curl -X POST https://api.bitrus.com/api/v1/quotes/ \
  -H "Authorization: Bearer $BITRUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "base_asset": "BTC",
    "quote_asset": "USDT",
    "quantity": "0.5",
    "side": "BUY"
  }'

Python

import os
import requests

response = requests.post(
    "https://api.bitrus.com/api/v1/quotes/",
    headers={"Authorization": f"Bearer {os.environ['BITRUS_TOKEN']}"},
    json={
        "base_asset": "BTC",
        "quote_asset": "USDT",
        "quantity": "0.5",
        "side": "BUY",
    },
)
response.raise_for_status()
quote = response.json()["data"]
print(quote["id"], "expires_at", quote["expires_at"])
3

Create an order

POST /trade-order/ with the quote_id and the settlement network. The response includes the deposit address to fund and an initial RECEIVED status. Subsequent transitions (WAITING_DEPOSIT, DEPOSIT_RECEIVED, ASSET_SENT, COMPLETE) happen asynchronously.

cURL

curl -X POST https://api.bitrus.com/api/v1/trade-order/ \
  -H "Authorization: Bearer $BITRUS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "quote_id": "ad5f2fa3-7f1b-4d0c-9d81-1f2c3cba9c01",
    "network": "POLYGON"
  }'

Python

import os
import requests

response = requests.post(
    "https://api.bitrus.com/api/v1/trade-order/",
    headers={"Authorization": f"Bearer {os.environ['BITRUS_TOKEN']}"},
    json={
        "quote_id": os.environ["BITRUS_QUOTE_ID"],
        "network": "POLYGON",
    },
)
response.raise_for_status()
order = response.json()
print(order["status"], order["deposit_address"]["address"])

What next?

The trade order moves through several statuses while Bitrus settles on-chain. The Trade Order Flow page documents every transition and what you should do at each.