Webhook Payload Deltas

Additional information on how an order has changed

Webhook payload deltas help you understand exactly what changed in an order.updated event, so you can efficiently handle partial updates without having to diff entire objects.
When an order changes, Cerebrum webhooks can include a delta describing exactly what fields were modified.

When Is a delta Included?

The metadata.delta field is included on certain order.updated webhook events where a meaningful field change has occurred.

If no relevant change has occurred, or if the event type does not support deltas, the delta field will be omitted.

Delta Format

The delta field follows JSON Patch–style semantics (RFC 6902 / RFC 6901).

It is an array of operations describing individual changes.


{
  "metadata": {
    "delta": [
      {
        "op": "replace",
        "path": "/status",
        "before": "PENDING",
        "after": "COMPLETE"
      }
    ]
  }
}

Delta fields

Each delta entry contains the following fields:

FieldTypeDescription
opstringThe operation performed (add, remove, replace)
pathstringJSON Pointer path to the field that changed
beforeanyThe previous value
afteranyThe new value

For larger objects, such as reportableResults a redacted delta showing key field changes will be used, instead of showing the full object. For reportableResults specifically, the searchType and alertsFound fields are used.

Examples

Single Field Change

[
  {
    "op": "replace",
    "path": "/status",
    "before": "PENDING",
    "after": "COMPLETE"
  }
]

Multiple Field Changes

[
  {
    "op": "replace",
    "path": "/status",
    "before": "PENDING",
    "after": "COMPLETE"
  },
  {
    "op": "replace",
    "path": "/score",
    "before": null,
    "after": "NO_ALERTS"
  }
]

Reportable Results Changes

[
  {
        "op": "replace",
        "path": "/reportableResults"
        "before": null,
        "after": [
            {
                "alertsFound": false,
                "searchType": "natcrim"
            },
            {
                "alertsFound": false,
                "searchType": "sanctions"
            },
            {
                "alertsFound": false,
                "searchType": "sexoffender"
            }
        ]
    }
]

Additional notes

  • Applies to order.updated webhook events: ORDER_STATUS_CHANGE, ORDER_SCORE_CHANGE, ORDER_CUSTOM_SCORE_CHANGE, ORDER_DISPUTE_RESOLVED.
  • Non-order webhook payloads are unchanged.
  • Deltas are computed from a webhook-safe mapped order shape:
    • Relation data is excluded (for example packageSets, webhook, organization)
    • reportableResults[] is reduced to { searchType, alertsFound }
    • Timestamp-only fields are excluded (createdAt, updatedAt, reportedAt, reportCompletedAt)
  • If no mapped fields changed, metadata.delta is an empty array.
  • If no pre-update snapshot is available in a given flow, payload.metadata is omitted.