GET
/
api
/
v1
/
order
curl --request GET \
  --url https://order.sandbox.rails.xyz/api/v1/order \
  --header 'Authorization: Bearer <token>'
{
  "order": {
    "market": "BTC-USD",
    "orderId": "01HZ36SYBP4Z80GRX30P49XHB5",
    "orderType": "buy",
    "tradeType": "limit",
    "price": "65000",
    "quantity": "0.5",
    "filledQuantity": "0.5",
    "leverage": "1",
    "createdAt": 1717020981622,
    "updatedAt": 1717020982756,
    "orderStatus": "active",
    "clientRequestId": "0835bf3e-4a20-41f0-908d-8213f2b7a285",
    "postOnly": false
  },
  "avgFillPrice": "65000"
}

Polling Order Status

Both this endpoint and the Get Account Open Order By ID endpoint can be used to poll the status of an order. However, there are a few enhancements the current endpoint provides:

  • Recent Cancelled Orders: It returns the most recent cancelled orders, which is not available in the Get Account Open Order By ID endpoint. You should be able to get the order details if the order was cancelled within one hour. The order status will be cancelled in the response.
  • Recent Filled Orders: It returns the most recent filled orders, which is not available in the Get Account Open Order By ID endpoint. You should be able to get the order details if the order was filled within one hour. The order status will be filled in the response.
  • Average Fill Price: It returns the average fill price of the order, which is not available in the Get Account Open Order By ID endpoint. This value will always be present in the response whether the order status is active, cancelled, or filled.

Note that the cancelled or filled order information will no longer be available after one hour and you will get a 404 Not Found response if you try to retrieve the order details after that time.

Order Quantity Fields

In the order object, quantity represents the remaining quantity and filledQuantity represents the cumulative filled quantity. The two values will add up to the original order quantity.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

market
string
required

Example value: ETH-USD. To get all supported markets, call /api/v1/markets endpoint.

orderId
string
required

Example value: 01J4MD3R7N4HH4G76PT47VG3QC. This is the unique identifier of the order. You can get this value from the create order response.

Response

200 - application/json

The response is of type object.