Replace Order
curl --request PUT \
--url https://api.pro.daya.co/public/v1/orders/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"side": "<string>",
"type": "<string>",
"quantity": "<string>",
"price": "<string>",
"client_order_id": "<string>",
"max_taker_fee": "<string>"
}
'import requests
url = "https://api.pro.daya.co/public/v1/orders/{id}"
payload = {
"side": "<string>",
"type": "<string>",
"quantity": "<string>",
"price": "<string>",
"client_order_id": "<string>",
"max_taker_fee": "<string>"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
side: '<string>',
type: '<string>',
quantity: '<string>',
price: '<string>',
client_order_id: '<string>',
max_taker_fee: '<string>'
})
};
fetch('https://api.pro.daya.co/public/v1/orders/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'side' => '<string>',
'type' => '<string>',
'quantity' => '<string>',
'price' => '<string>',
'client_order_id' => '<string>',
'max_taker_fee' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pro.daya.co/public/v1/orders/{id}"
payload := strings.NewReader("{\n \"side\": \"<string>\",\n \"type\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"max_taker_fee\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Api-Key", "<x-api-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.put("https://api.pro.daya.co/public/v1/orders/{id}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"side\": \"<string>\",\n \"type\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"max_taker_fee\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"side\": \"<string>\",\n \"type\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"max_taker_fee\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Order replaced successfully",
"data": {
"id": "8c5b2e8e-1f8e-4b4f-9e5a-2b3c4d5e6f70",
"symbol": "USD-NGN",
"side": "buy",
"type": "limit",
"status": "open",
"price": "1550.00",
"quantity": "120.00",
"filled_quantity": "0.00",
"created_at": "2026-05-06T10:00:00Z"
}
}
Orders
Replace Order
Atomically cancel and re-place an open order
PUT
/
public
/
v1
/
orders
/
{id}
Replace Order
curl --request PUT \
--url https://api.pro.daya.co/public/v1/orders/{id} \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <x-api-key>' \
--data '
{
"side": "<string>",
"type": "<string>",
"quantity": "<string>",
"price": "<string>",
"client_order_id": "<string>",
"max_taker_fee": "<string>"
}
'import requests
url = "https://api.pro.daya.co/public/v1/orders/{id}"
payload = {
"side": "<string>",
"type": "<string>",
"quantity": "<string>",
"price": "<string>",
"client_order_id": "<string>",
"max_taker_fee": "<string>"
}
headers = {
"X-Api-Key": "<x-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'X-Api-Key': '<x-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
side: '<string>',
type: '<string>',
quantity: '<string>',
price: '<string>',
client_order_id: '<string>',
max_taker_fee: '<string>'
})
};
fetch('https://api.pro.daya.co/public/v1/orders/{id}', 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/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'side' => '<string>',
'type' => '<string>',
'quantity' => '<string>',
'price' => '<string>',
'client_order_id' => '<string>',
'max_taker_fee' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.pro.daya.co/public/v1/orders/{id}"
payload := strings.NewReader("{\n \"side\": \"<string>\",\n \"type\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"max_taker_fee\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("X-Api-Key", "<x-api-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.put("https://api.pro.daya.co/public/v1/orders/{id}")
.header("X-Api-Key", "<x-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"side\": \"<string>\",\n \"type\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"max_taker_fee\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.pro.daya.co/public/v1/orders/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["X-Api-Key"] = '<x-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"side\": \"<string>\",\n \"type\": \"<string>\",\n \"quantity\": \"<string>\",\n \"price\": \"<string>\",\n \"client_order_id\": \"<string>\",\n \"max_taker_fee\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Order replaced successfully",
"data": {
"id": "8c5b2e8e-1f8e-4b4f-9e5a-2b3c4d5e6f70",
"symbol": "USD-NGN",
"side": "buy",
"type": "limit",
"status": "open",
"price": "1550.00",
"quantity": "120.00",
"filled_quantity": "0.00",
"created_at": "2026-05-06T10:00:00Z"
}
}
Overview
Atomically cancel an existing open order and submit a new one in its place. The matching engine performs both steps in one operation, so you never end up holding both. Useful for amending limit orders as the market moves. The replacement is a new order, not a mutation — the response returns a fresh order ID. Track that ID for follow-up cancels and webhook events. Requires Trade scope. Only orders that are still resting (statusopen or partially_filled) can be replaced — terminal orders return 404.
Authentication
string
required
Your API key with Trade scope
Path Parameters
string
required
Order ID (UUID) to replace
Request Body
string
required
Order side for the new order.Allowed values:
buy, sellstring
required
Order type for the new order.Allowed values:
limit, marketstring
required
Quantity for the new order.Example:
120.00string
Limit price (required when
type is limit).Example: 1550.00string
Optional client idempotency key for the replacement order. For a limit order, use the same value that you sent when you requested the quote.Example:
replace-20260903-001string
Maximum cumulative taker fee that you authorize for a replacement limit order, in the quote asset. Send the
estimated_fee value from the reviewed limit-order quote without changing it. Omission authorizes 0.00. Market orders ignore this field.Example: 37.20Request Example
curl --request PUT \
--url https://api.pro.daya.co/public/v1/orders/550e8400-e29b-41d4-a716-446655440000 \
--header 'X-Api-Key: daya_sk_YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"side": "buy",
"type": "limit",
"price": "1550.00",
"quantity": "120.00",
"max_taker_fee": "37.20",
"client_order_id": "replace-20260903-001"
}'
client_order_id. Send the same client_order_id and the quote’s estimated_fee as max_taker_fee in the replacement request. The server charges only the realized fee. It rejects the replacement with TAKER_FEE_CAP_EXCEEDED if the realized taker fee would exceed the cap.
Response
Same shape as Get Order. The returnedid is the new order — track it for follow-up cancels and webhook events.
{
"success": true,
"message": "Order replaced successfully",
"data": {
"id": "8c5b2e8e-1f8e-4b4f-9e5a-2b3c4d5e6f70",
"symbol": "USD-NGN",
"side": "buy",
"type": "limit",
"status": "open",
"price": "1550.00",
"quantity": "120.00",
"filled_quantity": "0.00",
"created_at": "2026-05-06T10:00:00Z"
}
}
Error Responses
| Code | Meaning |
|---|---|
400 | Invalid body — missing side/type/quantity, or price supplied for a market order |
403 | API key missing Trade scope, or account frozen |
404 | Order not found, or already terminal |