curl --request GET \
--url https://order.sandbox.rails.xyz/api/v1/open-orders \
--header 'Authorization: Bearer <token>'import requests
url = "https://order.sandbox.rails.xyz/api/v1/open-orders"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://order.sandbox.rails.xyz/api/v1/open-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://order.sandbox.rails.xyz/api/v1/open-orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://order.sandbox.rails.xyz/api/v1/open-orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://order.sandbox.rails.xyz/api/v1/open-orders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://order.sandbox.rails.xyz/api/v1/open-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"openOrders": [
{
"market": "BTC-USDT",
"orderId": "01HZ36SYBP4Z80GRX30P49XHB6",
"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",
"reduceOnly": false,
"postOnly": false,
"avgFillPrice": "65000"
},
{
"market": "ETH-USDT",
"orderId": "01HZ36SYBP4Z80GRX30P49XHB5",
"orderType": "sell",
"tradeType": "limit",
"price": "3772.272138",
"quantity": "1",
"filledQuantity": "0.5",
"leverage": "1",
"createdAt": 1717020981622,
"updatedAt": 1717020982756,
"orderStatus": "active",
"clientRequestId": "0835bf3e-4a20-41f0-908d-8213f2b7a285",
"reduceOnly": false,
"postOnly": false,
"avgFillPrice": "3772.272138"
}
],
"last": "ETH-USDT#01HYXJVRCTDXQSTKZ17ND2SBJH#c3029869-2609-4a0d-8d9b-b030550add28"
}{
"error": {
"slug": "BAD_REQUEST",
"code": "0006"
},
"message": "invalid market"
}{
"message": "Unauthorized"
}{
"error": {
"slug": "TOO_MANY_REQUESTS",
"code": "0003"
},
"message": "api rate limit exceeded"
}Get Open Orders
This endpoint retrieves the open orders of your account, optionally filtered by market.
curl --request GET \
--url https://order.sandbox.rails.xyz/api/v1/open-orders \
--header 'Authorization: Bearer <token>'import requests
url = "https://order.sandbox.rails.xyz/api/v1/open-orders"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://order.sandbox.rails.xyz/api/v1/open-orders', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://order.sandbox.rails.xyz/api/v1/open-orders",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://order.sandbox.rails.xyz/api/v1/open-orders"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://order.sandbox.rails.xyz/api/v1/open-orders")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://order.sandbox.rails.xyz/api/v1/open-orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"openOrders": [
{
"market": "BTC-USDT",
"orderId": "01HZ36SYBP4Z80GRX30P49XHB6",
"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",
"reduceOnly": false,
"postOnly": false,
"avgFillPrice": "65000"
},
{
"market": "ETH-USDT",
"orderId": "01HZ36SYBP4Z80GRX30P49XHB5",
"orderType": "sell",
"tradeType": "limit",
"price": "3772.272138",
"quantity": "1",
"filledQuantity": "0.5",
"leverage": "1",
"createdAt": 1717020981622,
"updatedAt": 1717020982756,
"orderStatus": "active",
"clientRequestId": "0835bf3e-4a20-41f0-908d-8213f2b7a285",
"reduceOnly": false,
"postOnly": false,
"avgFillPrice": "3772.272138"
}
],
"last": "ETH-USDT#01HYXJVRCTDXQSTKZ17ND2SBJH#c3029869-2609-4a0d-8d9b-b030550add28"
}{
"error": {
"slug": "BAD_REQUEST",
"code": "0006"
},
"message": "invalid market"
}{
"message": "Unauthorized"
}{
"error": {
"slug": "TOO_MANY_REQUESTS",
"code": "0003"
},
"message": "api rate limit exceeded"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Market name. Example value: ETH-USDT. To get all supported markets, call /api/v1/markets endpoint. Omit this parameter to get results across all markets.
This is a parameter to support pagination. Get the value from the last field if present in the previous response.
Response
List of open orders for the account, up to 20 per page. Only orders in an open status (active, pending, cancelling, modifying) are returned.
Show child attributes
Show child attributes
This is a field in the response to support pagination. Use this value if present for the start parameter of the following request to get the next page of results.