400 limit_exceeded. It is weight, not money: there is no cash balance, no margin and no rupee limit. GET /limits shows the allocation and how much of it is used, so your program can size an order before it sends it.
The limits object
One entry per metal,gold and silver:
Every weight is a decimal string with 4 decimals, such as
"960.0000". Parse it as a decimal, not a float. The unit is the metal’s: gold in grams and silver in kilograms, whatever symbol you trade (see Units and pricing).
Read your limits
200 OK
How the allocation is applied
- It caps open exposure, not turnover. Buys and sells net off: after buying 40 g and selling 40 g of gold,
usedis back to0.0000. - An order that adds exposure must fit in
free. Withfreeat960.0000g, a 1,000 g gold buy is refused with400 limit_exceeded; a 960 g buy is accepted. - An order that reduces exposure is always allowed, even when
usedis abovelimit(for example after Bullionwale lowered your allocation). With a net long of 40 g, a 40 g sell always goes through. - Pending orders count. In production, an order still
pendingalready counts towardsused. - Resting limit orders do not hold allocation. They count only when they trigger and book;
reservedshows what they would need, so keep that muchfreeif you want them all to be able to fire. When a limit order triggers, it is checked against your allocation at that moment, like a market order (see Limit orders). - No allocation, no trading. An account without an allocation shows
0.0000for both metals and cannot open a position.
Test and production
Both environments return your real allocation aslimit. In production, used, free and reserved describe your real position and your real resting limit orders.
In test, used, free and reserved come from your test book: your test orders (the same net position as the test GET /positions, see Positions) and your pending test limit orders. That is exactly how a test order’s weight check works, so test free is the room a test order has: a test buy larger than free is refused with 400 limit_exceeded, quoting the same figure. Real orders never change the test numbers, and test orders never change the production ones.
Errors
GET /limits itself refuses nothing else. The refusal it helps you avoid is 400 limit_exceeded on POST /orders. Every code is in the Error reference.