Trading
The Trading section provides APIs to create, retrieve, and manage buy/sell orders for supported currency pairs. It also allows you to generate quotes, fetch current prices, and monitor market activity. These APIs are essential for integrating trading functionalities into your applications, enabling users to execute trades, track orders, and stay updated with live market prices.
Market buy/sell → POST /api/trading/quotes to lock a rate, then POST /api/trading/orders with the returned quote_id before it expires.
DCA (recurring) → POST /api/trading/scheduled-orders with a cadence (daily/weekly/monthly). Monitor progress via .../executions, pause/resume via PUT .../:id.
Limit-style → POST /api/trading/target-orders with a target_price. The order sits in active state and fires once the market hits that price, or flips to expired if an expires_at is reached first.
Create Quote
The Quotes endpoint allows users to get a real-time price estimate for buying or selling a specific amount of a currency. Use this before placing an order to lock in a price.
Create Quote Request
The base currency of the trading pair, e.g., 'BTC'.
The quote currency of the trading pair, e.g., 'USDT'.
The side of the order: 'buy' or 'sell'.
The amount of the base currency to buy or sell.
Create Quote Response
Indicates whether the quote retrieval was successful. True means the quote was generated without errors.
Message confirming the result of the quote request, useful for feedback or debugging.
Unique identifier for the quote. Use this to reference or execute a trade with this quote.
The base currency of the trading pair (e.g., BTC).
The quote currency of the trading pair (e.g., USDT).
The side of the quote: BUY or SELL.
The amount of base currency for which the quote was generated.
The quoted price per unit of the base currency in terms of the quote currency.
Timestamp indicating when the quote will expire and can no longer be used. Quotes are valid for 30 seconds.
Timestamp when the quote was created.
The original quantity requested when the quote was created.
The amount of the quote that has already been used in executed trades.
The amount of the quote still available to trade. Equals original_quantity minus consumed_quantity.
Whether the quote has been fully consumed. If true, no more trades can be executed against this quote.
A summary of what will be sent and received if the quote is executed.
The amount you will send to execute the trade (e.g., 6.91 USDT).
The currency you will send (e.g., USDT for a BUY order).
The amount you will receive after the trade (e.g., 0.00010000 BTC).
The currency you will receive (e.g., BTC for a BUY order).
Contains additional request information including the unique request_id for tracking.
Timestamp when the API response was generated.
Create Order
Submit a new order to buy or sell a specific amount of a trading pair. Use the quote_id from a previously generated quote to ensure the order is executed at the intended price.
Create Order Request
The base currency of the trading pair, e.g., 'BTC'.
The quote currency of the trading pair, e.g., 'USDT'.
The side of the order: 'buy' or 'sell'.
The amount of the base currency to buy or sell.
The price per unit of the base currency in terms of the quote currency.
A unique identifier for the quote used to create this order. Ensures the order is executed at the intended price.
Create Order Response
Indicates whether the order submission was successful.
Message confirming the result of the order submission.
Unique identifier for the order. Can be used to query or manage the order later.
The base currency of the trading pair (e.g., 'BTC').
The quote currency of the trading pair (e.g., 'USDT').
Indicates whether the order is 'BUY' or 'SELL'.
Type of the order, e.g., 'limit' or 'market'.
The amount of base currency specified in the order.
The price per unit of base currency in terms of the quote currency.
Current status of the order (e.g., 'pending', 'filled', 'rejected').
Timestamp when the order was created.
Timestamp when the order was last updated.
Amount of base currency that has been filled so far.
Amount of base currency remaining to be filled.
The identifier of the quote used to create this order.
An array of trade fills representing partial or full executions of the order. Each fill includes id, order_id, quantity, and created_at.
Details about the quote usage for this order. Includes quote_id, consumed_quantity (amount of the quote used), and remaining_quantity (amount still available on the quote).
Contains additional request information including the unique request_id for tracking.
Timestamp when the API response was generated.
Get Orders
Retrieves a list of all orders for the user. Each order includes its status, quantities, price, and exchange details, helping you track all trading activity quickly.
Get Orders Response
Indicates whether the request was successful. True means orders were retrieved without errors.
Message confirming the result of the request, useful for user feedback or debugging.
Unique identifier of the order, used to reference or manage it later.
The cryptocurrency being traded (e.g., 'BTC').
The currency used to price the base currency (e.g., 'USDT').
Indicates whether the order is 'BUY' or 'SELL'.
Type of the order, e.g., 'limit' or 'market'.
Current status of the order (e.g., 'pending', 'filled', 'rejected').
Total amount of base currency in the order.
Price per unit of base currency in terms of the quote currency.
Amount of base currency that has been executed so far.
Amount of base currency still pending execution.
Exchange where the order was submitted.
Timestamp when the order was created.
Timestamp when the order was last updated.
Contains additional request information including the unique request_id for tracking.
Timestamp when the API response was generated.
Get Order By ID
Retrieve detailed information about a specific order using its unique ID. This endpoint returns the order's current status, filled and remaining quantities, price, and timestamps.
Get Order By ID Response
Indicates whether the request was successful.
Message confirming the result of the request.
Unique identifier for the order.
The base currency of the trading pair (e.g., 'BTC', 'USDC').
The quote currency of the trading pair (e.g., 'USDT').
Indicates whether the order is 'BUY' or 'SELL'.
Type of the order, e.g., 'limit' or 'market'.
Total amount of base currency in the order.
Price per unit of base currency in terms of the quote currency.
Current status of the order (e.g., 'pending', 'filled', 'rejected').
The exchange where the order was submitted.
Timestamp when the order was created.
Timestamp when the order was last updated.
Amount of base currency that has been filled.
Amount of base currency remaining to be filled.
Contains additional request information including the unique request_id for tracking.
Timestamp when the API response was generated.
Get Prices
Use Case
Retrieve the latest prices for all supported trading pairs. Use this to display live market rates, power conversion previews, or check prices before creating a quote.
Response Body
Indicates whether the request was successful.
A message confirming the result of the request.
A list of price objects for each supported trading pair.
The base currency of the pair (e.g., BTC, USDC).
The quote currency of the pair (e.g., USDT, USDC).
The current price of one unit of the base currency in terms of the quote currency.
Timestamp indicating when this price was last updated.
Contains the unique request_id for tracking.
Timestamp when the API response was generated.
Get Quote by ID
Use Case
Check the consumption and expiry status of a quote you created. Returns how much of the quote's original quantity has been consumed, whether it's expired or exhausted, and how many orders have been submitted against it. Useful when a user hesitates on an order and you need to decide whether to re-quote before submitting.
Path Parameters
Quote identifier returned by POST /api/trading/quotes.
Response Fields
The quote being inspected (echo of the path param).
Quantity the quote was created with.
Sum of quantities across orders submitted against this quote.
original_quantity minus consumed_quantity — how much of the quote can still be filled.
Locked price from the original quote.
When the quote's TTL elapses and it can no longer be used.
True once expires_at has passed.
True when remaining_quantity is zero — all of the quote has been consumed.
Number of orders submitted against this quote. Useful for detecting partial-fill retries.
Submitting an order against a quote that's is_expired: true or is_exhausted: true returns a QUOTE_EXPIRED / QUOTE_EXHAUSTED error. Create a fresh quote before retrying.
Create Scheduled Order (DCA)
Use Case
Create a recurring buy that fires on a fixed frequency — daily, weekly, or monthly — at a specific execution_time. Standard pattern for dollar-cost averaging (DCA): set a fixed amount in the smallest unit of the target currency, choose a cadence, and let the engine run the order at each tick.
Request Body
Asset being bought on each execution (e.g. 'BTC').
Currency paying for each tick (e.g. 'USDT', 'USDC').
Amount to spend per execution, expressed as an integer string in the smallest unit of quote_currency (e.g. '50000000' on a USDT pair = 50 USDT per tick for 6-decimal minor units).
How often to execute. One of 'daily', 'weekly', or 'monthly'.
Time of day (UTC) when each execution fires, in 'HH:MM' 24-hour format (e.g. '09:00').
Required for 'weekly' frequency. 0 = Sunday … 6 = Saturday. Ignored for daily/monthly — pass 0.
Required for 'monthly' frequency. 1–28 recommended (values 29–31 skip months without that day). Ignored for daily/weekly — pass 0.
Client-generated identifier for idempotency and internal tracking.
The API requires both day_of_week and day_of_month on every request, but ignores the one that doesn't apply to your chosen frequency. Pass 0 for the unused field.
List Scheduled Orders
Use Case
Return all scheduled orders for your company. Filter by status (active, paused, cancelled, completed) to show only the ones that matter on your dashboard.
Query Parameters
Filter by lifecycle state: 'active', 'paused', 'cancelled', 'completed'.
Response Fields
Every scheduled order for your company. Each entry uses the same shape returned by Create Scheduled Order — refer to that section for per-field docs.
Count of ticks that have fired so far.
Cumulative quote-currency amount deducted across all executions (smallest unit).
Cumulative base-asset quantity acquired across all executions.
RFC 3339 / ISO 8601 timestamp of the most recent tick. Empty string on schedules that haven't fired yet.
Get Scheduled Order
Use Case
Retrieve a single scheduled order by ID. The response returns the schedule under data.schedule with its current state, cadence, next execution time, and cumulative execution stats (total_executions, total_amount_spent, total_quantity_acquired).
Path Parameters
Scheduled order identifier from Create Scheduled Order.
Response Fields
Top-level flag indicating the schedule was retrieved.
Human-readable status message.
The schedule record. Fields mirror Create Scheduled Order's response plus cumulative execution stats.
Schedule identifier.
Company that owns the schedule.
Asset being acquired on each tick (e.g. 'BTC').
Currency used to fund each tick (e.g. 'USDT').
Per-tick spend in the smallest unit of quote_currency.
'daily', 'weekly', or 'monthly'.
0–6 (Sunday=0) when frequency is 'weekly'; 0 otherwise.
1–31 when frequency is 'monthly'; 0 otherwise.
24-hour HH:MM firing time in UTC.
'active', 'paused', 'cancelled', or 'completed'.
Next scheduled run. Null when status is terminal.
Timestamp of the most recent execution. Empty string when the schedule has never fired.
Number of ticks that have fired.
Cumulative quote_currency spent across all executions.
Cumulative currency acquired across all executions.
When the schedule was created.
When the schedule was last modified.
Client-supplied idempotency key.
Unique request identifier for support and tracing.
Server time when the response was generated.
Update Scheduled Order
Use Case
Adjust a recurring order in place without cancelling and re-creating it. Common uses: pause/resume (status: "paused" / "active"), change the per-tick amount, or shift execution_time. Fields omitted from the request are left untouched; next_execution_at is only recomputed when you change the cadence anchors (frequency, day_of_week, day_of_month, execution_time).
Body Parameters
New per-tick spend in the smallest unit of quote_currency. Takes effect on the next execution.
New cadence: 'daily', 'weekly', or 'monthly'. Changing this resets next_execution_at.
0–6 (Sunday=0). Only meaningful when frequency is 'weekly'.
1–31. Only meaningful when frequency is 'monthly'.
24-hour HH:MM firing time in UTC. Changing this reschedules next_execution_at.
'paused' to stop future executions without cancelling, or 'active' to resume a paused schedule.
Setting status: "paused" freezes future executions but keeps the schedule on record — resume it at any time by sending another update with status: "active". next_execution_at is preserved, so the schedule picks up from where it left off.
Response Fields
Flag indicating the update was applied.
Human-readable status message.
The updated schedule record. Shape is identical to Get Scheduled Order.
Unique request identifier for support and tracing.
Server time when the response was generated.
Get Scheduled Order Executions
Use Case
Return the execution history for a scheduled order — one entry per cadence tick, with the fill price, quantity, and link to the underlying order. Drives progress charts and reconciliation.
Response Fields
Per-tick execution records, ordered newest first.
Execution identifier.
ID of the underlying order created for this tick (usable with Get Order by ID).
'completed', 'failed', or 'skipped'.
Base-asset amount purchased / sold on this tick.
Fill price for this tick.
Quote-currency amount spent (for buys) or received (for sells).
RFC 3339 / ISO 8601 timestamp of when this tick ran.
Create Target Order
Use Case
Create a price-triggered order that fires once the market hits your target_price — the limit-style primitive for the Trading API. side: "buy" fires when the market falls to or below target; side: "sell" fires when the market rises to or above target.
Request Body
Asset to buy or sell (e.g. 'BTC').
Currency the target_price is expressed in.
'buy' or 'sell'.
Amount of base_currency to trade once triggered.
Trigger price in quote_currency units. Buy orders trigger at <= target; sell orders trigger at >= target.
When the order should auto-cancel if never triggered. Empty string when the order has no expiry.
Client-generated identifier for idempotency and tracking.
Response Fields
Flag indicating the target order was created.
Human-readable status message.
The created target order.
Target order identifier.
Company that owns the order.
Asset to buy or sell.
Pricing currency for target_price.
'BUY' or 'SELL' (returned uppercase).
Total base-asset amount requested.
Base-asset amount already filled.
Base-asset amount still pending: quantity - filled_quantity.
Trigger price in quote_currency.
Volume-weighted average price across fills. Empty string until the first fill.
Quote-currency amount escrowed at creation (includes fees). Returned to the wallet on cancel/expiry.
Portion of locked_amount still reserved and not yet consumed by fills.
Currency held in escrow — quote_currency for buys, base_currency for sells.
'active', 'triggered', 'filled', 'cancelled', or 'expired'.
Auto-cancel timestamp. Empty string when the order has no expiry.
Timestamp of the first trigger. Empty until the target price is hit.
Timestamp of the most recent fill. Empty until the first fill.
Timestamp when the order was completely filled. Empty while partial or active.
When the order was created.
When the order was last modified.
Client-supplied idempotency key echoed back. Empty string when not provided.
Unique request identifier for support and tracing.
Server time when the response was generated.
locked_amount is escrowed the moment the order is created — for buys this is quantity × target_price plus fees in quote_currency, and for sells it's quantity of base_currency. This reservation is released back to the wallet if the order is cancelled or expires without fully filling.
List Target Orders
Use Case
Return all target orders under data.orders[]. Each entry is the full target-order record — same shape as Create Target Order's data.order, including the escrow fields (locked_amount, remaining_locked, locked_currency) and state timestamps. Filter by status to surface only what you care about.
Query Parameters
Filter by lifecycle state: 'active', 'triggered', 'filled', 'cancelled', or 'expired'.
Response Fields
Flag indicating the query succeeded.
Human-readable status message.
List of target orders. Each entry is the full Create Target Order shape — see that section for per-field documentation.
Unique request identifier for support and tracing.
Server time when the response was generated.
Get Target Order
Use Case
Retrieve a single target order by ID under data.order. Use this to poll a specific order's lifecycle — it surfaces status, filled_quantity / remaining_quantity, average_fill_price, the escrow fields (locked_amount / remaining_locked / locked_currency), and state timestamps (first_triggered_at, last_fill_at, fully_filled_at).
Path Parameters
Target order identifier.
Response Fields
Flag indicating the order was retrieved.
Human-readable status message.
The target order record. Shape is identical to Create Target Order's data.order — refer to that section for per-field docs.
Unique request identifier for support and tracing.
Server time when the response was generated.
Once the market hits the target, first_triggered_at becomes populated and fills flow in — filled_quantity, average_fill_price, and last_fill_at update per fill. When the order is fully filled, status flips to filled and fully_filled_at is set. remaining_locked tracks unspent escrow and is released back to the wallet on cancel, expiry, or final fill.