---
title: "Update an order"
method: PATCH
path: "/orders/{orderId}"
tags: ["Flash"]
---

# Update an order

`PATCH /orders/{orderId}`

Update a previously submitted flash order's limit price.

Executed as a cancel-and-replace under the same `orderId`. Set exactly one of `limitCrossPrice` or `limitNotionalPrice`.

Supported on resting `limit` orders and on `stop`, `stop-loss`, and `take-profit` orders placed with a limit price (stop-limit / take-profit-limit); every other order type is rejected with `422`.

On the trigger types the price you send is the **post-trigger execution limit** — where the order rests once its trigger fires — not the trigger price, so an update does not move your stop. Updating after the trigger has already fired is also valid: the resting limit order is cancelled and re-placed at the new price. Trigger prices cannot be changed here — cancel the order and place a new one.

**Signature required.** Construct the canonical UTF-8 update message and sign it with the funder wallet:

- Message format (exactly one `Limit ... Price:` line — Cross or Notional):

```
Definitive Flash — Update Order
Order: <orderId>
Issued At: <RFC3339 UTC>
Limit Cross Price: <decimal>
```

- The message binds the order id, the new limit value, and an `Issued At:` freshness stamp (rejected outside a small skew window) to prevent replay of a captured signature.
- **EVM chains** — sign with EIP-191 `personal_sign` over the message bytes; pass the 65-byte 0x-prefixed hex signature as `userSignature`.
- **SVM** (`solana`) — sign with Ed25519 over the message bytes; pass the 64-byte base58 signature as `userSignature`.
- Echo the exact message text back as `updateMessage`.

Errors: `422` when the order type does not accept limit updates (including any attempt to change a trigger), the order is already pending an update, or the order is in a terminal resting state; `404` when the order cannot be found — a nonexistent order, or one that triggered on entry and never rested — or the signature does not verify.

## Path parameters

- `orderId` string, uuid, required — Flash order ID.

## Request body

- UpdateOrderRequest
  - `limitNotionalPrice` string — New USD limit price for the traded (`targetAsset`) asset. Mutually exclusive with `limitCrossPrice`; set exactly one. Must equal the value signed in `updateMessage` exactly — no normalization is applied.
  - `limitCrossPrice` string — New pair-rate limit price — how many `contraAsset` units one `targetAsset` unit is worth. Mutually exclusive with `limitNotionalPrice`; set exactly one. Must equal the value signed in `updateMessage` exactly — no normalization is applied.
  - `updateMessage` string, required — UTF-8 plaintext the funder wallet signed. Binds the order id, an RFC3339 `Issued At:` freshness stamp, and the new limit value. Format (one Limit line, Cross or Notional): ``` Definitive Flash — Update Order Order: <orderId> Issued At: <RFC3339 UTC> Limit Cross Price: <decimal> ``` Same bytes across EVM and SVM.
  - `userSignature` string, required — Funder wallet signature over updateMessage. Accepts 0x-prefixed hex (EVM convention) or base58 (Solana convention). EVM: 65 bytes from EIP-191 personal_sign. SVM: 64 bytes from Ed25519.

## Response `200`

Order updated successfully

- UpdateOrderResponse
  - `ok` true, required

## Other responses

- `400` — Invalid request parameters
- `401` — Authentication failed
- `403` — Permission denied
- `404` — Resource not found
- `422` — Resource state prevents the requested operation
- `429` — Rate limit exceeded
- `500` — Internal server error
- `503` — Service temporarily unavailable
- `504` — Gateway timeout

---

[API](https://skmtc.net/definitive/apis/definitive-flash-api.md) · [All operations](https://skmtc.net/definitive/apis/definitive-flash-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/definitive/definitive-flash-api/versions/4b43a78e1989/schema)
