Skip to content

Order Item Updated (order_items.updated)

Description

This event occurs when an order item is created or updated, such as when its status changes or when additional metadata is added. It ensures systems remain informed about the current state of individual items within an order, providing real-time updates and synchronization.

Trigger Conditions

This webhook is triggered when an order item is created or updated, including changes to its status or metadata. Also, updates occur when AccuTrace provides new scan information for the mail piece and during other specific events related to order processing.

Purpose

Enables systems to track updates to individual order items, ensuring transparency and efficient communication. Also, this helps external systems stay synchronized with the latest order item information.

Use Case

  • External systems can react to updates by tracking order item status changes.
  • User-facing notifications can be updated to reflect the most recent status of their orders.
  • Third-party tools or systems can leverage this webhook to enhance order management workflows and provide real-time insights.

Example Payload

{
  "event": "order_items.updated",
  "data": [
    {
      "order": {
        "id": "7",
        "metaData": {
          "id": "7",
          "title": "Title by 3rd party"
        },
        "status": "Processing"
      },
      "contact": {
        "id": "8",
        "metaData": {
          "id": "8",
          "title": "Title by 3rd party"
        },
        "address1": "Address Line 1",
        "address2": "Address Line 2",
        "city": "City",
        "state": "State",
        "zip": "Zip Code"
      },
      "orderItem": {
        "id": "5",
        "trackingCode": [
          {
            "mods": "481",
            "state": "MD",
            "userid": "",
            "barcode": "21220130913",
            "zipcode": "02205",
            "equipment": "In Transit: DIOSS MULTIMODE - O/G PRIMARY - Phase 1a - Origin Primary Processing",
            "imbdigits": "00310109414000568682",
            "districtnm": "BALTIMORE",
            "scanned_date": "01/08/2025",
            "scanned_time": "00:39:44",
            "event_message": "In Transit"
          }
        ],
        "status": "In Transit",
        "createdAt": "2024-01-10T15:06:29.204Z",
        "updatedAt": "2024-01-10T15:06:29.204Z"
      },
      "status": "In Transit"
    },
    {
      "order": {
        "id": "8",
        "metaData": {
          "id": "8",
          "title": "Title by 3rd party"
        },
        "status": "Processing"
      },
      "contact": {
        "id": "9",
        "metaData": {
          "id": "9",
          "title": "Title by 3rd party"
        },
        "address1": "Address Line 1",
        "address2": "Address Line 2",
        "city": "City",
        "state": "State",
        "zip": "Zip Code"
      },
      "orderItem": {
        "id": "10",
        "trackingCode": {
          "mods": "481",
          "state": "MD",
          "userid": "",
          "barcode": "21220130913",
          "zipcode": "02205",
          "equipment": "In Transit: DIOSS MULTIMODE - O/G PRIMARY - Phase 1a - Origin Primary Processing",
          "imbdigits": "00310109414000568682",
          "districtnm": "BALTIMORE",
          "scanned_date": "01/08/2025",
          "scanned_time": "00:39:44",
          "event_message": "In Transit"
        },
        "status": "In Transit",
        "createdAt": "2024-01-10T15:06:29.204Z",
        "updatedAt": "2024-01-10T15:06:29.204Z"
      },
      "status": "In Transit"
    }
  ],
  "token": "YOUR_WEBHOOK_SECRET_KEY"
}

Parameters:

  • event (String): The type of event that triggered the webhook.
  • data (Array): Contains information about the updated order items.
  • order (Object): Contains information about the order associated with the updated item.
    • id (String): Unique identifier for the order.
    • metaData (Object): Additional metadata related to the order.
    • id (String): Unique identifier for the metadata.
    • title (String): Title or description associated with the order.
    • status (String): Current status of the order (e.g., "Processing").
  • contact (Object): Information about the contact associated with the order.
    • id (String): Unique identifier for the contact.
    • metaData (Object): Additional metadata related to the contact.
    • id (String): Unique identifier for the metadata.
    • title (String): Title or description associated with the contact.
    • address1 (String): First line of the contact’s address.
    • address2 (String): Second line of the contact’s address.
    • city (String): City of the contact.
    • state (String): State of the contact.
    • zip (String): ZIP code of the contact.
  • orderItem (Object): Information about the updated order item.
    • id (String): Unique identifier for the order item.
    • trackingCode (Object|Array): Single or List of tracking codes associated with this order item.
    • status (String): Current status of the order item (e.g., Not Mailed, Mailed, Delivered, Re-Routed, Returned to Sender, Processing, Canceled, Failed, In Transit).
    • createdAt (Timestamp): When the order item was created.
    • updatedAt (Timestamp): When the order item was last updated.
  • status (String): Additional status information related to this event, if applicable.
    • Note: This also reflects the status of the updated order item.
    • Possible Statuses: Not Mailed, Mailed, Delivered, Re-Routed, Returned to Sender, Processing, Canceled, Failed, In Transit
  • token (String): Your secret webhook token.

Conclusion

The order_items.updated webhook provides vital information about changes made to individual items within orders in Open Letter Connect, allowing external systems to respond effectively. By following best practices regarding security, error handling, and testing, you can ensure a smooth integration experience.