> For the complete documentation index, see [llms.txt](https://bump.sh/tie-tech/hub/b2b-api/doc/broker-openapi/llms.txt)

# Get order by client_order_id

> GET /trading/accounts/{account_id}/orders/by-client-order-id/{client_order_id}
> 
> Fetches one order scoped to the authenticated broker and the specified account_id.
> client_order_id is unique only among active orders of the broker and may be reused
> after an order reaches a terminal status. If several orders match, returns the active
> order (NEW/ACTIVE/PARTIALLY_FILLED) if one exists; otherwise returns the most recently
> updated order (max last_update_wall_time_ns, ties broken by order_id).
> Returns 404 when no order matches, including when the order belongs to another account
> of the broker or when an unfilled CANCELLED order has already been removed by read-store
> retention (about 14 days after completion). FILLED, partially filled CANCELLED, EXPIRED and
> REJECTED orders are retained and remain retrievable.



## Servers
- Production: https://api.example.com/v1 (Production)
- Sandbox: https://sandbox.api.example.com/v1 (Sandbox)


## Authentication methods
- Api key auth


## Parameters
### Headers

- **PRE-ACCESS-KEY** (string)
  Broker access key identifier.

- **PRE-ACCESS-SIGNATURE** (string)
  Keyed BLAKE2b-256 signature (hex lowercase, 64 characters).

- **PRE-ACCESS-TIMESTAMP** (string(date-time))
  RFC3339 timestamp with milliseconds (e.g., 2025-10-30T06:00:34.075Z). Must be within clock_skew_tolerance (default 5m) of server time.


### Path parameters

- **account_id** (string)
  Broker-supplied account identifier; length 1..128; charset [A-Za-z0-9._~-].

- **client_order_id** (string)
  Broker-supplied order identifier; length 1..64; charset [A-Za-z0-9._~-].




## Responses
### 200
Order view

#### Body: application/json (object)
- **order_id** (string(uuid))

- **client_order_id** (string)

- **market_id** (string)

- **broker_id** (string)

- **account_id** (string)

- **side** (string)

- **type** (string)

- **tif** (string)

- **token** (string)

- **price** (object)

- **qty** (object)

- **volume** (object)

- **filled_qty** (object)

- **filled_volume** (object)

- **filled_fee** (object)
  Total filled fees accumulated on this order (in quote currency units).

- **status** (string)

- **status_reason** (string)
  Machine-readable reason code for the current status

- **last_update_wall_time_ns** (integer(int64))

- **last_update_engine_seq** (integer(int64))
  Monotonic engine sequence number of the last applied change

- **last_cmd_id_hex** (string)
  32 lowercase hex

- **correlation_id** (string | null)
  Correlation-Id header (lowercase UUIDv7) of the last applied broker command
  addressed to this order: NEW, AMEND, CANCEL, or cancel-all
  (DELETE /trading/markets/{market_id}/orders). Any outcome the engine
  produces for the addressed order inside that command carries the same
  correlation_id, including a REJECTED NEW (e.g. INSUFFICIENT_FUNDS,
  INVALID_PRICE, SELF_TRADE_PREVENTION) and cancellations such as
  IOC_PARTIAL, FOK_FAILED or NO_MATCHING_LIQUIDITY.
  Unchanged by anything not addressed to this order by the broker: fills on
  either side (including a counterparty command that evicts this resting
  order), market/system transitions (MARKET_CLOSED, MARKET_SETTLED,
  MARKET_VOIDED, TIF_EXPIRATION, system-originated SYSTEM_ERROR),
  engine-rejected AMEND/CANCEL (order_reject), and idempotent 202 replays.
  For example, after MARKET_CLOSED it retains the previous command's
  correlation_id; status_reason describes the transition's cause.
  Null or absent if the last such command had no Correlation-Id header
  (a later command without the header resets it to null) or the row was
  written before this field existed. Independent of last_cmd_id_hex and
  may differ from it; use ref_id/last_cmd_id_hex to match a specific
  command result. Not available as a filter; the header is not echoed
  in command responses.


### 403
Forbidden by broker status, CIDR, permissions or market state. broker_suspended denies mutations other than DELETE cancellation and POST merge; broker_disabled denies all authenticated requests; ip_not_allowed is checked first. All authz 403 responses use Error {error_code, message} with Content-Type: application/json, including WebSocket upgrade refusal. The administrative/prepayment restriction cause is not exposed.

#### Body: application/json (object)
- **error_code** (string)
  Open error code vocabulary, including broker_suspended, broker_disabled and ip_not_allowed for HTTP 403.

- **message** (string)

- **details** (object)


### 404
Resource not found

#### Body: application/json (object)
- **error_code** (string)
  Open error code vocabulary, including broker_suspended, broker_disabled and ip_not_allowed for HTTP 403.

- **message** (string)

- **details** (object)


### 503
The request could not be served. `error_code` in the response body gives the reason
and determines whether the request may be retried.


#### Body: application/json (object)
- **error_code** (string)
  Open error code vocabulary, including broker_suspended, broker_disabled and ip_not_allowed for HTTP 403.

- **message** (string)

- **details** (object)



[Powered by Bump.sh](https://bump.sh)
