> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cow.bleu.builders/llms.txt
> Use this file to discover all available pages before exploring further.

# Quote a price and fee for the specified order parameters.

> Given a partial order compute the minimum fee and a price estimate for
the order. The response includes base order parameters in `quote`, plus
quote metadata such as `expiration` and `id`.

If your integration applies client-side slippage or partner fees before
signing, recompute the signing amounts before you create the order.

Related docs:
- [Orderbook API overview](/cow-protocol/reference/apis/orderbook)
- [API Integration Guide](/cow-protocol/howto/integrate/api)
- [Quickstart: Raw API (cURL)](/cow-protocol/tutorials/quickstart-curl)
- [TypeScript `OrderBookApi`](/cow-sdk/api/order-book-api)
- [Python `OrderBookApi`](/cow-py/api/order-book)
- [POST /api/v1/orders](/api-reference/create-a-new-order)



## OpenAPI

````yaml cow-protocol/reference/apis/openapi/orderbook.yml post /api/v1/quote
openapi: 3.0.3
info:
  version: 0.0.1
  title: Order Book API
servers:
  - description: Mainnet (Prod)
    url: https://api.cow.fi/mainnet
  - description: Mainnet (Staging)
    url: https://barn.api.cow.fi/mainnet
  - description: Gnosis Chain (Prod)
    url: https://api.cow.fi/xdai
  - description: Gnosis Chain (Staging)
    url: https://barn.api.cow.fi/xdai
  - description: Arbitrum One (Prod)
    url: https://api.cow.fi/arbitrum_one
  - description: Arbitrum One (Staging)
    url: https://barn.api.cow.fi/arbitrum_one
  - description: Base (Prod)
    url: https://api.cow.fi/base
  - description: Base (Staging)
    url: https://barn.api.cow.fi/base
  - description: Avalanche (Prod)
    url: https://api.cow.fi/avalanche
  - description: Avalanche (Staging)
    url: https://barn.api.cow.fi/avalanche
  - description: Polygon (Prod)
    url: https://api.cow.fi/polygon
  - description: Polygon (Staging)
    url: https://barn.api.cow.fi/polygon
  - description: Lens (Prod)
    url: https://api.cow.fi/lens
  - description: Lens (Staging)
    url: https://barn.api.cow.fi/lens
  - description: Linea (Prod)
    url: https://api.cow.fi/linea
  - description: Linea (Staging)
    url: https://barn.api.cow.fi/linea
  - description: BNB (Prod)
    url: https://api.cow.fi/bnb
  - description: BNB (Staging)
    url: https://barn.api.cow.fi/bnb
  - description: Plasma (Prod)
    url: https://api.cow.fi/plasma
  - description: Plasma (Staging)
    url: https://barn.api.cow.fi/plasma
  - description: Ink (Prod)
    url: https://api.cow.fi/ink
  - description: Ink (Staging)
    url: https://barn.api.cow.fi/ink
  - description: Sepolia (Prod)
    url: https://api.cow.fi/sepolia
  - description: Sepolia (Staging)
    url: https://barn.api.cow.fi/sepolia
  - description: Local
    url: http://localhost:8080
security: []
paths:
  /api/v1/quote:
    post:
      summary: Quote a price and fee for the specified order parameters.
      description: |-
        Given a partial order compute the minimum fee and a price estimate for
        the order. The response includes base order parameters in `quote`, plus
        quote metadata such as `expiration` and `id`.

        If your integration applies client-side slippage or partner fees before
        signing, recompute the signing amounts before you create the order.

        Related docs:
        - [Orderbook API overview](/cow-protocol/reference/apis/orderbook)
        - [API Integration Guide](/cow-protocol/howto/integrate/api)
        - [Quickstart: Raw API (cURL)](/cow-protocol/tutorials/quickstart-curl)
        - [TypeScript `OrderBookApi`](/cow-sdk/api/order-book-api)
        - [Python `OrderBookApi`](/cow-py/api/order-book)
        - [POST /api/v1/orders](/api-reference/create-a-new-order)
      operationId: quote
      requestBody:
        description: The order parameters to compute a quote for.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderQuoteRequest'
      responses:
        '200':
          description: Quoted order parameters and quote metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderQuoteResponse'
        '400':
          description: Error quoting order.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PriceEstimationError'
        '404':
          description: No route was found for the specified order.
        '422':
          description: Unable to parse request body as valid JSON.
        '429':
          description: Too many order quotes.
        '500':
          description: Unexpected error quoting an order.
