Overview
This guide walks through integrating with the CoW Protocol orderbook API — from requesting a quote, to computing the amounts you need to sign, to creating and monitoring orders. An intent in CoW Protocol is a signed message that represents a user’s wish to trade. It doesn’t execute a trade directly — instead, it delegates execution to solvers who find the optimal path.Base URLs
The base URL depends on the chain:
Interactive endpoint docs: Order Book API Reference
Step 1: Request a Quote
Send your trading intention to the/quote endpoint:
For more details on quoting strategies and timing, see Quote Selection. For the full API reference, see Order Book API.
If you send a full JSON
appData document in the quote request, the quote response includes both quote.appData and quote.appDataHash. Sign the hash, not the JSON string. When you create the order, submit the JSON in appData and include appDataHash for easier debugging.Step 2: Understand the Quote Response
The/quote response provides the price information needed to build the order, including fee breakdowns.
Sell order response
Buy order response
sellAmount is after the protocol fee, and the feeAmount (network costs) is not yet included in the sell amount — it must be added separately.
Step 3: Compute the Amounts to Sign
Thequote object is the base order returned by the backend. If you sign it exactly as returned, you are using the server-quoted amounts.
Many integrations apply additional client-side slippage tolerance and optional partner fees before signing. The amount-stage vocabulary below explains how to do that safely.
The quote response and order construction use a shared vocabulary of amount stages — each representing the token amount at a specific point in the fee pipeline. Understanding these terms is essential for interpreting quote values and building orders correctly.
Fee types
Several layers of fees transform the raw spot price into the final amounts signed in the order:Protocol fee
The protocol fee is expressed as basis points (protocolFeeBps) in the quote response.
Sell orders (buy token units) — quote.buyAmount is already after the protocol fee has been deducted:
Partner fee
The partner (integrator) fee is calculated as a percentage of the spot price (beforeAllFees), not the post-fee amounts.
Sell orders (buy token units):
beforeAllFees.sellAmount.
Slippage
Slippage tolerance is applied to theafterPartnerFees amount (not the spot price):
Flow for sell orders
The code below is simplified. See the full working code in CoW SDK getQuoteAmountsAndCosts.
The /quote response maps directly to afterNetworkCosts. beforeAllFees is reconstructed from it for partner fee calculations:
Flow for buy orders
The code below is simplified. See the full working code in CoW SDK getQuoteAmountsAndCosts.
The /quote sell amount maps to afterProtocolFees. The buy amount is fixed and maps to beforeAllFees:
All formulas at a glance
Below is every stage computation in one place. All values are in token atoms (integers).protocolFeeBps is in basis points (e.g. "2" = 2 bps = 0.02%).
Sell order — full computation:
Step 4: Construct the Final Order
The signed order combines the quote API response with UI/integrator settings:
The resulting order contains the
afterSlippage buy amount (for sell orders) or sell amount (for buy orders), which the protocol guarantees as the minimum the user will receive (or maximum they’ll pay). The fixed amount (sellAmount for sell orders, buyAmount for buy orders), meanwhile, corresponds to the spot price amount.
Sell order:
Step 5: Sign the Order
Sign the order using the amounts from Step 4, with the order parameters from the quote. The signing process depends on yoursigningScheme:
The EIP-712 domain and struct types are defined by the CoW Protocol settlement contract. Sign the computed amounts (not the raw quote amounts) along with the other order parameters.
If the quote response includes a full JSON
quote.appData, sign quote.appDataHash. If you requested a hash-only appData, sign that hash value directly.
EIP-712 signing example (TypeScript)
cast, Python eth_account), see the Quickstart: Raw API (cURL). For all four signing schemes in depth, see Signing Schemes.
Step 6: Submit the Order
Endpoint:POST /api/v1/orders
expiration timestamp. expiration is not part of the signed order payload, but it still determines whether the backend will accept the quoted fee data.
Responses
Step 7: Monitor the Order
Get order details
Endpoint:GET /api/v1/orders/{UID}
Returns the full order object including execution status.
Get auction status
Endpoint:GET /api/v1/orders/{UID}/status
Returns the order’s position in the auction lifecycle:
The
value array lists solvers that proposed solutions for the order, with their proposed execution amounts. If the array is empty or absent, no solver included the order in their solution.
Get trades
Endpoint:GET /api/v2/trades?orderUid={UID}
Returns executed trade data once the order has been settled:
Step 8: List Orders for an Account
Endpoint:GET /api/v1/account/{owner}/orders
Returns all orders for an address, sorted newest-first.
There are no server-side filters for status or token. To get only open orders or orders for a specific asset, you must paginate through results and filter client-side. Since orders are sorted by creation date descending, open orders will be near the top — you can stop paginating once you encounter orders with
validTo in the past.
Error Handling
Quote errors (POST /api/v1/quote)
Order creation errors (POST /api/v1/orders)
For a comprehensive list of every API error code with root causes and fixes, see the Error Reference.
Pre-Flight Checklist
Before placing an order, walk through these checks. Most failed orders come down to one of these issues.1. Token allowance to the Vault Relayer
The trader’s wallet must have approved the CoW Protocol Vault Relayer contract (0xC92E8bdf79f0507f65a392b0ab4667716BFE0110) to spend the sell token before placing the order (not before getting the quote — quotes don’t require allowance). If the allowance is insufficient, the order will be accepted by the API but solvers will not be able to execute it, and you’ll see an InsufficientAllowance error if the backend checks balances at submission time.
Make sure the approval amount covers at least the signed sellAmount of the order.
2. Sufficient balance at order placement
The trader’s address must hold enough sell token to cover the full signedsellAmount at the time the order is placed — not just at the time of quoting. Quotes are informational and don’t check balances.
For buy orders, remember that the signed sell amount includes protocol fees, network costs, partner fees, and slippage on top of the spot price — so the required balance is significantly higher than what you’d calculate from the raw exchange rate alone.
3. Quote amounts ≠ signing amounts
If your integration applies partner fees or client-side slippage, thesellAmount and buyAmount from the /quote response are not yet your final signing amounts. They do not include partner fees or slippage. Compute the adjusted amounts first (see Step 3) before signing. Signing the raw quote amounts in that case will result in an order with no slippage protection and missing partner fee revenue.
4. Set feeAmount to "0" on order creation
The quote response returns a non-zero feeAmount for informational purposes (showing the estimated network cost in sell token terms). When submitting the order, the feeAmount field must be "0". Solvers compute fees dynamically at execution time.
5. signingScheme must match your signature
The signingScheme you pass in the quote request determines the structure of the returned order, which in turn affects the order UID. If you request a quote with signingScheme: "eip712" but then sign with ethsign, the signature won’t match and the order will fail with InvalidSignature.
6. Quote expiration
Quotes have anexpiration timestamp in ISO-8601 format. If you sign and submit after this time, the backend may reject the order. Get the quote, compute amounts, sign, and submit promptly.
7. validTo must be reasonable
Orders with validTo too close to the current time may expire before solvers can act. Orders with validTo too far in the future will be rejected with ExcessiveValidTo. If you used validFor in the quote request, the response calculates an appropriate validTo for you.
8. Pass the quoteId and from
Include quoteId (from the quote’s id field) for slippage analysis. Include from so the backend can verify the signer matches the expected address — without it, a malformed signature might silently resolve to a wrong address.
Common Failure Scenarios
Quick Reference: Full Flow
Rate Limits
- Quote requests: 10 requests/second
- Order submission: 5 requests/second
- General endpoints: 100 requests/minute
Resources
- Quickstart: Raw API (cURL) — End-to-end walkthrough with signing examples
- How Intents Are Formed — Full fee pipeline with diagrams, code, and formula reference
- Fee Model — How fees work and how to retrieve fee data for accounting
- Order Book API Reference — Complete endpoint documentation
- Order Book API Reference — Interactive endpoint docs and playground
- Signing Schemes — All four supported signing methods
- Error Reference — Every API error code with root causes and fixes
- CoW SDK
getQuoteAmountsAndCosts— Production implementation of the amount computation logic