Skip to main content
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>"
}
'
{
  "success": true,
  "message": "Order replaced successfully",
  "data": {
    "id": "8c5b2e8e-1f8e-4b4f-9e5a-2b3c4d5e6f70",
    "symbol": "USDT-NGN",
    "side": "buy",
    "type": "limit",
    "status": "open",
    "price": "1550.00",
    "quantity": "120.00",
    "filled_quantity": "0.00",
    "created_at": "2026-05-06T10:00:00Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.daya.co/llms.txt

Use this file to discover all available pages before exploring further.

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 (status open or partially_filled) can be replaced — terminal orders return 404.

Authentication

X-Api-Key
string
required
Your API key with Trade scope

Path Parameters

id
string
required
Order ID (UUID) to replace

Request Body

side
string
required
Order side for the new order.Allowed values: buy, sell
type
string
required
Order type for the new order.Allowed values: limit, market
quantity
string
required
Quantity for the new order.Example: 120.00
price
string
Limit price (required when type is limit).Example: 1550.00

Request 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"
  }'

Response

Same shape as Get Order. The returned id 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": "USDT-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

CodeMeaning
400Invalid body — missing side/type/quantity, or price supplied for a market order
403API key missing Trade scope, or account frozen
404Order not found, or already terminal