components:
  schemas:
    OrderQuoteRequest:
      description: >
        Choose one request shape based on two decisions: how you specify the
        order size, and whether expiry is relative (`validFor`) or absolute
        (`validTo`).

        Use `sellAmountBeforeFee` when you want to quote from a total sell
        budget, `sellAmountAfterFee` when you already know the exact sell amount
        that should land on the order, or `buyAmountAfterFee` when you want an
        exact buy target.
      oneOf:
        - title: Sell Budget + `validFor`
          description: >
            Quote a sell order from a total sell budget using
            `sellAmountBeforeFee` and a relative expiry via `validFor`.
          allOf:
            - type: object
              properties:
                kind:
                  allOf:
                    - $ref: '#/components/schemas/OrderQuoteSideKindSell'
                sellAmountBeforeFee:
                  description: >
                    The total amount that is available for the order. From this
                    value, the fee is deducted and the buy amount is calculated.
                  allOf:
                    - $ref: '#/components/schemas/TokenAmount'
              required:
                - kind
                - sellAmountBeforeFee
            - type: object
              properties:
                validFor:
                  description: >-
                    Number (`uint32`) of seconds that the order should be valid
                    for.
                  type: integer
            - $ref: '#/components/schemas/OrderQuoteRequestBase'
        - title: Sell Budget + `validTo`
          description: >
            Quote a sell order from a total sell budget using
            `sellAmountBeforeFee` and an absolute expiry via `validTo`.
          allOf:
            - type: object
              properties:
                kind:
                  allOf:
                    - $ref: '#/components/schemas/OrderQuoteSideKindSell'
                sellAmountBeforeFee:
                  description: >
                    The total amount that is available for the order. From this
                    value, the fee is deducted and the buy amount is calculated.
                  allOf:
                    - $ref: '#/components/schemas/TokenAmount'
              required:
                - kind
                - sellAmountBeforeFee
            - type: object
              properties:
                validTo:
                  description: Unix timestamp (`uint32`) until which the order is valid.
                  type: integer
            - $ref: '#/components/schemas/OrderQuoteRequestBase'
        - title: Sell Net Amount + `validFor`
          description: >
            Quote a sell order using `sellAmountAfterFee` and a relative expiry
            via `validFor`.
          allOf:
            - type: object
              properties:
                kind:
                  allOf:
                    - $ref: '#/components/schemas/OrderQuoteSideKindSell'
                sellAmountAfterFee:
                  description: The `sellAmount` for the order.
                  allOf:
                    - $ref: '#/components/schemas/TokenAmount'
              required:
                - kind
                - sellAmountAfterFee
            - type: object
              properties:
                validFor:
                  description: >-
                    Number (`uint32`) of seconds that the order should be valid
                    for.
                  type: integer
            - $ref: '#/components/schemas/OrderQuoteRequestBase'
        - title: Sell Net Amount + `validTo`
          description: >
            Quote a sell order using `sellAmountAfterFee` and an absolute expiry
            via `validTo`.
          allOf:
            - type: object
              properties:
                kind:
                  allOf:
                    - $ref: '#/components/schemas/OrderQuoteSideKindSell'
                sellAmountAfterFee:
                  description: The `sellAmount` for the order.
                  allOf:
                    - $ref: '#/components/schemas/TokenAmount'
              required:
                - kind
                - sellAmountAfterFee
            - type: object
              properties:
                validTo:
                  description: Unix timestamp (`uint32`) until which the order is valid.
                  type: integer
            - $ref: '#/components/schemas/OrderQuoteRequestBase'
        - title: Buy Target + `validFor`
          description: >
            Quote a buy order for an exact target amount using
            `buyAmountAfterFee` and a relative expiry via `validFor`.
          allOf:
            - type: object
              properties:
                kind:
                  allOf:
                    - $ref: '#/components/schemas/OrderQuoteSideKindBuy'
                buyAmountAfterFee:
                  description: The `buyAmount` for the order.
                  allOf:
                    - $ref: '#/components/schemas/TokenAmount'
              required:
                - kind
                - buyAmountAfterFee
            - type: object
              properties:
                validFor:
                  description: >-
                    Number (`uint32`) of seconds that the order should be valid
                    for.
                  type: integer
            - $ref: '#/components/schemas/OrderQuoteRequestBase'
        - title: Buy Target + `validTo`
          description: >
            Quote a buy order for an exact target amount using
            `buyAmountAfterFee` and an absolute expiry via `validTo`.
          allOf:
            - type: object
              properties:
                kind:
                  allOf:
                    - $ref: '#/components/schemas/OrderQuoteSideKindBuy'
                buyAmountAfterFee:
                  description: The `buyAmount` for the order.
                  allOf:
                    - $ref: '#/components/schemas/TokenAmount'
              required:
                - kind
                - buyAmountAfterFee
            - type: object
              properties:
                validTo:
                  description: Unix timestamp (`uint32`) until which the order is valid.
                  type: integer
            - $ref: '#/components/schemas/OrderQuoteRequestBase'
    OrderQuoteResponse:
      description: |
        An order quote returned by the backend, including base order parameters
        plus quote metadata such as `expiration` and `id`.

        If your integration applies client-side slippage or partner fees before
        signing, recompute the signing amounts before order creation.
      type: object
      properties:
        quote:
          description: >
            The quoted order parameters returned by the backend.

            These values can be signed directly only if they are submitted
            unchanged. If you apply client-side slippage or partner fees,
            recompute the signing amounts first.
          allOf:
            - $ref: '#/components/schemas/OrderParameters'
        from:
          description: |
            The address of the trader for whom the quote was requested.
          allOf:
            - $ref: '#/components/schemas/Address'
        expiration:
          description: |
            Expiration date of the offered fee. Order service might not accept
            the fee after this expiration date. Encoded as ISO 8601 UTC.
          type: string
          example: '1985-03-10T18:35:18.814523Z'
        id:
          description: >
            Quote ID linked to a quote to enable providing more metadata when
            analysing order slippage.
          type: integer
        verified:
          description: >
            Whether it was possible to verify that the quoted amounts are
            accurate using a simulation.
          type: boolean
        protocolFeeBps:
          description: >
            Protocol fee in basis points (e.g., "2" for 0.02%). This represents
            the volume-based fee policy. Only present when a volume fee is
            configured.
          type: string
          example: '2'
      required:
        - quote
        - expiration
        - verified
    PriceEstimationError:
      type: object
      properties:
        errorType:
          type: string
          enum:
            - QuoteNotVerified
            - UnsupportedToken
            - NoLiquidity
            - UnsupportedOrderType
        description:
          type: string
      required:
        - errorType
        - description
    OrderQuoteSideKindSell:
      type: string
      enum:
        - sell
    TokenAmount:
      description: Amount of a token. `uint256` encoded in decimal.
      type: string
      example: '1234567890'
    OrderQuoteRequestBase:
      type: object
      properties:
        sellToken:
          description: ERC-20 token to be sold
          allOf:
            - $ref: '#/components/schemas/Address'
        buyToken:
          description: ERC-20 token to be bought
          allOf:
            - $ref: '#/components/schemas/Address'
        receiver:
          description: >
            An optional address to receive the proceeds of the trade instead of
            the

            `owner` (i.e. the order signer).
          allOf:
            - $ref: '#/components/schemas/Address'
          nullable: true
        appData:
          description: |-
            AppData which will be assigned to the order.

            Expects either a string JSON doc as defined on
            [AppData](https://github.com/cowprotocol/app-data) or a hex
            encoded string for backwards compatibility.

            When the first format is used, it's possible to provide the
            derived appDataHash field.
          oneOf:
            - title: Full App Data JSON
              allOf:
                - $ref: '#/components/schemas/AppData'
            - title: App Data Hash
              allOf:
                - $ref: '#/components/schemas/AppDataHash'
        appDataHash:
          description: |-
            The hash of the stringified JSON appData doc.

            If present, `appData` field must be set with the aforementioned
            data where this hash is derived from.

            In case they differ, the call will fail.
          anyOf:
            - $ref: '#/components/schemas/AppDataHash'
        sellTokenBalance:
          allOf:
            - $ref: '#/components/schemas/SellTokenSource'
          default: erc20
        buyTokenBalance:
          allOf:
            - $ref: '#/components/schemas/BuyTokenDestination'
          default: erc20
        from:
          $ref: '#/components/schemas/Address'
        priceQuality:
          allOf:
            - $ref: '#/components/schemas/PriceQuality'
          default: verified
        signingScheme:
          allOf:
            - $ref: '#/components/schemas/SigningScheme'
          default: eip712
        onchainOrder:
          description: >
            Flag to signal whether the order is intended for on-chain order
            placement. Only valid for non ECDSA-signed orders."
          default: false
        timeout:
          type: integer
          description: >
            User provided timeout in milliseconds. Can only be used to reduce
            the response time for quote requests if the default is too slow as
            values greater than the default will be capped to the default. Note
            that reducing the timeout can result in worse quotes because the
            reduced timeout might be too slow for some price estimators.
      required:
        - sellToken
        - buyToken
        - from
    OrderQuoteSideKindBuy:
      type: string
      enum:
        - buy
    OrderParameters:
      description: Order parameters.
      type: object
      properties:
        sellToken:
          description: ERC-20 token to be sold.
          allOf:
            - $ref: '#/components/schemas/Address'
        buyToken:
          description: ERC-20 token to be bought.
          allOf:
            - $ref: '#/components/schemas/Address'
        receiver:
          description: >
            An optional Ethereum address to receive the proceeds of the trade
            instead of the owner (i.e. the order signer).
          allOf:
            - $ref: '#/components/schemas/Address'
          nullable: true
        sellAmount:
          description: Amount of `sellToken` to be sold in atoms.
          allOf:
            - $ref: '#/components/schemas/TokenAmount'
        buyAmount:
          description: Amount of `buyToken` to be bought in atoms.
          allOf:
            - $ref: '#/components/schemas/TokenAmount'
        validTo:
          description: Unix timestamp (`uint32`) until which the order is valid.
          type: integer
        appData:
          description: >
            The app data associated with the order. In quote responses, this can
            be either the full app data JSON string or the app data hash,
            depending on what was provided in the quote request.
          oneOf:
            - title: Full App Data JSON
              allOf:
                - $ref: '#/components/schemas/AppData'
            - title: App Data Hash
              allOf:
                - $ref: '#/components/schemas/AppDataHash'
        appDataHash:
          description: >
            The hash of the app data. Only present when the full app data is
            also provided in the `appData` field.
          allOf:
            - $ref: '#/components/schemas/AppDataHash'
        feeAmount:
          description: >
            The fee amount in sell token atoms. For quote responses, this
            represents

            the estimated network fee, calculated as:

            `feeAmount = ceil((gasAmount * gasPrice) / sellTokenPrice)`.


            When creating an order, this should be set to zero as fees are now

            computed dynamically by solvers.
          allOf:
            - $ref: '#/components/schemas/TokenAmount'
        gasAmount:
          description: |
            The estimated gas units required to execute the quoted trade.
          type: string
          example: '150000'
        gasPrice:
          description: >
            The estimated gas price at the time of quoting, measured in Wei per
            gas unit.
          type: string
          example: '15000000000'
        sellTokenPrice:
          description: |
            Represents how much one atomic unit of the sell token is worth
            in the network's native token (in Wei or the equivalent atom).
          type: string
          example: '0.0004'
        kind:
          description: The kind is either a buy or sell order.
          allOf:
            - $ref: '#/components/schemas/OrderKind'
        partiallyFillable:
          description: Is the order fill-or-kill or partially fillable?
          type: boolean
        sellTokenBalance:
          description: >
            Where the sell token should be drawn from. Defaults to `erc20` for
            standard ERC-20 token transfers.
          allOf:
            - $ref: '#/components/schemas/SellTokenSource'
          default: erc20
        buyTokenBalance:
          description: >
            Where the buy token should be transferred to. Defaults to `erc20`
            for standard ERC-20 token transfers.
          allOf:
            - $ref: '#/components/schemas/BuyTokenDestination'
          default: erc20
        signingScheme:
          description: >
            The signing scheme to use for the order. Defaults to `eip712` for
            standard typed data signing.
          allOf:
            - $ref: '#/components/schemas/SigningScheme'
          default: eip712
      required:
        - sellToken
        - buyToken
        - sellAmount
        - buyAmount
        - validTo
        - appData
        - feeAmount
        - gasAmount
        - gasPrice
        - sellTokenPrice
        - kind
        - partiallyFillable
    Address:
      description: 20 byte Ethereum address encoded as a hex with `0x` prefix.
      type: string
      example: '0x6810e776880c02933d47db1b9fc05908e5386b96'
    AppData:
      description: |
        The string encoding of a JSON object representing some `appData`. The
        format of the JSON expected in the `appData` field is defined
        [here](https://github.com/cowprotocol/app-data).
      type: string
      example: '{"version":"0.9.0","metadata":{}}'
    AppDataHash:
      description: >
        32 bytes encoded as hex with `0x` prefix.

        It's expected to be the hash of the stringified JSON object representing
        the `appData`.
      type: string
      example: '0x0000000000000000000000000000000000000000000000000000000000000000'
    SellTokenSource:
      description: Where should the `sellToken` be drawn from?
      type: string
      enum:
        - erc20
        - internal
        - external
    BuyTokenDestination:
      description: Where should the `buyToken` be transferred to?
      type: string
      enum:
        - erc20
        - internal
    PriceQuality:
      description: |-
        How good should the price estimate be?

        Fast: The price estimate is chosen among the fastest N price estimates.
        Optimal: The price estimate is chosen among all price estimates.
        Verified: The price estimate is chosen among all verified/simulated
        price estimates.

        **NOTE**: Orders are supposed to be created from `verified` or `optimal`
        price estimates.
      type: string
      enum:
        - fast
        - optimal
        - verified
    SigningScheme:
      description: How was the order signed?
      type: string
      enum:
        - eip712
        - ethsign
        - presign
        - eip1271
    OrderKind:
      description: Is this order a buy or sell?
      type: string
      enum:
        - buy
        - sell

````