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

# Cancel order



## OpenAPI

````yaml POST /service-order/{serviceOrderId}/cancel
openapi: 3.1.0
info:
  title: OpenAPI Cents
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api3.trycents.com/api/v1/common
security: []
paths:
  /service-order/{serviceOrderId}/cancel:
    post:
      parameters:
        - $ref: '#/components/parameters/OriginHeader'
        - in: path
          name: serviceOrderId
          required: true
          schema:
            type: number
            format: float
      requestBody:
        required: true
        content:
          application/json:
            schema:
              properties:
                message:
                  type: string
                  nullable: true
                type:
                  type: string
                  enum:
                    - CUSTOM
                    - CANCELED_VIA_DOORDASH
                    - CANCELED_VIA_CHANGE_HANDLING
                    - CANCELED_VIA_CLOSURES
                    - MISSED_PICKUP
                    - NO_LONGER_NEEDED
                    - BY_MISTAKE
                    - DELIVERY_ISSUE
                    - CUSTOMER_NOT_AT_HOME
                    - BY_CUSTOMER_VIA_DRIVER
                    - BY_OPERATOR
                  nullable: false
              required:
                - message
                - type
              type: object
              example:
                type: BY_MISTAKE
                message: null
      responses:
        '200':
          description: The order canceled
          content:
            application/json:
              schema:
                type: boolean
        '404':
          description: Service order is not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                example: Service order is not found
        '500':
          description: >-
            The order cannot be cancelled because the order is already being
            processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
                example: Order can not be voided
      security:
        - bearerAuth: []
components:
  parameters:
    OriginHeader:
      name: fwdorigin
      in: header
      required: true
      schema:
        type: string
        default: DISPATCH_API
        enum:
          - DISPATCH_API
  schemas:
    Error:
      required:
        - error
      type: object
      properties:
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````