Prerequisites
Before you begin, ensure you have:- A Busha Business Account and Secret API Key (from the Quick Start Tutorial).
-
An API key that carries the
exchange:trade(orapi:write) scope for placing and cancelling orders. - An understanding of market symbols and trading rules (from Exchange Markets).
How to Place and Manage Orders
1
Understand Order Parameters
Every order needs
Sizing rules to remember:
market, side, and type. The remaining fields depend on the order type:| Parameter | Required/Optional | Description |
|---|---|---|
market | Required | The symbol, e.g. USDT-NGN. |
side | Required | buy or sell, in terms of the base asset. |
type | Required | limit rests at a named price; market takes what the book offers. |
quantity | Optional | Size in the base asset. Required for limit and for market sell. Mutually exclusive with quote_quantity. |
quote_quantity | Optional | Quote asset spend, used to size a market buy. |
price | Optional | Limit price in the quote asset. Required for limit, refused on market. |
time_in_force | Optional | gtc (rest until filled or cancelled), ioc (fill what it can and cancel the rest), or fok (fill in full or do nothing). Defaults to gtc for limit and ioc for market. |
post_only | Optional | When true, the order never takes liquidity. If it would cross, it is accepted then immediately cancelled with cancel_reason: post_only_would_cross. |
client_order_id | Optional | Your own reference (max 64 chars), unique among your live orders. Re-sending an identical request is safe and returns the existing order. |
stp_mode | Optional | Self-trade prevention: cancel_taker (default), cancel_maker, cancel_both, or decrement. |
- A
limitorder namesquantity(base) andprice(quote). - A
marketsellnamesquantityonly. - A
marketbuynamesquote_quantity(the quote amount to spend) only — naming none is refused withmarket_buy_needs_quote_quantity. - A
marketorder of either side that names apriceis refused. To bound the price of a take, place alimitorder withtime_in_force: ioc.
2
Place a Limit Order
To place a resting limit order:Expected Response:Save the returned
- Open your terminal or command prompt.
-
Construct a
POSTrequest to the/v1/exchange/ordersendpoint. -
Replace
YOUR_BASE_URLwith your chosen environment’s URL andYOUR_SECRET_TOKENwith your actual key.
id. Re-sending the identical request under the same client_order_id is safe and returns the same order (200 with message: Order already exists) rather than creating a duplicate.3
Place a Market Order
A market order takes whatever the book offers. To buy at market, size your spend with A market buy ends
quote_quantity:filled once it has spent the quote_quantity in whole quantity_steps; the remainder less than one step returns to your available balance. To sell at market, send quantity instead.A market order never carries a
price. If you want to limit how much you
pay, use a limit order with time_in_force: ioc.4
List and Fetch Orders
To list your orders:Orders come back most recent first. The An ID belonging to another profile is
status filter defaults to open (which includes partially_filled); closed returns filled and cancelled, and all returns every state. You can also filter by market, asset, side, type, from/to, or client_order_id.To fetch a single order by platform ID:not_found, not forbidden.5
Cancel Orders
To cancel a single order:Expected Response:Cancellation is accepted, not necessarily applied — a fill already in flight still prints. Cancelling an order that has already reached To arm the dead-man’s switch, which cancels all of your live orders if you stop calling before the timer fires:Re-arm on a cadence of about half the timeout (for example, every 15 to 30 seconds for a 60-second window). Set
filled or cancelled returns order_not_cancellable.To cancel every live order on one market (the market query parameter is required):timeout_seconds: 0 to disarm.Troubleshooting Common Issues
-
duplicate_client_order_id: You reused a liveclient_order_idwith a different payload. Use a fresh ID, or replay the identical body to safely retry after a network timeout. -
market_buy_needs_quote_quantity: You placed amarketbuywithoutquote_quantity. Add the quote amount to spend, and do not send aprice. -
price_off_tickorquantity_off_step: Yourpriceorquantitydoes not conform to the market’s rules. Re-readGET /v1/exchange/markets/{symbol}and round accordingly. -
post_only_would_cross: Not an error — the order was accepted and immediately cancelled. Adjust your price to rest instead. -
order_not_cancellable: The order has already reachedfilledorcancelled. -
401 Unauthorizedor403: Your key lacks theexchange:trade(orapi:write) scope.