Skip to main content
POST
/
v1
/
orderly_key
Add Orderly key
curl --request POST \
  --url https://api.orderly.org/v1/orderly_key \
  --header 'Content-Type: application/json' \
  --data '
{
  "message": {
    "brokerId": "<string>",
    "chainId": 123,
    "orderlyKey": "<string>",
    "scope": "<string>",
    "timestamp": 123,
    "expiration": 123,
    "chainType": "<string>",
    "tag": "<string>",
    "subAccountId": "<string>"
  },
  "signature": "<string>",
  "userAddress": "<string>"
}
'
import requests

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

payload = {
"message": {
"brokerId": "<string>",
"chainId": 123,
"orderlyKey": "<string>",
"scope": "<string>",
"timestamp": 123,
"expiration": 123,
"chainType": "<string>",
"tag": "<string>",
"subAccountId": "<string>"
},
"signature": "<string>",
"userAddress": "<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({
message: {
brokerId: '<string>',
chainId: 123,
orderlyKey: '<string>',
scope: '<string>',
timestamp: 123,
expiration: 123,
chainType: '<string>',
tag: '<string>',
subAccountId: '<string>'
},
signature: '<string>',
userAddress: '<string>'
})
};

fetch('https://api.orderly.org/v1/orderly_key', 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/orderly_key",
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([
'message' => [
'brokerId' => '<string>',
'chainId' => 123,
'orderlyKey' => '<string>',
'scope' => '<string>',
'timestamp' => 123,
'expiration' => 123,
'chainType' => '<string>',
'tag' => '<string>',
'subAccountId' => '<string>'
],
'signature' => '<string>',
'userAddress' => '<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://api.orderly.org/v1/orderly_key"

payload := strings.NewReader("{\n \"message\": {\n \"brokerId\": \"<string>\",\n \"chainId\": 123,\n \"orderlyKey\": \"<string>\",\n \"scope\": \"<string>\",\n \"timestamp\": 123,\n \"expiration\": 123,\n \"chainType\": \"<string>\",\n \"tag\": \"<string>\",\n \"subAccountId\": \"<string>\"\n },\n \"signature\": \"<string>\",\n \"userAddress\": \"<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://api.orderly.org/v1/orderly_key")
.header("Content-Type", "application/json")
.body("{\n \"message\": {\n \"brokerId\": \"<string>\",\n \"chainId\": 123,\n \"orderlyKey\": \"<string>\",\n \"scope\": \"<string>\",\n \"timestamp\": 123,\n \"expiration\": 123,\n \"chainType\": \"<string>\",\n \"tag\": \"<string>\",\n \"subAccountId\": \"<string>\"\n },\n \"signature\": \"<string>\",\n \"userAddress\": \"<string>\"\n}")
.asString();
require 'uri'
require 'net/http'

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

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 \"message\": {\n \"brokerId\": \"<string>\",\n \"chainId\": 123,\n \"orderlyKey\": \"<string>\",\n \"scope\": \"<string>\",\n \"timestamp\": 123,\n \"expiration\": 123,\n \"chainType\": \"<string>\",\n \"tag\": \"<string>\",\n \"subAccountId\": \"<string>\"\n },\n \"signature\": \"<string>\",\n \"userAddress\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "data": {
    "orderly_key": "ed25519:FRXntsPJBCy6dzKv9WPw4eYSw3rKU9Npz3T6UmvvJc9Z",
    "id": 123
  },
  "timestamp": 1702989203989
}

Body

application/json
message
object
required

Message object containing the message that is signed by the wallet owner

signature
string
required

The signature generated by signing the message object via EIP-712

userAddress
string
required

The address of the wallet signing the message object via EIP-712

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