GET /v2/order/detail and GET /v2/orders return the state of an order in the integer field orderStatus. Ramp orders (fiat_to_crypto and crypto_to_fiat) and global payment orders (fiat_to_fiat) use two different sets of codes.
Ramp orders (fiat_to_crypto, crypto_to_fiat)
A new order created through the API normally starts in
10, 11, 31, 32 (crypto_to_fiat only) or 40. For a crypto_to_fiat order, if your crypto balance does not cover the order when you create it, the request is rejected with -1131 (Balance insufficient) and no order is created, unless post-funded off-ramp is enabled for your account; then the order starts in 32. In rare cases, when the balance changes between the check and the debit, the order is created and then cancelled (70).
GET /v2/orders lists every order on your account for the requested orderType, not only orders you created through the API. Orders that VelaFi creates for your account (not through the API or the dashboard) can also show 20 (review rejected) or 30 (approved). Orders created through the API skip these two codes. When approved, they normally move from 10 to 31, 32 or 40; if the price has moved below VelaFi’s minimum rate by the time of approval, the order is cancelled instead (70, or 71 first as described above). A review rejection is reported as 80 (or 71 first, as described above).How internal statuses are reported
VelaFi stores a few internal statuses that the API reports under another code. You never receive0, 90, 91 or 92 for a ramp order:
Global payment orders (fiat_to_fiat)
How internal statuses are reported
Some internal statuses are reported under another code:Filtering by status
GET /v2/orders accepts an orderStatus filter. 0 (the default) returns all statuses.
- Ramp orders: filter by any code in the ramp table.
10,70and80also match the internal statuses reported under them, so the results match theorderStatusyou see. - Global payment orders: the filter is applied to the stored status, not the reported one.
10,11,12,60and72match exactly.41and51can also return orders reported as31. Filtering by31,71or90does not return exactly the orders reported with that code.
Webhooks
Webhook payloads use their own status mapping. For example, ramp orders in80 or 81 are pushed as 70. See the webhook pages, for example the fiat/crypto order push, for the pushed values.