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

# Cancel Order By External Id

> Cancels an active order by its `external_id`.

Publishes updates in the following websocket topics: [`orderbook`](#operation/orderbook), [`balance`](#operation/balance) and [`order_status`](#operation/order_status).

---

**Authorization**

- Requires a valid API key.
- Required API-key permission(s):
  - Trading (Write)



## OpenAPI

````yaml delete /trade/orders/by-external-id
openapi: 3.0.0
info:
  title: Ripio Gateway
  description: Ripio API - Services documentation.
  version: 0.1.0
  x-logo:
    url: https://cwstatic.nyc3.digitaloceanspaces.com/1996/bitcointrade.png
servers:
  - url: https://api.ripio.com
    description: Production environment
security: []
paths:
  /trade/orders/by-external-id:
    delete:
      tags:
        - Ripio Trade
      summary: Orders - Cancel Order By External Id
      description: >-
        Cancels an active order by its `external_id`.


        Publishes updates in the following websocket topics:
        [`orderbook`](#operation/orderbook), [`balance`](#operation/balance) and
        [`order_status`](#operation/order_status).


        ---


        **Authorization**


        - Requires a valid API key.

        - Required API-key permission(s):
          - Trading (Write)
      parameters:
        - in: header
          name: authorization
          required: true
          description: The API key as a string.
          schema:
            type: string
        - in: header
          name: signature
          required: true
          description: >-
            See the [Generating
            Signature](/static/api/authentication#generating-signature) section
            for more details.
          schema:
            type: string
        - in: header
          name: timestamp
          required: true
          description: >-
            A timestamp in milliseconds. See the [Timestamp
            Security](/static/api/authentication#timestamp-security) section for
            more details.
          schema:
            type: number
        - in: header
          name: timstamp-tolerance
          required: false
          description: >-
            An additional, non-required parameter, that you can send to specify
            the number of milliseconds after the timestamp for the request to be
            valid. See the [Timestamp
            Security](/static/api/authentication#timestamp-security) section for
            more details.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              properties:
                external_id:
                  description: Order `external_id`
                  type: string
                  example: 0F4A8504-21FB-4BE6-9771-25DCF5F68F87
              required:
                - external_id
              type: object
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                description: Ok
                properties:
                  data:
                    properties:
                      id:
                        description: Order identifier
                        type: string
                      create_date:
                        description: Datetime of the order creation
                        type: string
                      executed_amount:
                        description: Executed amount
                        type: number
                      remaining_amount:
                        description: Remaining amount
                        type: number
                      remaining_value:
                        description: Remaining value
                        type: number
                      requested_amount:
                        description: Requested amount
                        type: number
                      side:
                        description: Order side (sell / buy)
                        type: string
                      status:
                        description: >-
                          Order status (executed_completely / executed_partially
                          / open / canceled)
                        type: string
                      total_value:
                        description: Total value
                        type: number
                      type:
                        description: Order type (limit / market)
                        type: string
                      price:
                        description: Price
                        type: number
                      update_date:
                        description: Datetime of the last update
                        type: string
                      pair:
                        description: Currency pair code
                        type: string
                        example: BTC_BRL
                      external_id:
                        description: >-
                          External id (this is sent by the user when creating an
                          order, and it's optional)
                        type: string
                        example: BEAB10B1-45B0-4999-9B2F-D2ED048D6C42
                    required:
                      - id
                      - create_date
                      - executed_amount
                      - remaining_amount
                      - remaining_value
                      - requested_amount
                      - status
                      - total_value
                      - price
                      - update_date
                      - pair
                    type: object
                    example:
                      create_date: '2017-12-08T23:42:54.960Z'
                      executed_amount: 0.02347418
                      external_id: B4A9F7F4-9C79-4921-9330-224C17260BDF
                      id: 7155ED34-9EC4-4733-8B32-1E4319CB662F
                      pair: BTC_BRL
                      price: 42600
                      remaining_amount: 0.1
                      remaining_value: 0.6
                      requested_amount: 0.02347418
                      requested_value: 1000
                      side: buy
                      status: canceled
                      total_value: 1000
                      type: limit
                      update_date: '2017-12-13T21:48:48.817Z'
                  error_code:
                    type: number
                    example: null
                  message:
                    type: string
                    example: null
                required:
                  - data
                  - error_code
                  - message
                type: object

````