Skip to main content
POST
/
v1
/
order
Create order
curl --request POST \
  --url https://api.orderly.org/v1/order \
  --header 'Content-Type: application/json' \
  --header 'orderly-account-id: <orderly-account-id>' \
  --header 'orderly-key: <orderly-key>' \
  --header 'orderly-signature: <orderly-signature>' \
  --header 'orderly-timestamp: <orderly-timestamp>' \
  --data '
{
  "symbol": "PERP_ETH_USDC",
  "order_type": "<string>",
  "side": "<string>",
  "client_order_id": "<string>",
  "order_price": 123,
  "order_quantity": 123,
  "order_amount": 123,
  "visible_quantity": 123,
  "reduce_only": true,
  "slippage": 123,
  "order_tag": "<string>",
  "level": 123,
  "post_only_adjust": true
}
'
import requests

url = "https://api.orderly.org/v1/order"

payload = {
"symbol": "PERP_ETH_USDC",
"order_type": "<string>",
"side": "<string>",
"client_order_id": "<string>",
"order_price": 123,
"order_quantity": 123,
"order_amount": 123,
"visible_quantity": 123,
"reduce_only": True,
"slippage": 123,
"order_tag": "<string>",
"level": 123,
"post_only_adjust": True
}
headers = {
"orderly-timestamp": "<orderly-timestamp>",
"orderly-account-id": "<orderly-account-id>",
"orderly-key": "<orderly-key>",
"orderly-signature": "<orderly-signature>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {
'orderly-timestamp': '<orderly-timestamp>',
'orderly-account-id': '<orderly-account-id>',
'orderly-key': '<orderly-key>',
'orderly-signature': '<orderly-signature>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
symbol: 'PERP_ETH_USDC',
order_type: '<string>',
side: '<string>',
client_order_id: '<string>',
order_price: 123,
order_quantity: 123,
order_amount: 123,
visible_quantity: 123,
reduce_only: true,
slippage: 123,
order_tag: '<string>',
level: 123,
post_only_adjust: true
})
};

fetch('https://api.orderly.org/v1/order', 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.orderly.org/v1/order",
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([
'symbol' => 'PERP_ETH_USDC',
'order_type' => '<string>',
'side' => '<string>',
'client_order_id' => '<string>',
'order_price' => 123,
'order_quantity' => 123,
'order_amount' => 123,
'visible_quantity' => 123,
'reduce_only' => true,
'slippage' => 123,
'order_tag' => '<string>',
'level' => 123,
'post_only_adjust' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"orderly-account-id: <orderly-account-id>",
"orderly-key: <orderly-key>",
"orderly-signature: <orderly-signature>",
"orderly-timestamp: <orderly-timestamp>"
],
]);

$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.orderly.org/v1/order"

payload := strings.NewReader("{\n \"symbol\": \"PERP_ETH_USDC\",\n \"order_type\": \"<string>\",\n \"side\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"order_price\": 123,\n \"order_quantity\": 123,\n \"order_amount\": 123,\n \"visible_quantity\": 123,\n \"reduce_only\": true,\n \"slippage\": 123,\n \"order_tag\": \"<string>\",\n \"level\": 123,\n \"post_only_adjust\": true\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("orderly-timestamp", "<orderly-timestamp>")
req.Header.Add("orderly-account-id", "<orderly-account-id>")
req.Header.Add("orderly-key", "<orderly-key>")
req.Header.Add("orderly-signature", "<orderly-signature>")
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.orderly.org/v1/order")
.header("orderly-timestamp", "<orderly-timestamp>")
.header("orderly-account-id", "<orderly-account-id>")
.header("orderly-key", "<orderly-key>")
.header("orderly-signature", "<orderly-signature>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"PERP_ETH_USDC\",\n \"order_type\": \"<string>\",\n \"side\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"order_price\": 123,\n \"order_quantity\": 123,\n \"order_amount\": 123,\n \"visible_quantity\": 123,\n \"reduce_only\": true,\n \"slippage\": 123,\n \"order_tag\": \"<string>\",\n \"level\": 123,\n \"post_only_adjust\": true\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.orderly.org/v1/order")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["orderly-timestamp"] = '<orderly-timestamp>'
request["orderly-account-id"] = '<orderly-account-id>'
request["orderly-key"] = '<orderly-key>'
request["orderly-signature"] = '<orderly-signature>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"symbol\": \"PERP_ETH_USDC\",\n \"order_type\": \"<string>\",\n \"side\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"order_price\": 123,\n \"order_quantity\": 123,\n \"order_amount\": 123,\n \"visible_quantity\": 123,\n \"reduce_only\": true,\n \"slippage\": 123,\n \"order_tag\": \"<string>\",\n \"level\": 123,\n \"post_only_adjust\": true\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "order_id": 13,
    "client_order_id": "testclientid",
    "order_type": "LIMIT",
    "order_price": 100.12,
    "order_quantity": 0.987654,
    "error_message": "none"
  },
  "timestamp": 1702989203989
}

Headers

orderly-timestamp
string
required

Timestamp of the signed request in milliseconds.

orderly-account-id
string
required

Account ID of the authenticated account.

orderly-key
string
required

Public orderly key used to sign the request.

orderly-signature
string
required

Signature of the request payload generated with the orderly key.

x-recv-window
number

Use this parameter to control the timeout threshold for placing order, unit in miliseconds

Body

application/json
symbol
string
required
Example:

"PERP_ETH_USDC"

order_type
string
required

LIMIT/MARKET/IOC/FOK/POST_ONLY/ASK/BID

side
string
required

SELL/BUY

client_order_id
string

36 length, accepts hyphen but cannot be the first character, default: null

order_price
number

If order_type is MARKET/ASK/BID, then is not required, otherwise this parameter is required.

order_quantity
number
order_amount
number

For MARKET/ASK/BID order, the order size in terms of quote currency

visible_quantity
number

The order quantity shown on orderbook. (default: equal to order_quantity) Visible quantity is not supported for post-only orders.

reduce_only
boolean

Default false

slippage
number

MARKET orders beyond this slippage will not be executed

order_tag
string

Optional tag for the order. Supports two formats:

  • Referral code: plain string (e.g., REFERRAL2026) - overrides referral relationship
  • Order tag fee config: enum:<enum_id> (e.g., enum:STRATEGY_DCA) - adds fee on top of existing fees, preserves referral Max length: 36 characters. Cannot be modified after order placement.
level
number

Integer value from 0 to 4. This parameter controls wether to present the price of bid0 to bid4 or ask0 to ask4. Only allowed when order_type is BID or ASK.

post_only_adjust
boolean

If set to true, then price will be adjusted to 1 tick close to current best price. Only supported for POST_ONLY type orders

margin_mode
enum<string>

Margin mode for the order. Default: the symbol's current default margin mode.

Available options:
CROSS,
ISOLATED

Response

200 - application/json

OK

success
boolean
required

Indicates whether the request was successful.

Example:

true

data
object
required
timestamp
integer

Server timestamp in milliseconds.

Example:

1702989203989