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

# Cancel Order

> Cancel an existing delivery order by its reference number.



## OpenAPI

````yaml put /orders/{reference}
openapi: 3.0.1
info:
  title: Express Delivery API
  description: API for managing delivery orders
  version: 1.0.0
servers:
  - url: https://delivery-api.express.ci/
    description: Production server
security:
  - bearerAuth: []
paths:
  /orders/{reference}:
    put:
      summary: Cancel Order
      description: Cancel an existing delivery order by its reference number.
      parameters:
        - in: path
          name: reference
          description: Unique order reference in your system.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The canceled order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseOrder'
              example:
                referenceNumber: ORD0001
                total: 98150
                deliveryFee: 1500
                deliveryInstructions: Livrer à midi
                deliveryDeadline: '2025-06-05'
                status: canceled
                statusComment: null
                createdAt: '2025-06-05T07:05:21.000Z'
                updatedAt: '2025-06-05T08:04:00.000Z'
                recipient:
                  referenceNumber: null
                  name: John Doe
                  phone: '0702029254'
                  address:
                    name: 45 Avenue de la Paix
                    landmark: Terminus 81/82
                    city: Cocody
                    latitude: 5.403871
                    longitude: -3.9881079
                items:
                  - referenceNumber: ITEM001
                    orderId: 14
                    itemName: Samsung Galaxy A05 64Go
                    quantity: 1
                    total: 77900
                    size: S
                    weight: 0.5
                    itemUrl: >-
                      https://market.momo.africa/Portal/product/121731/1?tenantId=4&lang=fr
                    status: canceled
                    statusComment: null
                    createdAt: '2025-06-05T07:05:21.000Z'
                    updatedAt: '2025-06-05T08:04:00.000Z'
                    sender:
                      referenceNumber: '0596086680'
                      name: Samsung Store Abidjan
                      phone: '0700000001'
                      address:
                        name: 123 Rue Principale
                        landmark: Angré pétro ivoire
                        city: Cocody
                        latitude: 5.359951
                        longitude: -4.008256
                  - referenceNumber: ITEM002
                    orderId: 14
                    itemName: Riz vietnamien La Rizière long grains parfumé 5kg
                    quantity: 5
                    total: 18750
                    size: S
                    weight: 5.5
                    itemUrl: >-
                      https://market.momo.africa/Portal/product/107465/1?tenantId=4&lang=fr
                    status: canceled
                    statusComment: null
                    createdAt: '2025-06-05T07:05:21.000Z'
                    updatedAt: '2025-06-05T08:04:00.000Z'
                    sender:
                      referenceNumber: '0555306590'
                      name: Tech Shop
                      phone: '0700000002'
                      address:
                        name: 456 Avenue Tech
                        landmark: Liberté
                        city: Adjamé
                        latitude: 5.40387101
                        longitude: -4.009
