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

# Cancel an order by order id

> Cancels one of your active orders. Requires TRADE permission.



## OpenAPI

````yaml /api-reference/derivatives-predictions-api/rest-api/cpm-spec.json delete /api/orders/{order_id}
openapi: 3.0.3
info:
  title: CPM Public REST API
  version: 0.1.0
servers:
  - url: https://api.example.com
    variables: {}
security:
  - auth_api_key: []
  - auth_timestamp: []
  - auth_passphrase: []
  - auth_signature: []
paths:
  /api/orders/{order_id}:
    delete:
      tags:
        - Orders
      summary: Cancel an order by order id
      description: Cancels one of your active orders. Requires TRADE permission.
      operationId: cancelOrder
      parameters:
        - name: order_id
          in: path
          description: >-
            Order ID to cancel. An order that belongs to another user is
            reported as UNKNOWN_ORDER.
          required: true
          deprecated: false
          allowEmptyValue: false
          schema:
            type: string
      responses:
        '200':
          description: Order canceled
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CancelOrderResponse'
        '400':
          description: Cancel rejected
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderErrorResponse'
      deprecated: false
      security: []
components:
  schemas:
    CancelOrderResponse:
      type: object
      additionalProperties: false
      properties:
        order_id:
          type: string
          description: Id of the canceled order, as a canonical decimal string.
          example: '698471892348'
        canceled_quantity:
          type: string
          description: >-
            Quantity removed from the book by the cancel, in contracts, as a
            decimal string.
          example: '15.00'
        total_filled_quantity:
          type: string
          description: >-
            Total quantity the order filled before it was canceled, in
            contracts, as a decimal string.
          example: '10.00'
        cancel_reason:
          type: string
          description: Why the order was canceled, for example USER_REQUEST.
          example: USER_REQUEST
    OrderErrorResponse:
      type: object
      additionalProperties: false
      properties:
        error:
          type: string
          description: >-
            Machine-readable error code, for example INVALID_FIELD,
            INSUFFICIENT_BALANCE, or UNAUTHORIZED.
          example: INVALID_FIELD
        message:
          type: string
          description: Human-readable description of the error.
          example: 'side must be one of: BUY, SELL, BUY_NO, SELL_NO'
  securitySchemes:
    auth_api_key:
      name: CB-ACCESS-KEY
      description: The API key string for the request
      in: header
      type: apiKey
    auth_timestamp:
      name: CB-ACCESS-TIMESTAMP
      description: The request timestamp (epoch seconds)
      in: header
      type: apiKey
    auth_passphrase:
      name: CB-ACCESS-PASSPHRASE
      description: The passphrase for the API key
      in: header
      type: apiKey
    auth_signature:
      name: CB-ACCESS-SIGN
      description: HMAC SHA-256 signature over TIMESTAMP + METHOD + REQUEST_PATH + BODY
      in: header
      type: apiKey

````