> ## 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.

# Cancel an order by marking it invalid with a timestamp.

> The successful deletion might not prevent solvers from settling the
order.

Authentication must be provided by providing an
[EIP-712](https://eips.ethereum.org/EIPS/eip-712) signature of an
`OrderCancellation(bytes orderUid)` message.



## OpenAPI

````yaml cow-protocol/reference/apis/openapi/orderbook.yml delete /api/v1/orders/{UID}
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/orders/{UID}:
    delete:
      summary: Cancel an order by marking it invalid with a timestamp.
      description: |-
        The successful deletion might not prevent solvers from settling the
        order.

        Authentication must be provided by providing an
        [EIP-712](https://eips.ethereum.org/EIPS/eip-712) signature of an
        `OrderCancellation(bytes orderUid)` message.
      operationId: cancelOrder
      parameters:
        - in: path
          name: UID
          schema:
            $ref: '#/components/schemas/UID'
          required: true
      requestBody:
        description: Signed `OrderCancellation`
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderCancellation'
      responses:
        '200':
          description: Order cancelled.
        '400':
          description: Malformed signature.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCancellationError'
        '401':
          description: Invalid signature.
        '404':
          description: Order was not found.
        '422':
          description: Unable to parse request body as valid JSON.
      deprecated: true
components:
  schemas:
    UID:
      description: |-
        Unique identifier for the order: 56 bytes encoded as hex with `0x`
        prefix.

        Bytes 0..32 are the order digest, bytes 30..52 the owner address and
        bytes 52..56 the expiry (`validTo`) as a `uint32` unix epoch timestamp.
      type: string
      example: >-
        0xff2e2e54d178997f173266817c1e9ed6fee1a1aae4b43971c53b543cffcc2969845c6f5599fbb25dbdd1b9b013daf85c03f3c63763e4bc4a
    OrderCancellation:
      description: |
        [EIP-712](https://eips.ethereum.org/EIPS/eip-712) signature of struct
        `OrderCancellation(bytes orderUid)` from the order's owner.
      type: object
      properties:
        signature:
          description: OrderCancellation signed by owner
          allOf:
            - $ref: '#/components/schemas/EcdsaSignature'
        signingScheme:
          $ref: '#/components/schemas/EcdsaSigningScheme'
      required:
        - signature
        - signingScheme
    OrderCancellationError:
      type: object
      properties:
        errorType:
          type: string
          enum:
            - InvalidSignature
            - WrongOwner
            - OrderNotFound
            - AlreadyCancelled
            - OrderFullyExecuted
            - OrderExpired
            - OnChainOrder
        description:
          type: string
      required:
        - errorType
        - description
    EcdsaSignature:
      description: 65 bytes encoded as hex with `0x` prefix. `r || s || v` from the spec.
      type: string
      example: >-
        0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
    EcdsaSigningScheme:
      description: How was the order signed?
      type: string
      enum:
        - eip712
        - ethsign

````