Order History
curl --request GET \
--url https://api.pro.daya.co/public/v1/orders/history \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.pro.daya.co/public/v1/orders/history"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.pro.daya.co/public/v1/orders/history', 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.pro.daya.co/public/v1/orders/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-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"
"net/http"
"io"
)
func main() {
url := "https://api.pro.daya.co/public/v1/orders/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pro.daya.co/public/v1/orders/history")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/orders/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Order history retrieved successfully",
"data": {
"orders": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user_abc123",
"symbol": "USD-NGN",
"side": "buy",
"type": "limit",
"status": "filled",
"price": "1545.00",
"quantity": "100.00000000",
"filled_quantity": "100.00000000",
"remaining_quantity": "0.00000000",
"executed_price": "1545.00",
"total_value": "154500.00",
"filled_value": "154500.00",
"base_currency": "USD",
"quote_currency": "NGN",
"created_at": "2024-01-15T10:35:00Z",
"updated_at": "2024-01-15T10:35:05Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"user_id": "user_abc123",
"symbol": "USD-NGN",
"side": "sell",
"type": "market",
"status": "filled",
"price": "",
"quantity": "50.00000000",
"filled_quantity": "50.00000000",
"remaining_quantity": "0.00000000",
"executed_price": "1546.50",
"total_value": "77325.00",
"filled_value": "77325.00",
"base_currency": "USD",
"quote_currency": "NGN",
"created_at": "2024-01-14T15:20:00Z",
"updated_at": "2024-01-14T15:20:01Z"
}
],
"total_count": 156,
"limit": 20,
"offset": 0,
"has_more": true
},
"timestamp": "2024-01-15T10:35:00Z"
}
Orders
Order History
Get historical orders with filtering and pagination
GET
/
public
/
v1
/
orders
/
history
Order History
curl --request GET \
--url https://api.pro.daya.co/public/v1/orders/history \
--header 'X-Api-Key: <x-api-key>'import requests
url = "https://api.pro.daya.co/public/v1/orders/history"
headers = {"X-Api-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-Api-Key': '<x-api-key>'}};
fetch('https://api.pro.daya.co/public/v1/orders/history', 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.pro.daya.co/public/v1/orders/history",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-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"
"net/http"
"io"
)
func main() {
url := "https://api.pro.daya.co/public/v1/orders/history"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Api-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.pro.daya.co/public/v1/orders/history")
.header("X-Api-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/orders/history")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Api-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Order history retrieved successfully",
"data": {
"orders": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user_abc123",
"symbol": "USD-NGN",
"side": "buy",
"type": "limit",
"status": "filled",
"price": "1545.00",
"quantity": "100.00000000",
"filled_quantity": "100.00000000",
"remaining_quantity": "0.00000000",
"executed_price": "1545.00",
"total_value": "154500.00",
"filled_value": "154500.00",
"base_currency": "USD",
"quote_currency": "NGN",
"created_at": "2024-01-15T10:35:00Z",
"updated_at": "2024-01-15T10:35:05Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"user_id": "user_abc123",
"symbol": "USD-NGN",
"side": "sell",
"type": "market",
"status": "filled",
"price": "",
"quantity": "50.00000000",
"filled_quantity": "50.00000000",
"remaining_quantity": "0.00000000",
"executed_price": "1546.50",
"total_value": "77325.00",
"filled_value": "77325.00",
"base_currency": "USD",
"quote_currency": "NGN",
"created_at": "2024-01-14T15:20:00Z",
"updated_at": "2024-01-14T15:20:01Z"
}
],
"total_count": 156,
"limit": 20,
"offset": 0,
"has_more": true
},
"timestamp": "2024-01-15T10:35:00Z"
}
Overview
Retrieve order history for the authenticated user. This endpoint returns orders regardless of status, with optional filtering and pagination. For active orders, use the List Active Orders endpoint.Authentication
string
required
Your API key with Read or Trade scope
X-Api-Key: daya_sk_YOUR_API_KEY
Query Parameters
string
Filter by order statusAllowed values:
filled, cancelled, rejected, partially_filledstring
Filter by trading pair symbolExample:
USDT-NGNstring
Filter by order sideAllowed values:
buy, sellstring
Filter by order typeAllowed values:
market, limitstring
Filter orders created after this time (RFC3339 format)Example:
2024-01-01T00:00:00Zstring
Filter orders created before this time (RFC3339 format)Example:
2024-12-31T23:59:59Zinteger
Maximum number of orders to returnDefault:
50Range: 1 to 100integer
Number of orders to skip for paginationDefault:
0Request Examples
curl --request GET \
--url 'https://api.pro.daya.co/public/v1/orders/history?symbol=USDT-NGN&status=filled&limit=20' \
--header 'X-Api-Key: daya_sk_YOUR_API_KEY'
const response = await fetch(
'https://api.pro.daya.co/public/v1/orders/history?symbol=USDT-NGN&status=filled&limit=20',
{
headers: { 'X-Api-Key': 'daya_sk_YOUR_API_KEY' }
}
);
const data = await response.json();
console.log('Order history:', data.data.orders);
import requests
headers = {'X-Api-Key': 'daya_sk_YOUR_API_KEY'}
response = requests.get(
'https://api.pro.daya.co/public/v1/orders/history',
headers=headers,
params={
'symbol': 'USDT-NGN',
'status': 'filled',
'limit': 20
}
)
result = response.json()
print(f"Order history: {result['data']['orders']}")
package main
import (
"encoding/json"
"fmt"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://api.pro.daya.co/public/v1/orders/history?symbol=USDT-NGN&status=filled&limit=20", nil)
req.Header.Set("X-Api-Key", "daya_sk_YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Println("Order history:", result["data"])
}
Response
boolean
required
Indicates if the request was successful
string
required
Human-readable response message
object
required
Paginated order data
Show data properties
Show data properties
array
Array of order objects
Show order properties
Show order properties
string
Unique order identifier (UUID)
string
User identifier
string
Trading pair symbol
string
Order side:
buy or sellstring
Order type:
limit or marketstring
Order status:
filled, cancelled, rejected, partially_filledstring
Order price (for limit orders)
string
Original order quantity
string
Quantity that has been filled
string
Remaining quantity (0 for filled orders)
string
Average execution price
string
Total order value in quote currency
string
Value of filled portion
string
Base currency code (e.g.
USD)string
Quote currency code (e.g.
NGN)string
ISO 8601 creation timestamp
string
ISO 8601 last update timestamp
integer
Total number of orders matching the filter
integer
Number of orders returned
integer
Offset used for pagination
boolean
Whether there are more results beyond the current page
string
ISO 8601 timestamp of the response
Success Response
{
"success": true,
"message": "Order history retrieved successfully",
"data": {
"orders": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"user_id": "user_abc123",
"symbol": "USD-NGN",
"side": "buy",
"type": "limit",
"status": "filled",
"price": "1545.00",
"quantity": "100.00000000",
"filled_quantity": "100.00000000",
"remaining_quantity": "0.00000000",
"executed_price": "1545.00",
"total_value": "154500.00",
"filled_value": "154500.00",
"base_currency": "USD",
"quote_currency": "NGN",
"created_at": "2024-01-15T10:35:00Z",
"updated_at": "2024-01-15T10:35:05Z"
},
{
"id": "550e8400-e29b-41d4-a716-446655440001",
"user_id": "user_abc123",
"symbol": "USD-NGN",
"side": "sell",
"type": "market",
"status": "filled",
"price": "",
"quantity": "50.00000000",
"filled_quantity": "50.00000000",
"remaining_quantity": "0.00000000",
"executed_price": "1546.50",
"total_value": "77325.00",
"filled_value": "77325.00",
"base_currency": "USD",
"quote_currency": "NGN",
"created_at": "2024-01-14T15:20:00Z",
"updated_at": "2024-01-14T15:20:01Z"
}
],
"total_count": 156,
"limit": 20,
"offset": 0,
"has_more": true
},
"timestamp": "2024-01-15T10:35:00Z"
}
Error Responses
{
"success": false,
"message": "Unauthorized",
"error": {
"code": "API_KEY_INVALID",
"message": "The provided API key is invalid"
},
"timestamp": "2024-01-15T10:35:00Z"
}
{
"success": false,
"message": "Validation error",
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid start_time format. Use RFC3339 format."
},
"timestamp": "2024-01-15T10:35:00Z"
}
Pagination
Uselimit and offset for pagination. The response includes total_count and has_more to help navigate pages.
Rate Limits
- 100 requests per minute per API key
Next Steps
List Active Orders
View your active orders
List Trades
View individual trade executions
Get Order
Get details of a specific order
Place Order
Place a new order
⌘I