Skip to main content
This guide will walk you through placing and managing orders on the Busha exchange. A limit order rests at a price you name and fills only when the market reaches it. A market order takes whatever the order book offers right now. Once placed, you can list, fetch, and cancel your orders.
What You’ll Achieve:
  1. Understand the fields that make up an order.
  2. Place a resting limit order and understand how market orders are sized.
  3. List and fetch your orders.
  4. Cancel a single order, every order on one market, or arm the dead-man’s switch.

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 (or api: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 market, side, and type. The remaining fields depend on the order type:
ParameterRequired/OptionalDescription
marketRequiredThe symbol, e.g. USDT-NGN.
sideRequiredbuy or sell, in terms of the base asset.
typeRequiredlimit rests at a named price; market takes what the book offers.
quantityOptionalSize in the base asset. Required for limit and for market sell. Mutually exclusive with quote_quantity.
quote_quantityOptionalQuote asset spend, used to size a market buy.
priceOptionalLimit price in the quote asset. Required for limit, refused on market.
time_in_forceOptionalgtc (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_onlyOptionalWhen 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_idOptionalYour own reference (max 64 chars), unique among your live orders. Re-sending an identical request is safe and returns the existing order.
stp_modeOptionalSelf-trade prevention: cancel_taker (default), cancel_maker, cancel_both, or decrement.
Sizing rules to remember:
  • A limit order names quantity (base) and price (quote).
  • A market sell names quantity only.
  • A market buy names quote_quantity (the quote amount to spend) only — naming none is refused with market_buy_needs_quote_quantity.
  • A market order of either side that names a price is refused. To bound the price of a take, place a limit order with time_in_force: ioc.
2

Place a Limit Order

To place a resting limit order:
  1. Open your terminal or command prompt.
  2. Construct a POST request to the /v1/exchange/orders endpoint.
  3. Replace YOUR_BASE_URL with your chosen environment’s URL and YOUR_SECRET_TOKEN with your actual key.
The example below places a post-only bid far below the market so that it rests without filling.
Expected Response:
Save the returned 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 quote_quantity:
A market buy ends 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 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:
An ID belonging to another profile is 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 filled or cancelled returns order_not_cancellable.To cancel every live order on one market (the market query parameter is required):
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 timeout_seconds: 0 to disarm.

Troubleshooting Common Issues

  • duplicate_client_order_id: You reused a live client_order_id with 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 a market buy without quote_quantity. Add the quote amount to spend, and do not send a price.
  • price_off_tick or quantity_off_step: Your price or quantity does not conform to the market’s rules. Re-read GET /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 reached filled or cancelled.
  • 401 Unauthorized or 403: Your key lacks the exchange:trade (or api:write) scope.

What’s Next?

Now that you can place and manage orders, reconcile what they actually executed: