BULLIONWALE_API_KEY environment variable (see the quickstart).
The order request
POST /orders places a market order at the current price. The body:
Send
quantity and expected_price as JSON numbers. Responses return them, and every other amount, as strings.
The Idempotency-Key header is required: 1 to 64 characters, a new UUID per order. A missing or empty header is 400 idempotency_key_required; one longer than 64 characters is 422 invalid_request. See Idempotency and safe retries.
Place the order
201 Created
Send it again with the same key
Sending the same request with the sameIdempotency-Key does not place a second order. You get the existing order back with status 200 and the response header Idempotent-Replayed: true. This is what makes a retry after a timeout safe.
200 OK (Idempotent-Replayed: true)
expected_price or client_order_id) books nothing and is refused:
curl
422 Unprocessable Entity
List your orders
GET /orders returns your test orders, newest first, with the total number that match.
200 OK
Read your test positions
200 OK
Try the common errors
Every refusal is an HTTP status with a JSON body whosedetail.code you can branch on. The full list is in Errors.
No key. Every call needs the X-API-Key header.
curl
401 Unauthorized
curl
401 Unauthorized
Idempotency-Key header on an order:
curl
400 Bad Request
Idempotency-Key longer than 64 characters:
curl
422 Unprocessable Entity
orders:write placing an order:
curl
403 Forbidden
curl
404 Not Found
curl
400 Bad Request
errors list says which field is wrong:
curl
422 Unprocessable Entity
curl
404 Not Found