Skip to main content

Menu Object Updates

Stream-integrated DSPs have the option to support object-level updates. Normally, when an item is indicated out of stock by a merchant, we will push an entirely new menu payload with the updated state. This can be costly for large menus and can lead to unnecessary processing on the DSP side.

Our update webhook will send object stock updates for items, variations, and modifiers via the New Webhook Event webhook.

In the below payload example, an item is being set to out of stock (is_active: false), while a modifier is being set back in stock (is_active: true).

{
"location_id": "example_location",
"type": "location.update",
"object_updates": {
"items": [
{
"stream_id": "family1",
"is_active": false
}
],
"variations": [],
"modifiers": [
{
"stream_id": "modifier1",
"is_active": true
}
]
}
}

NOTE: There is no menu specified within the payload. All matching objects should be updated across all menus for the location.

NOTE: In some instances, such as when an object goes back into stock, the stream_id of the object we send may not exist within any of your menus. In this case, your API should respond with a 404 error code, and we will fallback to a normal menu publish.

Portion and Multiplier Modifiers (V2 Schema)​

On the V2 menu schema, a portion or multiplier modifier is published under one ID per parent path (for example mod_half_1__mod_pepperoni and mod_half_1__mod_chicken). An object update carries a single stream_id, so it cannot address all of them. When the change is published, Stream sends a full menu publish for these stock changes:

Stock changeWhat you receive
A portion or multiplier modifier ("1st Half", "Extra")No object update for that modifier. A full menu publish with the new is_active.
A fixed-price modifier that has portion or multiplier options under it ("Pepperoni")The object update for mod_pepperoni as usual, followed by a full menu publish.
Any other item, variation or modifierThe object update only, as before.

If nothing else changed in the same batch, no object update is sent and only the full publish arrives. Other objects changed in the same batch still arrive in the object update:

{
"location_id": "example_location",
"type": "location.update",
"object_updates": {
"items": [{ "stream_id": "family1", "is_active": false }],
"variations": [],
"modifiers": [{ "stream_id": "mod_pepperoni", "is_active": false }]
}
}

The full publish that follows carries the current state of every published ID. Apply it as a replacement of the stored menu, so the two stay in step.