Create an order
curl --request POST \
--url https://api.example.com/exchange/orders \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"qty": 1,
"symbol": "USD-NGN",
"type": "buy"
}
'import requests
url = "https://api.example.com/exchange/orders"
payload = {
"qty": 1,
"symbol": "USD-NGN",
"type": "buy"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({qty: 1, symbol: 'USD-NGN', type: 'buy'})
};
fetch('https://api.example.com/exchange/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://api.example.com/exchange/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([
'qty' => 1,
'symbol' => 'USD-NGN',
'type' => 'buy'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/exchange/orders"
payload := strings.NewReader("{\n \"qty\": 1,\n \"symbol\": \"USD-NGN\",\n \"type\": \"buy\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.example.com/exchange/orders")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"qty\": 1,\n \"symbol\": \"USD-NGN\",\n \"type\": \"buy\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/exchange/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"qty\": 1,\n \"symbol\": \"USD-NGN\",\n \"type\": \"buy\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accepted_at": "2023-12-23T17:55:42.919523",
"average_fill_price": 80000,
"business_id": "dd625bec-b1a3-466e-867e-c91ae0b6e71e",
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2023-12-23T17:55:42.911",
"expires_at": null,
"id": "7da75a46-a1bc-11ee-9a32-560f156a658b",
"min_qty": null,
"min_quote_qty": null,
"percent_filled": 10000,
"price": 80000,
"price_type": "market",
"qty": 1,
"quote_qty": null,
"status": "filled",
"symbol": "USD-NGN",
"time_in_force": "gtc",
"trades": [
{
"buy_order_id": "7da75a46-a1bc-11ee-9a32-560f156a658b",
"commission": 0,
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2023-12-23T17:55:42.921",
"id": "7da8e726-a1bc-11ee-80cf-560f156a658b",
"price": 80000,
"sell_order_id": "7d97c0b8-a1bc-11ee-b240-560f156a658b",
"size": 1,
"symbol": "USD-NGN"
}
],
"type": "buy",
"updated_at": "2023-12-23T17:55:42.911",
"user_id": "b101f718-d133-450c-a572-c281c7341803"
}
}{}exchange
Create an order
POST
/
exchange
/
orders
Create an order
curl --request POST \
--url https://api.example.com/exchange/orders \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"qty": 1,
"symbol": "USD-NGN",
"type": "buy"
}
'import requests
url = "https://api.example.com/exchange/orders"
payload = {
"qty": 1,
"symbol": "USD-NGN",
"type": "buy"
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({qty: 1, symbol: 'USD-NGN', type: 'buy'})
};
fetch('https://api.example.com/exchange/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://api.example.com/exchange/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([
'qty' => 1,
'symbol' => 'USD-NGN',
'type' => 'buy'
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/exchange/orders"
payload := strings.NewReader("{\n \"qty\": 1,\n \"symbol\": \"USD-NGN\",\n \"type\": \"buy\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Idempotency-Key", "<idempotency-key>")
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.example.com/exchange/orders")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"qty\": 1,\n \"symbol\": \"USD-NGN\",\n \"type\": \"buy\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/exchange/orders")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"qty\": 1,\n \"symbol\": \"USD-NGN\",\n \"type\": \"buy\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"accepted_at": "2023-12-23T17:55:42.919523",
"average_fill_price": 80000,
"business_id": "dd625bec-b1a3-466e-867e-c91ae0b6e71e",
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2023-12-23T17:55:42.911",
"expires_at": null,
"id": "7da75a46-a1bc-11ee-9a32-560f156a658b",
"min_qty": null,
"min_quote_qty": null,
"percent_filled": 10000,
"price": 80000,
"price_type": "market",
"qty": 1,
"quote_qty": null,
"status": "filled",
"symbol": "USD-NGN",
"time_in_force": "gtc",
"trades": [
{
"buy_order_id": "7da75a46-a1bc-11ee-9a32-560f156a658b",
"commission": 0,
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2023-12-23T17:55:42.921",
"id": "7da8e726-a1bc-11ee-80cf-560f156a658b",
"price": 80000,
"sell_order_id": "7d97c0b8-a1bc-11ee-b240-560f156a658b",
"size": 1,
"symbol": "USD-NGN"
}
],
"type": "buy",
"updated_at": "2023-12-23T17:55:42.911",
"user_id": "b101f718-d133-450c-a572-c281c7341803"
}
}{}Headers
Body
application/json
Order params
Order creation params
Currency pair
Order type
Available options:
sell, buy Minimum quantity to be traded at a go, in base currency
Minimum quantity to be traded at a go, in quote currency
Order price, in minor units
Price type
Available options:
limit, market Order quantity, denominated in the base currency
Order quantity, denominated in the quote currency
Available options:
gtc, gtt, ioc, fok Response
Order
Response schema for a single order
An order
Show child attributes
Show child attributes
Example:
{
"accepted_at": "2023-12-23T17:55:42.919523",
"average_fill_price": 80000,
"business_id": "dd625bec-b1a3-466e-867e-c91ae0b6e71e",
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2023-12-23T17:55:42.911",
"expires_at": null,
"id": "7da75a46-a1bc-11ee-9a32-560f156a658b",
"min_qty": null,
"min_quote_qty": null,
"percent_filled": 10000,
"price": 80000,
"price_type": "market",
"qty": 1,
"quote_qty": null,
"status": "filled",
"symbol": "USD-NGN",
"time_in_force": "gtc",
"trades": [
{
"buy_order_id": "7da75a46-a1bc-11ee-9a32-560f156a658b",
"commission": 0,
"correlation_id": "7da742ea-a1bc-11ee-b907-560f156a658b",
"created_at": "2023-12-23T17:55:42.921",
"id": "7da8e726-a1bc-11ee-80cf-560f156a658b",
"price": 80000,
"sell_order_id": "7d97c0b8-a1bc-11ee-b240-560f156a658b",
"size": 1,
"symbol": "USD-NGN"
}
],
"type": "buy",
"updated_at": "2023-12-23T17:55:42.911",
"user_id": "b101f718-d133-450c-a572-c281c7341803"
}
⌘I