Order Events
  • 13 May 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light

Order Events

  • Dark
    Light

Article summary

Order Updated, Created, and Committed Events

The body of the order event for updated, created, and committed events matches the order API schema, but omitting the transactions field, for example:

{
  id: 1234,
  type: "ORDER",
  number: 1,
  customer: {
    id: 4321,
    type: "CUSTOMER",
  },
  contract: {
    id: "11111111-1111-1111-1111-111111111111",
    type: "CONTRACT",
  },
  contractType: {
    id: "22222222-2222-2222-2222-222222222222",
    type: "CONTRACT_TYPE",
  },
  delivery: {
    shippingDate: "2024-01-23",
  },
  discounts: [
    {
      code: "NEW_YEAR_NEW_ME",
    },
  ],
  status: "PENDING",
  billing: {
    status: "PENDING",
  },
  pricing: {
    currencyCode: "USD",
    totalPrice: 6400,
  },
  lineItems: [
    {
      id: "5",
      type: "PRODUCT",
      quantity: 6,
      meta: {
        source: "order gen",
      },
    },
  ],
  updatedAt: "2023-12-28T00:00:52.000Z",
  createdAt: "2023-09-27T01:02:01.000Z",
}

Order Refunded (Credit)

For order refunded events, the body varies depending on whether it was a credit or monetary refund, for example:

{
    "creditParams": {
      "creditAmount": 5,
      "customerId": "5275",
      "subscriptionId": "81aa853b-4f09-4ecd-9404-85ac02a0997c"
    },
    "orderId": "1587",
    "type": "credit"
}

Order Refunded (Monetary)

{
    "monetaryParams": {
      "refundAmount": 100,
      "transactionId": "12123455",
      "currency": "GBP",
    },
    "orderId": "1588",
    "type": "monetary"
}


Was this article helpful?