Create one CCXT order
curl --request POST \
--url https://testnet.edel-api.xyz/v2/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"symbol": "BTC/USD:USD.E",
"type": "limit",
"side": "buy",
"amount": 0.001,
"price": 65000,
"params": {
"clientOrderId": "ccxt-example-1",
"postOnly": false
}
}
'import requests
url = "https://testnet.edel-api.xyz/v2/order"
payload = {
"symbol": "BTC/USD:USD.E",
"type": "limit",
"side": "buy",
"amount": 0.001,
"price": 65000,
"params": {
"clientOrderId": "ccxt-example-1",
"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({
symbol: 'BTC/USD:USD.E',
type: 'limit',
side: 'buy',
amount: 0.001,
price: 65000,
params: {clientOrderId: 'ccxt-example-1', postOnly: false}
})
};
fetch('https://testnet.edel-api.xyz/v2/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://testnet.edel-api.xyz/v2/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' => 'BTC/USD:USD.E',
'type' => 'limit',
'side' => 'buy',
'amount' => 0.001,
'price' => 65000,
'params' => [
'clientOrderId' => 'ccxt-example-1',
'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://testnet.edel-api.xyz/v2/order"
payload := strings.NewReader("{\n \"symbol\": \"BTC/USD:USD.E\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"amount\": 0.001,\n \"price\": 65000,\n \"params\": {\n \"clientOrderId\": \"ccxt-example-1\",\n \"postOnly\": false\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://testnet.edel-api.xyz/v2/order")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"BTC/USD:USD.E\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"amount\": 0.001,\n \"price\": 65000,\n \"params\": {\n \"clientOrderId\": \"ccxt-example-1\",\n \"postOnly\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.edel-api.xyz/v2/order")
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 \"symbol\": \"BTC/USD:USD.E\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"amount\": 0.001,\n \"price\": 65000,\n \"params\": {\n \"clientOrderId\": \"ccxt-example-1\",\n \"postOnly\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"symbol": "<string>",
"status": "open",
"info": {
"version": "external-order/v1",
"orderId": "<string>",
"accountId": "<string>",
"marketId": "<string>",
"status": "open",
"lastSequence": 1,
"idempotencyKey": "<string>",
"cancelReason": "margin_unbacked"
},
"clientOrderId": "<string>",
"timestamp": 1,
"datetime": "<string>",
"side": "buy",
"type": "limit",
"timeInForce": "GTC",
"price": 123,
"amount": 1,
"filled": 1,
"remaining": 1,
"reduceOnly": true,
"postOnly": true
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}CCXT v2
Create one CCXT order
Translates one CCXT unified LIMIT or MARKET order into the existing single-order handler. Known request fields are combined with the thin accepted-order response without inventing fill data. A caller-supplied timeInForce is recognized only to return HTTP 501 NotSupported until the public order request can represent it.
Method and path: POST /v2/order
Authentication: DFNS trader bearer required.
Request schema: CcxtV2CreateOrderRequest.
Response schema: CcxtV2Order.
Error envelope: CcxtV2ErrorResponse (contains ExternalRestError external-rest-error/v1 as info).
POST
/
v2
/
order
Create one CCXT order
curl --request POST \
--url https://testnet.edel-api.xyz/v2/order \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"symbol": "BTC/USD:USD.E",
"type": "limit",
"side": "buy",
"amount": 0.001,
"price": 65000,
"params": {
"clientOrderId": "ccxt-example-1",
"postOnly": false
}
}
'import requests
url = "https://testnet.edel-api.xyz/v2/order"
payload = {
"symbol": "BTC/USD:USD.E",
"type": "limit",
"side": "buy",
"amount": 0.001,
"price": 65000,
"params": {
"clientOrderId": "ccxt-example-1",
"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({
symbol: 'BTC/USD:USD.E',
type: 'limit',
side: 'buy',
amount: 0.001,
price: 65000,
params: {clientOrderId: 'ccxt-example-1', postOnly: false}
})
};
fetch('https://testnet.edel-api.xyz/v2/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://testnet.edel-api.xyz/v2/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' => 'BTC/USD:USD.E',
'type' => 'limit',
'side' => 'buy',
'amount' => 0.001,
'price' => 65000,
'params' => [
'clientOrderId' => 'ccxt-example-1',
'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://testnet.edel-api.xyz/v2/order"
payload := strings.NewReader("{\n \"symbol\": \"BTC/USD:USD.E\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"amount\": 0.001,\n \"price\": 65000,\n \"params\": {\n \"clientOrderId\": \"ccxt-example-1\",\n \"postOnly\": false\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://testnet.edel-api.xyz/v2/order")
.header("Idempotency-Key", "<idempotency-key>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"BTC/USD:USD.E\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"amount\": 0.001,\n \"price\": 65000,\n \"params\": {\n \"clientOrderId\": \"ccxt-example-1\",\n \"postOnly\": false\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://testnet.edel-api.xyz/v2/order")
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 \"symbol\": \"BTC/USD:USD.E\",\n \"type\": \"limit\",\n \"side\": \"buy\",\n \"amount\": 0.001,\n \"price\": 65000,\n \"params\": {\n \"clientOrderId\": \"ccxt-example-1\",\n \"postOnly\": false\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"symbol": "<string>",
"status": "open",
"info": {
"version": "external-order/v1",
"orderId": "<string>",
"accountId": "<string>",
"marketId": "<string>",
"status": "open",
"lastSequence": 1,
"idempotencyKey": "<string>",
"cancelReason": "margin_unbacked"
},
"clientOrderId": "<string>",
"timestamp": 1,
"datetime": "<string>",
"side": "buy",
"type": "limit",
"timeInForce": "GTC",
"price": 123,
"amount": 1,
"filled": 1,
"remaining": 1,
"reduceOnly": true,
"postOnly": true
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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"
}
}{
"name": "AccountNotEnabled",
"message": "<string>",
"code": "invalid_request",
"retryable": true,
"timestamp": 1,
"datetime": "<string>",
"info": {
"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
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Minimum string length:
1Body
application/json
Response
Accepted for processing
Minimum string length:
1Minimum string length:
1Available options:
open, closed, canceled - Option 1
- Option 2
- Option 3
Show child attributes
Show child attributes
Minimum string length:
1Required range:
x >= 0Available options:
buy, sell Available options:
limit, market Available options:
GTC, IOC Required range:
x >= 0Required range:
x >= 0Required range:
x >= 0