Modify Order
curl --request POST \
--url https://api-options.sandbox.rails.xyz/v1/matching/orders/modify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientRequestId": "9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55",
"order": {
"orderId": "01JRQM8H5XYZABCDEFGHJKMNPQ",
"contract": "BTC-7FEB26-100000-C",
"price": "1300",
"quantity": "2"
}
}
'import requests
url = "https://api-options.sandbox.rails.xyz/v1/matching/orders/modify"
payload = {
"clientRequestId": "9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55",
"order": {
"orderId": "01JRQM8H5XYZABCDEFGHJKMNPQ",
"contract": "BTC-7FEB26-100000-C",
"price": "1300",
"quantity": "2"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientRequestId: '9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55',
order: {
orderId: '01JRQM8H5XYZABCDEFGHJKMNPQ',
contract: 'BTC-7FEB26-100000-C',
price: '1300',
quantity: '2'
}
})
};
fetch('https://api-options.sandbox.rails.xyz/v1/matching/orders/modify', 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://api-options.sandbox.rails.xyz/v1/matching/orders/modify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientRequestId' => '9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55',
'order' => [
'orderId' => '01JRQM8H5XYZABCDEFGHJKMNPQ',
'contract' => 'BTC-7FEB26-100000-C',
'price' => '1300',
'quantity' => '2'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-options.sandbox.rails.xyz/v1/matching/orders/modify"
payload := strings.NewReader("{\n \"clientRequestId\": \"9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55\",\n \"order\": {\n \"orderId\": \"01JRQM8H5XYZABCDEFGHJKMNPQ\",\n \"contract\": \"BTC-7FEB26-100000-C\",\n \"price\": \"1300\",\n \"quantity\": \"2\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-options.sandbox.rails.xyz/v1/matching/orders/modify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientRequestId\": \"9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55\",\n \"order\": {\n \"orderId\": \"01JRQM8H5XYZABCDEFGHJKMNPQ\",\n \"contract\": \"BTC-7FEB26-100000-C\",\n \"price\": \"1300\",\n \"quantity\": \"2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-options.sandbox.rails.xyz/v1/matching/orders/modify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientRequestId\": \"9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55\",\n \"order\": {\n \"orderId\": \"01JRQM8H5XYZABCDEFGHJKMNPQ\",\n \"contract\": \"BTC-7FEB26-100000-C\",\n \"price\": \"1300\",\n \"quantity\": \"2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"queued": true,
"accepted": false,
"body": "order queued, pending acceptance",
"action": "modify",
"messageId": "1770000000000-0",
"clientRequestId": "9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55",
"contract": "BTC-7FEB26-100000-C",
"orderId": "01JRQM8H5XYZABCDEFGHJKMNPQ"
}{
"error": "orderId is required for modify"
}{
"error": "unauthorized"
}{
"error": "read-only token cannot create orders"
}{
"error": "api rate limit exceeded"
}{
"error": "matching service unavailable"
}{
"error": "matching service timed out"
}Orders
Modify Order
Change the price and quantity of an open order.
POST
/
v1
/
matching
/
orders
/
modify
Modify Order
curl --request POST \
--url https://api-options.sandbox.rails.xyz/v1/matching/orders/modify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientRequestId": "9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55",
"order": {
"orderId": "01JRQM8H5XYZABCDEFGHJKMNPQ",
"contract": "BTC-7FEB26-100000-C",
"price": "1300",
"quantity": "2"
}
}
'import requests
url = "https://api-options.sandbox.rails.xyz/v1/matching/orders/modify"
payload = {
"clientRequestId": "9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55",
"order": {
"orderId": "01JRQM8H5XYZABCDEFGHJKMNPQ",
"contract": "BTC-7FEB26-100000-C",
"price": "1300",
"quantity": "2"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
clientRequestId: '9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55',
order: {
orderId: '01JRQM8H5XYZABCDEFGHJKMNPQ',
contract: 'BTC-7FEB26-100000-C',
price: '1300',
quantity: '2'
}
})
};
fetch('https://api-options.sandbox.rails.xyz/v1/matching/orders/modify', 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://api-options.sandbox.rails.xyz/v1/matching/orders/modify",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'clientRequestId' => '9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55',
'order' => [
'orderId' => '01JRQM8H5XYZABCDEFGHJKMNPQ',
'contract' => 'BTC-7FEB26-100000-C',
'price' => '1300',
'quantity' => '2'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api-options.sandbox.rails.xyz/v1/matching/orders/modify"
payload := strings.NewReader("{\n \"clientRequestId\": \"9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55\",\n \"order\": {\n \"orderId\": \"01JRQM8H5XYZABCDEFGHJKMNPQ\",\n \"contract\": \"BTC-7FEB26-100000-C\",\n \"price\": \"1300\",\n \"quantity\": \"2\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api-options.sandbox.rails.xyz/v1/matching/orders/modify")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"clientRequestId\": \"9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55\",\n \"order\": {\n \"orderId\": \"01JRQM8H5XYZABCDEFGHJKMNPQ\",\n \"contract\": \"BTC-7FEB26-100000-C\",\n \"price\": \"1300\",\n \"quantity\": \"2\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-options.sandbox.rails.xyz/v1/matching/orders/modify")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"clientRequestId\": \"9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55\",\n \"order\": {\n \"orderId\": \"01JRQM8H5XYZABCDEFGHJKMNPQ\",\n \"contract\": \"BTC-7FEB26-100000-C\",\n \"price\": \"1300\",\n \"quantity\": \"2\"\n }\n}"
response = http.request(request)
puts response.read_body{
"queued": true,
"accepted": false,
"body": "order queued, pending acceptance",
"action": "modify",
"messageId": "1770000000000-0",
"clientRequestId": "9f1c2c9e-3f4a-4a4e-9f10-2b7d3f2a1c55",
"contract": "BTC-7FEB26-100000-C",
"orderId": "01JRQM8H5XYZABCDEFGHJKMNPQ"
}{
"error": "orderId is required for modify"
}{
"error": "unauthorized"
}{
"error": "read-only token cannot create orders"
}{
"error": "api rate limit exceeded"
}{
"error": "matching service unavailable"
}{
"error": "matching service timed out"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Always true.
Always false.
Always modify.
Contract name.
Unique identifier for the order.
Always order queued, pending acceptance.
Identifier assigned to the queued request.
Client-generated UUID for correlation.
⌘I