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:
| Field | Type | Description |
|---|---|---|
| op | string | The operation performed (add, remove, replace) |
| path | string | JSON Pointer path to the field that changed |
| before | any | The previous value |
| after | any | The 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.updatedwebhook 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)
- Relation data is excluded (for example
- If no mapped fields changed,
metadata.deltais an empty array. - If no pre-update snapshot is available in a given flow,
payload.metadatais omitted.
Updated 1 day ago