Test limit orders are checked like real ones but never trigger: they rest until you cancel them. Production limit orders are real, and production trading is switched off today, so production placements, edits and cancels are refused with
403 production_trading_disabled. Reads work in both environments.orders:write (to place, edit and cancel) and orders:read (to read limit orders back), plus rates:read to look up your price first. See the Scope reference.
1. Choose a trigger price
A limit order must wait. Look up your current price for the symbol withGET /rates/{symbol_code} (see Market data), then pick a trigger on the far side of it:
A trigger the market has already reached is refused with
400 limit_would_execute: use a market order (POST /orders) to trade at the current price instead.
trigger_price is per the symbol’s quoted measure (per 10 grams for gold, per kilogram for silver), and quantity is a weight in the symbol’s measure, as for market orders. See Units and pricing.
2. Place it, with an Idempotency-Key
SendPOST /limit-orders with a new Idempotency-Key (a UUID) and store the key with your own record before you send it. If the request times out, send it again with the same key and body: you get the same limit order back (200, Idempotent-Replayed: true), never a second one. Limit-order keys are separate from market-order keys.
3. Watch it
Read it withGET /limit-orders/{limit_order_id}, or list the resting ones with GET /limit-orders?status=pending. While it is pending, actions is ["edit", "cancel"].
In production, also read blocked_reason. When it is not null, the limit order would not be booked if the price arrived now, for example because your weight allocation has no room for it. It is worked out again on every read, so it clears by itself once the cause is resolved.
4. Edit or cancel it
- Edit with
PATCH /limit-orders/{limit_order_id}and a newtrigger_price,quantity, or both. The new values face the placement’s rules; a larger quantity must also fit your weight allocation now. - Cancel with
DELETE /limit-orders/{limit_order_id}. It answers the limit order,cancelled.
pending limit order.
This script runs steps 1 to 4 against the test environment: it reads your Buy price, places a buy limit 10% below it, reads it back, lowers its trigger, and cancels it.
Python
5. When it triggers (production)
When your price reaches the trigger, Bullionwale books a market order at that moment’s price, so a buy can book below your trigger and a sell above it if the price moved past it between checks. The limit order becomestriggered, and its order_id names the order: read it with GET /orders/{order_id} for its deal_no, booked price and total.
Your weight allocation is checked at that moment, not when you placed the limit order. If it has no room then (or the symbol has stopped trading, or the quantity no longer meets the rules, or there is no stock), the limit order is cancelled with the reason in cancel_reason, for example not enough free limit when the price triggered. It does not wait and try again: place a new limit order once the cause is resolved.
A trading halt, a frozen price or a missing live price does not cancel it: it keeps resting and triggers once the price is live again.
Handling the answers safely
A cancel that arrives just as the price triggers is settled one way or the other, never both: the limit order is either
cancelled or triggered with its order.