components:
  schemas:
    ResponseOrder:
      type: object
      description: >-
        Represents the response payload for an order after it has been created,
        retrieved, or canceled.
      properties:
        referenceNumber:
          type: string
          description: Unique order reference in your system.
          example: ORD0001
        total:
          type: number
          format: float
          description: Total amount of the order including delivery fees.
          example: 98150
        deliveryFee:
          type: number
          format: float
          description: Fee for delivering the order.
          example: 1500
        deliveryInstructions:
          type: string
          description: Special instructions for the delivery process.
          example: Livrer à midi
          nullable: true
        receiptUrl:
          type: string
          format: uri
          description: >-
            URL to a printable PDF receipt for the order. If not provided,
            Express will generate a receipt from the order data.
          example: https://example.com/receipts/ORD0001.pdf
          nullable: true
        deliveryDeadline:
          type: string
          format: date-time
          description: The latest date by which the delivery should be completed.
          example: '2025-06-05'
          nullable: true
        status:
          type: string
          description: Current status of the order.
          example: pending
        statusComment:
          type: string
          description: Optional comments related to the order status.
          example: null
          nullable: true
        createdAt:
          type: string
          format: date-time
          description: Timestamp when the order was created.
          example: '2025-06-05T07:05:21.000Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp when the order was last updated.
          example: '2025-06-05T07:05:21.000Z'
        recipient:
          $ref: '#/components/schemas/Recipient'
        items:
          type: array
          description: List of items included in the order.
          items:
            $ref: '#/components/schemas/ResponseItem'
      required:
        - referenceNumber
        - total
        - deliveryFee
        - status
        - createdAt
        - updatedAt
        - recipient
        - items
    Recipient:
      type: object
      description: Details of the recipient receiving the order.
      properties:
        name:
          type: string
          description: Full name of the recipient.
          example: John Doe
          nullable: true
        phone:
          type: string
          description: >-
            Phone number of the recipient in E.164 format (e.g.,
            +2250702029254).
          example: '+2250702029254'
        address:
          $ref: '#/components/schemas/Address'
      required:
        - phone
        - address
    ResponseItem:
      type: object
      description: Represents an item included in an order response.
      properties:
        referenceNumber:
          type: string
          description: Unique reference number for the item.
          example: ITEM001
          nullable: true
        orderId:
          type: integer
          description: Identifier of the order this item belongs to.
          example: 14
        itemName:
          type: string
          description: Name or description of the item.
          example: Samsung Galaxy A05 64Go
        quantity:
          type: integer
          description: Quantity of the item.
          example: 1
        total:
          type: number
          format: float
          description: Total price of the item (quantity * unit price).
          example: 77900
        size:
          type: string
          description: Size category of the item.
          example: S
          nullable: true
        weight:
          type: number
          format: float
          description: Weight of the item in kilograms.
          example: 0.5
          nullable: true
        itemUrl:
          type: string
          format: uri
          description: URL of the item's image.
          example: >-
            https://market.momo.africa/Portal/product/121731/1?tenantId=4&lang=fr
          nullable: true
        status:
          type: string
          description: Current status of the item.
          example: pending
        statusComment:
          type: string
          description: Optional comments related to the item status.
          example: null
          nullable: true
        createdAt:
          type: string
          format: date-time
          description: Timestamp when this item was added to the order.
          example: '2025-06-05T07:05:21.000Z'
        updatedAt:
          type: string
          format: date-time
          description: Timestamp of the last update to this item.
          example: '2025-06-05T07:05:21.000Z'
        sender:
          $ref: '#/components/schemas/Sender'
      required:
        - referenceNumber
        - orderId
        - itemName
        - quantity
        - total
        - status
        - createdAt
        - updatedAt
        - sender
    Address:
      type: object
      description: Detailed address information.
      properties:
        name:
          type: string
          description: Street address or plus code (as shown by Google Maps).
          example: 8X9P+38P, Rue du Commerce, Abidjan, Côte d'Ivoire
        landmark:
          type: string
          description: Nearby landmark for easy identification.
          example: Terminus 81/82
          nullable: true
        city:
          type: string
          description: City where the address is located.
          example: Cocody
        latitude:
          type: number
          format: float
          description: GPS latitude of the address.
          example: 5.403871
          nullable: true
        longitude:
          type: number
          format: float
          description: GPS longitude of the address.
          example: -3.9881079
          nullable: true
      required:
        - name
        - city
    Sender:
      type: object
      description: Information about the sender of an item.
      properties:
        referenceNumber:
          type: string
          description: >-
            Unique merchant identifier in your system (can be a phone number or
            any other unique ID).
          example: '0596086680'
          nullable: true
        name:
          type: string
          description: Name of the sender or business.
          example: Samsung Store Abidjan
          nullable: true
        phone:
          type: string
          description: Phone number of the sender in E.164 format (e.g., +2250700000001).
          example: '+2250700000001'
        address:
          $ref: '#/components/schemas/Address'
      required:
        - referenceNumber
        - phone
        - address
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````