PATCH /v2/trade/perps/orders/{id}: Modify an Order
curl --request PATCH \
--url https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id} \
--header 'Content-Type: application/json' \
--data '
{
"price": "<string>",
"quantity": "<string>"
}
'import requests
url = "https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}"
payload = {
"price": "<string>",
"quantity": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({price: '<string>', quantity: '<string>'})
};
fetch('https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}', 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://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'price' => '<string>',
'quantity' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}"
payload := strings.NewReader("{\n \"price\": \"<string>\",\n \"quantity\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"<string>\",\n \"quantity\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": \"<string>\",\n \"quantity\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyPerps
PATCH /v2/trade/perps/orders/{id}: Modify an Order
Change the price and/or quantity of an open Polymarket Perps order. Scope trade.perps.
PATCH
/
v2
/
trade
/
perps
/
orders
/
{id}
PATCH /v2/trade/perps/orders/{id}: Modify an Order
curl --request PATCH \
--url https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id} \
--header 'Content-Type: application/json' \
--data '
{
"price": "<string>",
"quantity": "<string>"
}
'import requests
url = "https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}"
payload = {
"price": "<string>",
"quantity": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({price: '<string>', quantity: '<string>'})
};
fetch('https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}', 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://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'price' => '<string>',
'quantity' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}"
payload := strings.NewReader("{\n \"price\": \"<string>\",\n \"quantity\": \"<string>\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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.patch("https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}")
.header("Content-Type", "application/json")
.body("{\n \"price\": \"<string>\",\n \"quantity\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"price\": \"<string>\",\n \"quantity\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodySign each request with a fresh HMAC signature. The cURL and HTTP header values below are placeholders, not reusable credentials. For runnable signing code, use request signing examples.
trade.perps; Idempotency-Key is honoured.
This feature rolls out in stages: until it is live, the route answers 409 PERPS_CAPABILITY_UNAVAILABLE with reason: "orders_modify" and Retry-After: 60. Nothing reached the venue; retry later with the same Idempotency-Key.
PATCH https://partner-api.bravadotrade.com/v2/trade/perps/orders/{id}
Path Parameters
string
required
The order: venue
order_id, coid:<32 hex>, ik:<Idempotency-Key> or intent_id, as on GET /v2/trade/perps/orders/{id}.Body
At least one of the two.string
New limit price, decimal string.
string
New total quantity, decimal string.
Errors
| Status | When |
|---|---|
404 Not Found | NOT_FOUND: unknown id, or one that belongs to another user |
409 Conflict | MODIFY_REJECTED: the venue refused the modify; reason says why |
409 Conflict | ORDER_TERMINAL: the order is already filled or cancelled |
409 Conflict | ORDER_IN_FLIGHT: the order is changing at the venue; Retry-After: 1 |
409 Conflict | PERPS_CAPABILITY_UNAVAILABLE with reason: "orders_modify": not live yet |
422 Unprocessable Entity | MODIFY_WOULD_CROSS: the modified price would cross the book |
Example
curl -X PATCH https://partner-api.bravadotrade.com/v2/trade/perps/orders/184467440737 \
-H "X-BRAVADO-API-KEY: $BRAVADO_API_KEY" \
-H "X-BRAVADO-TIMESTAMP: <unix-ms>" \
-H "X-BRAVADO-SIGNATURE: <signature-for-this-request>" \
-H "Idempotency-Key: 3d9e2b7c-perps-modify-0001" \
-H "Content-Type: application/json" \
-d '{ "price": "81200" }'
Related
DELETE /v2/trade/perps/orders/{id}to cancel instead.