POST /v2/trade/perps/orders: Place an Order
curl --request POST \
--url https://partner-api.bravadotrade.com/v2/trade/perps/orders \
--header 'Content-Type: application/json' \
--data '
{
"instrument_id": 123,
"symbol": "<string>",
"side": "<string>",
"quantity": "<string>",
"price": "<string>",
"tif": "<string>",
"post_only": true,
"reduce_only": true,
"take_profit": {
"trigger_price": "<string>",
"price": "<string>"
},
"stop_loss": {
"trigger_price": "<string>",
"price": "<string>"
},
"client_order_id": "<string>"
}
'import requests
url = "https://partner-api.bravadotrade.com/v2/trade/perps/orders"
payload = {
"instrument_id": 123,
"symbol": "<string>",
"side": "<string>",
"quantity": "<string>",
"price": "<string>",
"tif": "<string>",
"post_only": True,
"reduce_only": True,
"take_profit": {
"trigger_price": "<string>",
"price": "<string>"
},
"stop_loss": {
"trigger_price": "<string>",
"price": "<string>"
},
"client_order_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
instrument_id: 123,
symbol: '<string>',
side: '<string>',
quantity: '<string>',
price: '<string>',
tif: '<string>',
post_only: true,
reduce_only: true,
take_profit: {trigger_price: '<string>', price: '<string>'},
stop_loss: {trigger_price: '<string>', price: '<string>'},
client_order_id: '<string>'
})
};
fetch('https://partner-api.bravadotrade.com/v2/trade/perps/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://partner-api.bravadotrade.com/v2/trade/perps/orders",
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([
'instrument_id' => 123,
'symbol' => '<string>',
'side' => '<string>',
'quantity' => '<string>',
'price' => '<string>',
'tif' => '<string>',
'post_only' => true,
'reduce_only' => true,
'take_profit' => [
'trigger_price' => '<string>',
'price' => '<string>'
],
'stop_loss' => [
'trigger_price' => '<string>',
'price' => '<string>'
],
'client_order_id' => '<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"
payload := strings.NewReader("{\n \"instrument_id\": 123,\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"tif\": \"<string>\",\n \"post_only\": true,\n \"reduce_only\": true,\n \"take_profit\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"client_order_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://partner-api.bravadotrade.com/v2/trade/perps/orders")
.header("Content-Type", "application/json")
.body("{\n \"instrument_id\": 123,\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"tif\": \"<string>\",\n \"post_only\": true,\n \"reduce_only\": true,\n \"take_profit\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"client_order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner-api.bravadotrade.com/v2/trade/perps/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"instrument_id\": 123,\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"tif\": \"<string>\",\n \"post_only\": true,\n \"reduce_only\": true,\n \"take_profit\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"client_order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"order_id": "184467440737",
"client_order_id": "user-42-entry-1",
"status": "accepted",
"venue_status": null,
"reduce_only_applied": false,
"reduce_only_forced": false,
"quantity_capped": false
}
{
"status": "pending_confirmation",
"intent_id": "coid:ec3b49658da8ac0006f1198abb8a3bc0",
"client_order_id": "user-42-entry-1",
"retry_after_ms": 2000
}
Perps
POST /v2/trade/perps/orders: Place an Order
Place a Polymarket Perps order for the user, including reduce-only closes and attached take-profit / stop-loss. Answers 201, or 202 pending_confirmation when the outcome is not yet known. Scope trade.perps.
POST
/
v2
/
trade
/
perps
/
orders
POST /v2/trade/perps/orders: Place an Order
curl --request POST \
--url https://partner-api.bravadotrade.com/v2/trade/perps/orders \
--header 'Content-Type: application/json' \
--data '
{
"instrument_id": 123,
"symbol": "<string>",
"side": "<string>",
"quantity": "<string>",
"price": "<string>",
"tif": "<string>",
"post_only": true,
"reduce_only": true,
"take_profit": {
"trigger_price": "<string>",
"price": "<string>"
},
"stop_loss": {
"trigger_price": "<string>",
"price": "<string>"
},
"client_order_id": "<string>"
}
'import requests
url = "https://partner-api.bravadotrade.com/v2/trade/perps/orders"
payload = {
"instrument_id": 123,
"symbol": "<string>",
"side": "<string>",
"quantity": "<string>",
"price": "<string>",
"tif": "<string>",
"post_only": True,
"reduce_only": True,
"take_profit": {
"trigger_price": "<string>",
"price": "<string>"
},
"stop_loss": {
"trigger_price": "<string>",
"price": "<string>"
},
"client_order_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
instrument_id: 123,
symbol: '<string>',
side: '<string>',
quantity: '<string>',
price: '<string>',
tif: '<string>',
post_only: true,
reduce_only: true,
take_profit: {trigger_price: '<string>', price: '<string>'},
stop_loss: {trigger_price: '<string>', price: '<string>'},
client_order_id: '<string>'
})
};
fetch('https://partner-api.bravadotrade.com/v2/trade/perps/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://partner-api.bravadotrade.com/v2/trade/perps/orders",
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([
'instrument_id' => 123,
'symbol' => '<string>',
'side' => '<string>',
'quantity' => '<string>',
'price' => '<string>',
'tif' => '<string>',
'post_only' => true,
'reduce_only' => true,
'take_profit' => [
'trigger_price' => '<string>',
'price' => '<string>'
],
'stop_loss' => [
'trigger_price' => '<string>',
'price' => '<string>'
],
'client_order_id' => '<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"
payload := strings.NewReader("{\n \"instrument_id\": 123,\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"tif\": \"<string>\",\n \"post_only\": true,\n \"reduce_only\": true,\n \"take_profit\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"client_order_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://partner-api.bravadotrade.com/v2/trade/perps/orders")
.header("Content-Type", "application/json")
.body("{\n \"instrument_id\": 123,\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"tif\": \"<string>\",\n \"post_only\": true,\n \"reduce_only\": true,\n \"take_profit\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"client_order_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://partner-api.bravadotrade.com/v2/trade/perps/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"instrument_id\": 123,\n \"symbol\": \"<string>\",\n \"side\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"tif\": \"<string>\",\n \"post_only\": true,\n \"reduce_only\": true,\n \"take_profit\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"stop_loss\": {\n \"trigger_price\": \"<string>\",\n \"price\": \"<string>\"\n },\n \"client_order_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"order_id": "184467440737",
"client_order_id": "user-42-entry-1",
"status": "accepted",
"venue_status": null,
"reduce_only_applied": false,
"reduce_only_forced": false,
"quantity_capped": false
}
{
"status": "pending_confirmation",
"intent_id": "coid:ec3b49658da8ac0006f1198abb8a3bc0",
"client_order_id": "user-42-entry-1",
"retry_after_ms": 2000
}
Sign 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 required. The user’s readiness must be ready or credential_expiring.
Every order rule is checked before the order reaches the venue; see Limits.
POST https://partner-api.bravadotrade.com/v2/trade/perps/orders
Body
integer
The venue instrument id. Send this or
symbol.string
Alias of
instrument_id, for example BTC-USD.string
required
buy (long) or sell (short).string
required
Base-asset quantity (for example BTC, not pUSD), decimal string.
string
Limit price. Omit for a market-style order. At most
price_decimals decimal places, a non-integer price has at most 5 significant figures, and |price − mark_price| ≤ mark_price × price_bounds.string
gtc, ioc or fok. Defaults to gtc with a price and ioc without.boolean
Requires
tif: "gtc" and a price.boolean
Only reduce the position. See Close a position.
object
object
string
Your label, up to 64 characters. Echoed back; never sent to the venue.
Response
The answer is one of two.201: the venue answered.
string | null
The venue’s order id.
null when nothing was placed (venue_status: "not_placed").string
Your label, echoed back.
string
accepted, open, partially_filled, filled, cancelled, rejected or unknown (a venue status Bravado does not map).string | null
The venue’s raw status string.
string
For an IOC, FOK or post-only order, when the read-back resolves in time.
boolean
true when the order went to the venue reduce-only.boolean
true when your integration’s reduce-only mode turned the order reduce-only.boolean
true when reduce-only mode capped the quantity at the position size.status and filled_size are the venue’s when the read-back resolves in time. If it does not, the 201 says accepted, with venue_status: null and no filled_size: read GET /v2/trade/perps/orders/{order_id} for the outcome.
202 pending_confirmation: the venue may or may not have the order.
string
pending_confirmation.string
Read the order by this id.
string
Your label, echoed back.
integer
Wait this long before the first read.
GET /v2/trade/perps/orders/{intent_id} after retry_after_ms until status is open or terminal. An order that never reached the venue ends as rejected with venue_status: "not_placed". Replaying the request with the same Idempotency-Key returns the same 202.
To find an order you placed, read GET /v2/trade/perps/orders/ik:<your Idempotency-Key>. A read of a placed order returns the venue’s view, whose client_order_id is the order’s coid rather than your label, so keep your own map from label to order_id.
{
"order_id": "184467440737",
"client_order_id": "user-42-entry-1",
"status": "accepted",
"venue_status": null,
"reduce_only_applied": false,
"reduce_only_forced": false,
"quantity_capped": false
}
{
"status": "pending_confirmation",
"intent_id": "coid:ec3b49658da8ac0006f1198abb8a3bc0",
"client_order_id": "user-42-entry-1",
"retry_after_ms": 2000
}
Close a position
To close, send the opposite side withreduce_only: true. A reduce-only order can only shrink the position; one that would increase or flip it is refused with 422 REDUCE_ONLY_VIOLATION.
// POST /v2/trade/perps/orders
// Idempotency-Key: 2c7f5a9d-perps-close-0001
// Long position of 0.002 on instrument 1: close all of it at market
{
"instrument_id": 1,
"side": "sell",
"quantity": "0.002",
"reduce_only": true
}
- A close is exempt from
min_notional. A close is a reduce-only order against the position, no larger than it, and it may be worth less thanmin_notional. The venue has accepted such a close when what it leaves open is still worth at leastmin_notional; whether it accepts a whole-position close belowmin_notionalis the venue’s call. If the venue does refuse a close, you get400 INVALID_SIZE, or a201withstatus: "rejected"andvenue_status: "below_min_notional". Neither is ever reported as filled. - A partial close may not leave dust. A partial close is refused before the venue with
400 INVALID_SIZEwhen what it leaves open,(position size − quantity) × mark price, would be worth less thanmin_notional. The refusal carriesdetails.rule: "reduce_only_remainder_below_min_notional"and the numbers as decimal strings:details.position_size,details.remainderanddetails.min_notional. To close the whole position instead, sendquantity: details.position_size. - On a
201,reduce_only_applied: truesays the order went to the venue reduce-only.
Errors
| Status | When |
|---|---|
400 Bad Request | INVALID_PRICE, INVALID_SIZE, INVALID_BODY: the order breaks a rule in Limits; details.rule names it when Bravado enforced it |
403 Forbidden | INSTRUMENT_NOT_ALLOWED: outside your allowlist; or reason: "close_only", an open on an instrument the venue made close-only; or reason: "no_policy", Perps is not configured for your integration yet |
403 Forbidden | REDUCE_ONLY_MODE: your integration is in reduce-only mode; only closes are accepted |
409 Conflict | NOTIONAL_CAP_EXCEEDED, LEVERAGE_CAP_EXCEEDED: above your integration’s caps |
409 Conflict | USER_PROVISIONING_PENDING: the user is not ready, for example reason: "needs_deposit", "attestation_stale" or "credential_expired" |
409 Conflict | PERPS_HALTED: Bravado has halted perps opens; reduce-only orders and closes keep working |
409 Conflict | VENUE_CANCEL_ONLY: the venue is cancel-only (for example, maintenance); Retry-After: 60 |
409 Conflict | ACCOUNT_IN_LIQUIDATION: the venue is liquidating the account; opens are refused |
409 Conflict | ACTIVE_LIMIT_EXCEEDED: too many open orders |
422 Unprocessable Entity | INSUFFICIENT_MARGIN: not enough margin for the order |
422 Unprocessable Entity | REDUCE_ONLY_VIOLATION: a reduce_only order would increase or flip the position |
422 Unprocessable Entity | MARKET_REJECTED: the instrument is close-only or settled |
504 is an unknown outcome: look the order up at GET /v2/trade/perps/orders/ik:<your key> before anything else.
Example
curl -X POST https://partner-api.bravadotrade.com/v2/trade/perps/orders \
-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: 4e8b1d6a-perps-order-0001" \
-H "Content-Type: application/json" \
-d '{
"instrument_id": 1,
"side": "buy",
"quantity": "0.002",
"price": "81478",
"client_order_id": "user-42-entry-1"
}'
Related
GET /v2/trade/perps/ordersfor open orders, or one order.PATCH /v2/trade/perps/leverage: leverage is set per instrument, not on the order.