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

# Cancel order

> Cancel an order identified by `order_id`. If it is not possible to cancel the order, **400** error code will be returned.



## OpenAPI

````yaml api-reference/schema.yaml post /orders/{order_id}/cancel/
openapi: 3.0.3
info:
  title: ''
  version: 0.0.0
servers:
  - url: https://api.parceltracer.com/v1/external/
    description: Parcel Tracer api endpoint
security: []
paths:
  /orders/{order_id}/cancel/:
    post:
      tags:
        - Orders
      summary: Cancel order
      description: >-
        Cancel an order identified by `order_id`. If it is not possible to
        cancel the order, **400** error code will be returned.
      operationId: cancel_order
      parameters:
        - in: path
          name: order_id
          schema:
            type: integer
          required: true
      responses:
        '204':
          description: No response body
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                OperationFailed:
                  value:
                    error: 'true'
                    message: Validation failed.
                    details: delivered orders can not be cancelled
                  summary: Operation Failed
          description: Bad Request
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              examples:
                NotFoundError:
                  value:
                    error: 'true'
                    message: Resource not found.
                    details: 'detail: Not found.'
                  summary: Example of resource not found error
          description: Order not found
      security:
        - MerchantAPIKey: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: boolean
        message:
          type: string
        details: {}
      required:
        - details
        - error
        - message
  securitySchemes:
    MerchantAPIKey:
      type: apiKey
      in: header
      name: X-Api-Key

````