Place a LIMIT order batch
curl --request POST \
--url https://mainnet.edel-api.xyz/v1/orders/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"orders": [
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-1",
"side": "buy",
"orderType": "limit",
"price": "65000",
"quantity": "0.001",
"postOnly": false
},
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-2",
"side": "sell",
"orderType": "limit",
"price": "66000",
"quantity": "0.001",
"postOnly": false
}
]
}
'import requests
url = "https://mainnet.edel-api.xyz/v1/orders/batch"
payload = { "orders": [
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-1",
"side": "buy",
"orderType": "limit",
"price": "65000",
"quantity": "0.001",
"postOnly": False
},
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-2",
"side": "sell",
"orderType": "limit",
"price": "66000",
"quantity": "0.001",
"postOnly": False
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
orders: [
{
accountId: '{{accountId}}',
marketId: '{{marketId}}',
clientOrderId: 'example-order-1',
side: 'buy',
orderType: 'limit',
price: '65000',
quantity: '0.001',
postOnly: false
},
{
accountId: '{{accountId}}',
marketId: '{{marketId}}',
clientOrderId: 'example-order-2',
side: 'sell',
orderType: 'limit',
price: '66000',
quantity: '0.001',
postOnly: false
}
]
})
};
fetch('https://mainnet.edel-api.xyz/v1/orders/batch', 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://mainnet.edel-api.xyz/v1/orders/batch",
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([
'orders' => [
[
'accountId' => '{{accountId}}',
'marketId' => '{{marketId}}',
'clientOrderId' => 'example-order-1',
'side' => 'buy',
'orderType' => 'limit',
'price' => '65000',
'quantity' => '0.001',
'postOnly' => false
],
[
'accountId' => '{{accountId}}',
'marketId' => '{{marketId}}',
'clientOrderId' => 'example-order-2',
'side' => 'sell',
'orderType' => 'limit',
'price' => '66000',
'quantity' => '0.001',
'postOnly' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://mainnet.edel-api.xyz/v1/orders/batch"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-1\",\n \"side\": \"buy\",\n \"orderType\": \"limit\",\n \"price\": \"65000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n },\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-2\",\n \"side\": \"sell\",\n \"orderType\": \"limit\",\n \"price\": \"66000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://mainnet.edel-api.xyz/v1/orders/batch")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-1\",\n \"side\": \"buy\",\n \"orderType\": \"limit\",\n \"price\": \"65000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n },\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-2\",\n \"side\": \"sell\",\n \"orderType\": \"limit\",\n \"price\": \"66000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.edel-api.xyz/v1/orders/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-1\",\n \"side\": \"buy\",\n \"orderType\": \"limit\",\n \"price\": \"65000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n },\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-2\",\n \"side\": \"sell\",\n \"orderType\": \"limit\",\n \"price\": \"66000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"version": "external-limit-order-batch/v1",
"outcomes": [
{
"index": 1,
"accepted": true,
"orderId": "<string>",
"accountId": "<string>",
"marketId": "<string>",
"status": "open",
"lastSequence": 1,
"idempotencyKey": "<string>"
}
]
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}Orders
Place a LIMIT order batch
Submits 1 to 32 LIMIT orders in one bounded writer turn. Every entry is decided independently in request order; accepted siblings stay committed when another entry is refused.
Method and path: POST /v1/orders/batch
Authentication: DFNS trader bearer required.
Request schema: ExternalBatchLimitOrderRequest.
Response schema: ExternalBatchLimitOrderResponse.
Error envelope: ExternalRestError (external-rest-error/v1).
POST
/
v1
/
orders
/
batch
Place a LIMIT order batch
curl --request POST \
--url https://mainnet.edel-api.xyz/v1/orders/batch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"orders": [
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-1",
"side": "buy",
"orderType": "limit",
"price": "65000",
"quantity": "0.001",
"postOnly": false
},
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-2",
"side": "sell",
"orderType": "limit",
"price": "66000",
"quantity": "0.001",
"postOnly": false
}
]
}
'import requests
url = "https://mainnet.edel-api.xyz/v1/orders/batch"
payload = { "orders": [
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-1",
"side": "buy",
"orderType": "limit",
"price": "65000",
"quantity": "0.001",
"postOnly": False
},
{
"accountId": "{{accountId}}",
"marketId": "{{marketId}}",
"clientOrderId": "example-order-2",
"side": "sell",
"orderType": "limit",
"price": "66000",
"quantity": "0.001",
"postOnly": False
}
] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
orders: [
{
accountId: '{{accountId}}',
marketId: '{{marketId}}',
clientOrderId: 'example-order-1',
side: 'buy',
orderType: 'limit',
price: '65000',
quantity: '0.001',
postOnly: false
},
{
accountId: '{{accountId}}',
marketId: '{{marketId}}',
clientOrderId: 'example-order-2',
side: 'sell',
orderType: 'limit',
price: '66000',
quantity: '0.001',
postOnly: false
}
]
})
};
fetch('https://mainnet.edel-api.xyz/v1/orders/batch', 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://mainnet.edel-api.xyz/v1/orders/batch",
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([
'orders' => [
[
'accountId' => '{{accountId}}',
'marketId' => '{{marketId}}',
'clientOrderId' => 'example-order-1',
'side' => 'buy',
'orderType' => 'limit',
'price' => '65000',
'quantity' => '0.001',
'postOnly' => false
],
[
'accountId' => '{{accountId}}',
'marketId' => '{{marketId}}',
'clientOrderId' => 'example-order-2',
'side' => 'sell',
'orderType' => 'limit',
'price' => '66000',
'quantity' => '0.001',
'postOnly' => false
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$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://mainnet.edel-api.xyz/v1/orders/batch"
payload := strings.NewReader("{\n \"orders\": [\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-1\",\n \"side\": \"buy\",\n \"orderType\": \"limit\",\n \"price\": \"65000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n },\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-2\",\n \"side\": \"sell\",\n \"orderType\": \"limit\",\n \"price\": \"66000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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://mainnet.edel-api.xyz/v1/orders/batch")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"orders\": [\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-1\",\n \"side\": \"buy\",\n \"orderType\": \"limit\",\n \"price\": \"65000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n },\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-2\",\n \"side\": \"sell\",\n \"orderType\": \"limit\",\n \"price\": \"66000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://mainnet.edel-api.xyz/v1/orders/batch")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"orders\": [\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-1\",\n \"side\": \"buy\",\n \"orderType\": \"limit\",\n \"price\": \"65000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n },\n {\n \"accountId\": \"{{accountId}}\",\n \"marketId\": \"{{marketId}}\",\n \"clientOrderId\": \"example-order-2\",\n \"side\": \"sell\",\n \"orderType\": \"limit\",\n \"price\": \"66000\",\n \"quantity\": \"0.001\",\n \"postOnly\": false\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"version": "external-limit-order-batch/v1",
"outcomes": [
{
"index": 1,
"accepted": true,
"orderId": "<string>",
"accountId": "<string>",
"marketId": "<string>",
"status": "open",
"lastSequence": 1,
"idempotencyKey": "<string>"
}
]
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "invalid_request",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"rejectionGuard": "amount_atoms_invalid",
"withdrawalFailure": "requested",
"dependency": "dfns"
}Authorizations
The authorization field takes the session bearer returned by sign-in, or an API key where the route allows keys. Paste the token itself into the authorization field.
Headers
Minimum string length:
1Body
application/json
Required array length:
1 - 32 elementsShow child attributes
Show child attributes