Skip to main content

Overview

The OrderBookApi class provides a comprehensive interface for interacting with the CoW Protocol order book. This guide covers creating orders, querying order status, fetching trades, and canceling orders.

Initializing the API Client

Creating Orders

1

Request a Quote

Before creating an order, get a price quote from the API:
2

Create and Sign Order

Build an order from the quote and sign it:
3

Submit Order

Post the signed order to the order book:

Fetching Orders

Get Order by UID

Get All Orders for an Owner

Search Across Environments

Fetching Trades

Trades by Order UID

Trades by Owner

Canceling Orders

Order cancellations must be signed by the order owner using EIP-712 typed data.

Cancel Single Order

Cancel Multiple Orders

Transaction and Pricing Data

Orders by Transaction Hash

Native Token Price

User Surplus

Solver Competition Data

Working with App Data

Upload App Data

Retrieve App Data

Complete Order Management Example

API Reference

Order Status Values

Orders can have the following statuses:
  • open — Order is available for solvers
  • fulfilled — Order has been completely filled
  • expired — Order validity period has passed
  • cancelled — Order was cancelled by the owner
  • presignaturePending — Waiting for Safe presignature
Use the get_order_link() method to get a direct URL to view the order on CoW Explorer.

Next Steps

Last modified on March 11, 2026