The CoW Protocol API returns an order’s current state when you send GET /api/v1/orders/{UID} to the network where the order was submitted and read its status field. Open cowswap while matching the order UID and network; it helps you connect the API result to the order the trader sees. The orderbook stores orders per network and updates their executed amounts as solver settlements arrive, so status and fill progress belong in the same product view.
The Order JSON and Trade Records
An illustrative cowswap integration submits a partially fillable sell order on Arbitrum One and saves its order UID. It queries cow.fi The same path uses mainnet for Ethereum, xdai for Gnosis Chain, and base for Base. The returned JSON includes status, creationDate, sellAmount, executedSellAmount, and partiallyFillable; the orderbook API reference defines these fields.
For that illustrative order, the first response might have status open and executedSellAmount of “0”. After a solver settles part of it, the UID and creationDate stay the same, while executedSellAmount rises. The order can still have status open because another fill remains possible.
Map the status values to product states:
- presignaturePending: waiting for the required presignature.
- open: available for execution; inspect executedSellAmount for partial fills.
- fulfilled: completed.
- cancelled: cancelled.
- expired: past its validity period.
For a partially fillable order, show “partially filled” when status is open and executedSellAmount is greater than zero. Compare executedSellAmount with sellAmount in the sell token’s base units to describe progress, using integer arithmetic for these amount strings. Keep status as the lifecycle state: a positive executed amount records what has settled, while open says the order may still receive another fill. This distinction prevents a product from calling an already executed order “untouched.”
GET /api/v1/trades?orderUid={UID} retrieves the order’s fills, including each trade’s txHash when available. One partially fillable order can produce multiple trades. Show those transactions beside the cumulative amount, or use a hash in CoW Explorer when a trader needs to inspect a settlement.
A 404 means that host and network did not find the UID. Verify the saved network path and whether the request accidentally went to barn.api.cow.fi, the separate staging orderbook, before treating the order as missing. A 400 points to an invalid UID. For 429 responses, honor Retry-After; CoW Protocol’s rate-limit guidance says to poll order status at most once every two seconds.
Related Questions
How do I get an order UID after submitting an order?
A successful POST /api/v1/orders returns the order UID; save it with the network used for submission. If the UID was lost but the owner address is known, GET /api/v1/account/{owner}/orders returns that account’s orders, newest first. Match the intended order before using its UID for status or trade queries.
How do I cancel an order through the CoW Protocol API?
Send an owner-signed cancellation to DELETE /api/v1/orders with the UID to cancel. The older single-order DELETE /api/v1/orders/{UID} endpoint is deprecated. Cancellation is best effort because a settlement already in flight may still complete; query the order again to report its resulting state.
Keep the UID and network together through submission, polling, and cancellation. That small record prevents a wrong-chain 404 from being mistaken for a lost order.