Skip to main content
The production examples on this page use a live key and the production paths. Check the availability notice on Production access requirements before you use them.

The order object

Both environments return these fields: Test orders add deal_label (T-<n>). Production orders add:

Order statuses

A test order is always filled. A production order has one of these statuses: A production order normally moves pending → open → closing → closed, or pending → rejected. Closing is done by Bullionwale; the API does not close or cancel orders.

Read one order

200 OK
An order that is not on your account answers 404 order_not_found.

Follow a pending order

In production, POST /orders can answer 202 Accepted with the order pending while Bullionwale’s hedge confirms it. Then:
  1. Call GET /orders/{order_id} every 1 to 2 seconds.
  2. Stop when status is no longer pending: open means booked, rejected means nothing was booked, and, rarely, deleted.
  3. Give up polling after about 30 seconds and check again later. Reads do not use your order budget.
Never place the order again with a new Idempotency-Key while you are waiting: that would be a second order. See Idempotency and safe retries.

List your orders

GET /orders takes limit (1 to 200, default 50), offset, symbol_code, trade_type and since (ISO 8601; a time without a zone is UTC), and returns items newest first plus total, the number of matching orders. In production it also takes status: pending, open, closing, closed, rejected, deleted or all (the default). all leaves out deleted orders; ask for status=deleted to list those.
200 OK

Which orders you see

In production, GET /orders returns your account’s orders from every channel: the app, the web and the API. source says which. Orders you placed through the API also carry your client_order_id. One exception: a pending or rejected order appears only if it was placed through the API. An order placed in the app that is still being confirmed, or that the hedge refused, is not shown in the app either, so the API answers 404 order_not_found for it. It appears once it is confirmed, as open. The test GET /orders lists only your test orders.

Positions and your weight allocation

GET /positions shows, per metal, what your weight allocation sees:
200 OK
Production adds symbols: one row per symbol with an open position, with the open bought and sold weight and their net, in the metal’s unit. How the allocation works:
  • It is weight, not money. It caps your open exposure in grams or kilograms per metal. A market order, from the API, the web or the app, runs no rupee margin check.
  • Buys and sells net off. An offsetting trade frees allocation again. An order that would take used past limit is refused with 400 limit_exceeded.
  • Reducing your exposure is always allowed, even when used is already above limit (for example after Bullionwale lowered your allocation).
  • Pending orders count. In production, an order still pending already counts towards net.
  • On the test path, GET /positions shows your test book against your real allocation (see Test and production).