Skip to content

order/cancelled

Overview

PropertyValue
Webhook typeorder/cancelled
Kafka topicorder.cancelled
DirectionPlatform → Your endpoint

Description

Fired when an order is cancelled. Cancellation can be initiated by an operator, by the customer, or automatically by the system (e.g. payment failure, inventory exhaustion with inventoryPolicy: DENY).

Trigger Conditions

  • An operator cancels the order via the GraphQL API
  • All order lines transition to CANCELED status
  • Automatic cancellation due to inventory policy or other business rules
  • Note: cancellation of individual lines does not trigger this event; it triggers order/updated

Message Envelope

json
{
  "header": {
    "organizationId": "org_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "messageId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "webhookId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "type": "order/cancelled",
    "date": "2024-03-15T12:00:00.000Z"
  },
  "body": { ... }
}

Body — Property Table

The body has the same shape as order/created. See order-created.md for the full property table.

In a cancelled order, the following fields will always be set:

FieldExpected value
lines[].statusCANCELED for all cancelled lines
lockedfalse

Note: the state field does not have a dedicated CANCELLED enum value in the OrderState enum. The cancellation is reflected at the line level (status: CANCELED) rather than in the top-level order state.

Full JSON Payload Sample

json
{
  "header": {
    "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "messageId": "a7b8c9d0-e1f2-3456-abcd-678901234567",
    "webhookId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "type": "order/cancelled",
    "date": "2024-03-15T12:00:00.000Z"
  },
  "body": {
    "id": "d4e5f6a7-b8c9-0123-defa-234567890123",
    "externalReference": "SHOP-12345",
    "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "tpAppId": "e5f6a7b8-c9d0-1234-efab-345678901234",
    "shippingMethodId": "f6a7b8c9-d0e1-2345-fabc-456789012345",
    "shippingMethodName": "Colissimo Domicile",
    "collectPointId": null,
    "collectPointCountry": null,
    "collectPointZipCode": null,
    "type": "B2C",
    "dispatchingType": "AUTOMATIC",
    "total": 85.00,
    "totalTaxInclusive": 102.00,
    "totalShipping": 5.99,
    "totalDiscount": 0.00,
    "totalVat": 17.00,
    "totalInsurance": null,
    "currency": "EUR",
    "invoiceNumber": "INV-2024-001234",
    "invoiceUrl": "https://cdn.example.com/invoices/INV-2024-001234.pdf",
    "gift": false,
    "inventoryPolicy": "DENY",
    "issuedAt": "2024-03-15T09:00:00.000Z",
    "prepareAt": null,
    "receivedAt": "2024-03-15T10:23:45.000Z",
    "fulfillmentRequestedAt": null,
    "buyer": {
      "id": "a7b8c9d0-e1f2-3456-abcd-567890123456",
      "type": "PERSON",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "fullname": "Alice Dupont",
      "email": "alice.dupont@example.com",
      "address": "12 Rue de la Paix",
      "addressComplement": "Apt 4B",
      "zipcode": "75001",
      "country": "FR",
      "city": "Paris",
      "state": null,
      "phone": "+33612345678",
      "comments": null,
      "metadata": null,
      "taxId": null,
      "eori": null,
      "form": null,
      "capital": null,
      "companyId": null,
      "registration": null
    },
    "billingContact": {
      "id": "a7b8c9d0-e1f2-3456-abcd-567890123456",
      "type": "PERSON",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "fullname": "Alice Dupont",
      "email": "alice.dupont@example.com",
      "address": "12 Rue de la Paix",
      "addressComplement": "Apt 4B",
      "zipcode": "75001",
      "country": "FR",
      "city": "Paris",
      "state": null,
      "phone": "+33612345678",
      "comments": null,
      "metadata": null,
      "taxId": null,
      "eori": null,
      "form": null,
      "capital": null,
      "companyId": null,
      "registration": null
    },
    "deliveryContact": {
      "id": "b8c9d0e1-f2a3-4567-bcde-678901234567",
      "type": "PERSON",
      "organizationId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "fullname": "Alice Dupont",
      "email": "alice.dupont@example.com",
      "address": "12 Rue de la Paix",
      "addressComplement": "Apt 4B",
      "zipcode": "75001",
      "country": "FR",
      "city": "Paris",
      "state": null,
      "phone": "+33612345678",
      "comments": null,
      "metadata": null,
      "taxId": null,
      "eori": null,
      "form": null,
      "capital": null,
      "companyId": null,
      "registration": null
    },
    "seller": null,
    "comment": "Cancelled by customer request",
    "meta": null,
    "state": "OPENED",
    "priority": "NORMAL",
    "locked": false,
    "opening": false,
    "sourceType": "CMS",
    "deliveryType": "HOME",
    "lines": [
      {
        "id": "c9d0e1f2-a3b4-5678-cdef-789012345678",
        "orderId": "d4e5f6a7-b8c9-0123-defa-234567890123",
        "status": "CANCELED",
        "label": "T-Shirt Blanc Taille M",
        "sku": "TSHIRT-WHITE-M",
        "price": 25.00,
        "vatRate": 0.20,
        "total": 50.00,
        "totalTaxInclusive": 60.00,
        "fulfillableQuantity": 2,
        "quantity": 2,
        "fulfilledQuantity": 0,
        "meta": null,
        "locationId": null,
        "shippingMethodId": null,
        "number": "1"
      },
      {
        "id": "d0e1f2a3-b4c5-6789-defa-890123456789",
        "orderId": "d4e5f6a7-b8c9-0123-defa-234567890123",
        "status": "CANCELED",
        "label": "Pantalon Bleu Taille 38",
        "sku": "PANTS-BLUE-38",
        "price": 35.00,
        "vatRate": 0.20,
        "total": 35.00,
        "totalTaxInclusive": 42.00,
        "fulfillableQuantity": 1,
        "quantity": 1,
        "fulfilledQuantity": 0,
        "meta": null,
        "locationId": null,
        "shippingMethodId": null,
        "number": "2"
      }
    ]
  }
}

Notes

  • order/cancelled is a terminal event. Once an order is cancelled, no further order events will be emitted.
  • The state field on the order object does not change to a "cancelled" value — cancellation is expressed at the line level (status: CANCELED).
  • Partial cancellations (only some lines cancelled) emit order/updated, not order/cancelled.
  • If cancellation occurs while a delivery order is already in progress, the fulfillment service may receive a cancellation request — check for corresponding delivery_order/cancelled events.
  • A cancelled order may still have associated delivery orders in terminal states — check their events for the full picture.

HappyColis API Documentation