Depa LogoDocsv1
API Reference

Trades

Trades convert between currencies and assets inside an account: fiat to stablecoin, stablecoin to fiat, or between crypto assets.

  • Orders execute immediately at the best available price (order_type: market) unless you place a limit order.
  • Size an order in the base asset with volume (BTC in BTC/EUR) or in the quote asset with amount (EUR in BTC/EUR). Order books trade in the base asset, so quote-sized orders are converted first and the executed result can differ slightly.
  • Set client_id to your own reference to find or cancel the trade later.
  • Check tradable pairs, minimum sizes and precision with GET /supported_pairs before you trade.

For a guaranteed rate on a currency conversion, use Quotes & Payouts instead.

List trades

GET/accounts/{account_id}/trades

Returns the trades of an account, executed and pending, with fees. Results come 80 per page by default.

Authorization

BearerAuth
AuthorizationBearer <token>

Token from POST /sign_in, sent as Authorization: Bearer <token>.

In: header

Path Parameters

account_id*string

ID of the account.

Formatuuid

Query Parameters

page?integer

Page number, starting at 1.

Range1 <= value
Default1
per_page?integer

Number of results per page. Defaults to 80.

Range1 <= value

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/accounts/8f3a2c1e-5b7d-4e9a-9c21-7d4b6e0f1a23/trades?page=1&per_page=80"
{  "data": [    {      "id": "5b9d2e7f-3a1c-4f6b-8e2d-7c0a9f4b1e38",      "pair": "USDC/EUR",      "amount": 920,      "volume": 1000,      "price": 0.92,      "trade_type": "buy",      "order_type": "market",      "created_at": 1772813114,      "trading_fee_amount": 0.92,      "trading_fee_percentage": 0.001,      "client_id": "order-7731"    }  ],  "pagination": {    "current_page": 1,    "per_page": 80,    "total_pages": 1,    "total_count": 2  }}

Create a trade

POST/accounts/{account_id}/trades

Places an order to buy or sell the base asset of pair. Size it with volume (base asset) or amount (quote asset).

  • Market orders (the default) execute immediately at the best available price.
  • Limit orders (order_type: limit) execute at limit_price or better.

Order books trade in the base asset, so an order sized with amount is converted to a volume first and the executed result can differ slightly. Other order options can be enabled depending on your liquidity venue; ask Depa.

Authorization

BearerAuth
AuthorizationBearer <token>

Token from POST /sign_in, sent as Authorization: Bearer <token>.

In: header

Path Parameters

account_id*string

ID of the account.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/accounts/8f3a2c1e-5b7d-4e9a-9c21-7d4b6e0f1a23/trades" \  -H "Content-Type: application/json" \  -d '{    "pair": "USDC/EUR",    "type": "buy",    "volume": 1000,    "client_id": "order-7731"  }'
{  "data": {    "id": "5b9d2e7f-3a1c-4f6b-8e2d-7c0a9f4b1e38",    "pair": "USDC/EUR",    "amount": 920,    "volume": 1000,    "price": 0.92,    "trade_type": "buy",    "order_type": "market",    "created_at": 1772813114,    "trading_fee_amount": 0.92,    "trading_fee_percentage": 0.001,    "client_id": "order-7731"  }}

Retrieve a trade

GET/accounts/{account_id}/trades/{id}

Returns a trade with its execution price and fees.

Authorization

BearerAuth
AuthorizationBearer <token>

Token from POST /sign_in, sent as Authorization: Bearer <token>.

In: header

Path Parameters

account_id*string

ID of the account.

Formatuuid
id*string

ID of the trade.

Formatuuid

Response Body

application/json

application/json

application/json

curl -X GET "https://example.com/accounts/8f3a2c1e-5b7d-4e9a-9c21-7d4b6e0f1a23/trades/5b9d2e7f-3a1c-4f6b-8e2d-7c0a9f4b1e38"
{  "data": {    "id": "5b9d2e7f-3a1c-4f6b-8e2d-7c0a9f4b1e38",    "pair": "USDC/EUR",    "amount": 920,    "volume": 1000,    "price": 0.92,    "trade_type": "buy",    "order_type": "market",    "created_at": 1772813114,    "trading_fee_amount": 0.92,    "trading_fee_percentage": 0.001,    "client_id": "order-7731"  }}

Cancel a trade

PUT/accounts/{account_id}/trades/cancel

Cancels a trade that hasn't executed yet, such as an open limit order. Identify it with trade_id or your client_id.

Authorization

BearerAuth
AuthorizationBearer <token>

Token from POST /sign_in, sent as Authorization: Bearer <token>.

In: header

Path Parameters

account_id*string

ID of the account.

Formatuuid

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Identify the trade with trade_id or with your client_id.

Response Body

application/json

application/json

application/json

application/json

curl -X PUT "https://example.com/accounts/8f3a2c1e-5b7d-4e9a-9c21-7d4b6e0f1a23/trades/cancel" \  -H "Content-Type: application/json" \  -d '{    "client_id": "order-7733"  }'
{  "data": {    "id": "5b9d2e7f-3a1c-4f6b-8e2d-7c0a9f4b1e38",    "pair": "USDC/EUR",    "amount": 920,    "volume": 1000,    "price": 0.92,    "trade_type": "buy",    "order_type": "market",    "created_at": 1772813114,    "trading_fee_amount": 0.92,    "trading_fee_percentage": 0.001,    "client_id": "order-7731"  }}
🍪 We do not track your behaviour or use any cookie on this site.