Skip to main content
POST
/
partner
/
exchange
/
orders
/
{order_id}
/
replace
Replace order
curl --request POST \
  --url https://api.stabyl.com/v1/partner/exchange/orders/{order_id}/replace \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: <idempotency-key>' \
  --header 'X-Api-Key: <api-key>' \
  --data '
{
  "client_order_id": "<string>",
  "idempotency_key": "<string>",
  "price": "1655.00",
  "quantity": "150.00"
}
'
{
  "data": {
    "new_order_id": "0197f1f0-0000-7000-8000-000000000008",
    "original_order_id": "0197f1f0-0000-7000-8000-000000000001",
    "replaced_at": "2026-05-24T12:01:00Z",
    "status": "replacing"
  },
  "status": "success"
}

Documentation Index

Fetch the complete documentation index at: https://stabyl.mintlify.app/llms.txt

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

Order writes are asynchronous. Store the Idempotency-Key before sending the request, reuse it for retries after uncertain responses, and read the order resource for the final state.

Authorizations

X-Api-Key
string
header
default:sb_test_your_key
required

API key. Send it in the X-Api-Key header.

Headers

Idempotency-Key
string
required

Unique key for this exact write intent. Store it before sending the request and reuse it for retries after timeouts or transient errors.

Path Parameters

order_id
string<uuid>
required

Public order ID returned by create or list order endpoints.

Body

application/json

Replacement values for the existing order. Use a new idempotency key for each distinct replacement intent.

Replacement values for an existing limit order.

client_order_id
string | null

New client order ID for the replacement

idempotency_key
string | null

Idempotency key for replace command

price
string | null

New price per unit

Example:

"1655.00"

quantity
string | null

New quantity (if None, use remaining unfilled quantity)

Example:

"150.00"

Response

Order replacement submitted

data
object
required

Result returned after a replace request is accepted for processing.

status
enum<string>
required
Available options:
success