Skip to content

Commit 48de99c

Browse files
authored
Extended event notification section (#158)
* Extended event notification section * Updates based on review feedback
1 parent 70b5761 commit 48de99c

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

inventory-api/concepts/how-inventories-work.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,22 @@ The request body contains the parameters for the inventory flow. In the case of
8282
```
8383
See [Update inventory balance](../user-guides/manage-inventory-balances/update-inventory-balance.md).
8484

85-
### Event notifications
85+
### Inventory events
86+
87+
Using the Zettle Pusher API, your application can get notified about changes to the inventory. You can create a webhook subscribing to inventory-related events. When the event occurs, a notification is sent to the specified notification URL. The notification is a `POST` request with event details in JSON format.
88+
89+
The following events are available for the inventory:
90+
91+
* `InventoryBalanceChanged`. The product inventory was updated from Zettle POS or the app.
92+
* `InventoryTrackingStarted`. Tracking of items in the product library was initiated from Zettle POS or the app.
93+
* `InventoryTrackingStopped`. Tracking of items in the product library was disabled from Zettle POS or the app.
94+
8695
Inventory balance updates can be the result of either a purchase event, or an explicit update request. Such a request will trigger webhook event notifications for balance updates similar to purchase events.
8796

97+
As an example, your app subscribes to the `InventoryBalanceChanged` event. When a purchase happens, your app will receive data from the `InventoryBalanceChanged` event on the destination server. The event data is the payload for the updated inventory.
98+
99+
See [Pusher API](https://github.com/iZettle/api-documentation/blob/master/pusher-api/overview.md) for more details.
100+
88101
The UUID can be used to make it easier for a client to match an API request with the received webhook notification. To do this, the client can pass the desired UUID in the `externalUuid` parameter when sending a balance update request. This parameter will then be passed through. If the update causes notifications to be sent out, the UUID will be included in the webhook event payload.
89102

90103
## Setting inventory balances

0 commit comments

Comments
 (0)