You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moved subscriptions.md up to the root and divided it into concept/eve… (iZettle#139)
* Moved subscriptions.md up to the root and divided it into concept/event-payloads.md and overview.md.
Fixed cross-reference links.
* Changed absolute paths to relevant paths in links.
Copy file name to clipboardExpand all lines: pusher-api/api-reference.md
+7-7
Original file line number
Diff line number
Diff line change
@@ -45,15 +45,15 @@ To create or update a subscription to an event, you will need to be authorized w
45
45
46
46
E.g. you will require the `READ:PURCHASE` scope if you want to subscribe to the `PurchaseCreated` event. See [the list of scopes for supported events](#supported-events).
47
47
48
-
For more information on how to get authorization for a particular scope, see [OAuth2 API](https://github.com/iZettle/api-documentation/blob/master/authorization.md).
48
+
For more information on how to get authorization for a particular scope, see [OAuth2 API](../authorization.md).
49
49
50
50
## Create a subscription
51
51
52
52
Creates a webhook subscription to a specific event.
53
53
54
54
Once the subscription for an event gets created, the Pusher API will publish data on your service whenever that event occurs.
55
55
56
-
E.g. You created a subscription for the ProductUpdated event. Whenever a product gets updated in the product library, the ProductUpdated event occurs. Then you will receive event data on the destination server that you have exposed publicly. The event data is a payload for the updated product. See the list of [payloads for all events](user-guides/subscriptions.md#payloadAPITable).
56
+
E.g. You created a subscription for the ProductUpdated event. Whenever a product gets updated in the product library, the ProductUpdated event occurs. Then you will receive event data on the destination server that you have exposed publicly. The event data is a payload for the updated product. See the list of [payloads for all events](concept/event-payloads.md#available-event-payloads).
57
57
58
58
> **Note:** The Pusher API will push data for an event only once. However, there may be cases where it gets published more than once. You don't need to save the data more than once.
59
59
@@ -71,7 +71,7 @@ See example [Create a webhook subscription](#create-a-webhook-subscription).
71
71
72
72
|Name |Type |In |Required/Optional |Description
73
73
|---- |---- |---- |---- |----
74
-
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li>Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](https://github.com/iZettle/api-documentation/blob/master/authorization.md).</li></ul>
74
+
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li>Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](../authorization.md).</li></ul>
75
75
|uuid |string |query |required | Unique identifier for the subscription as UUID version 1.
76
76
|transportName |string |query |required | The message option used by Pusher API. Currently only `WEBHOOK` is supported.
77
77
|eventNames |array |query |required | Event names for events that you want to create subscription for. The events are specified in an array. <br/>If you pass an empty array, you will subscribe to all events that the Pusher API supports. In this case, make sure that you have all the corresponding authorization scopes issued. See [the list of scopes](#supported-events).
@@ -127,7 +127,7 @@ See example [Get webhook subscriptions](#get-webhook-subscriptions).
127
127
128
128
|Name |Type |In |Required/Optional |Description
129
129
|---- |---- |---- |---- |----
130
-
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li> Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](https://github.com/iZettle/api-documentation/blob/master/authorization.md).</li></ul>
130
+
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li> Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](../authorization.md).</li></ul>
131
131
</details>
132
132
133
133
@@ -178,7 +178,7 @@ See example [Update a webhook subscription](#update-a-webhook-subscription).
178
178
179
179
|Name |Type |In |Required/Optional |Description
180
180
|---- |---- |---- |---- |----
181
-
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li> Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](https://github.com/iZettle/api-documentation/blob/master/authorization.md).</li></ul>
181
+
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li> Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](../authorization.md).</li></ul>
182
182
|subscriptionUuid |string |path |required |Unique identifier for an existing subscription as UUID version 1.
183
183
|transportName |string |query |optional | The message option used by the Pusher API. E.g. `WEBHOOK`. You need to specify the same option that you used while creating the subscription.
184
184
|eventNames |array |query |optional | Events that you want to update on the existing subscription. The events are specified in an array.
@@ -225,7 +225,7 @@ See example [Delete a webhook subscription](#delete-a-webhook-subscription).
225
225
226
226
|Name |Type |In |Required/Optional |Description
227
227
|---- |---- |---- |---- |----
228
-
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li> Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](https://github.com/iZettle/api-documentation/blob/master/authorization.md).</li></ul>
228
+
|organizationUuid |string |path |required |Unique identifier for your organization. You can use following options to fill in this value: <br/><ul><li>Use `self` as the value. This will retrieve your organizationUuid from the authentication token in the request.</li><li> Get it by using the `users/me` endpoint of OAuth2 API. For more information, see [OAuth2 API](../authorization.md).</li></ul>
229
229
|subscriptionUuid |string |path |required |Unique identifier for an existing subscription as UUID version 1.
230
230
</details>
231
231
@@ -394,7 +394,7 @@ Response
394
394
395
395
396
396
## Related resources
397
-
[Pusher API user guide](user-guides/subscriptions.md)
Copy file name to clipboardExpand all lines: pusher-api/concept/event-payloads.md
+8-40
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,10 @@
1
-
Subscriptions
1
+
Event payloads
2
2
=====================
3
-
With subscriptions, the Pusher API will immediately update you of those events that are triggered on your Zettle Go. So you don't need to pull information from other Zettle Go APIs.
3
+
When an event of your subscription is triggerd, the Pusher API sends `POST` requests with the `payload` field.
4
4
5
-
*[Understand how events work](#understand-how-events-work)
6
-
*[Payloads](#payloads)
7
-
*[Plan subscriptions](#plan-subscriptions)
8
-
*[Manage subscriptions](#manage-subscriptions)
9
-
10
-
## Understand how events work
11
-
The Pusher API provides events for you to listen to certain activities of the Zettle Go app at a working HTTPS endpoint on your server.
12
-
13
-
After you subscribe to events, when an event is triggered, the Pusher API sends a `POST` request that contains a `payload` field. The field contains event information to the HTTPS endpoint in real time.
14
-
15
-
### Payloads
16
-
The `payload` field is the response body from other APIs, such as the Inventory API. The Pusher API sends `POST` requests with the `payload` field in the following JSON format:
5
+
The `payload` field is the response body from other APIs, such as the Inventory API. The field contains event information to the HTTPS endpoint in real time.
6
+
7
+
The `payload` field is in the following JSON format:
17
8
18
9
```json
19
10
{
@@ -39,8 +30,10 @@ For example, you have a subscription to the `InventoryTrackingStarted` event. Wh
39
30
"timestamp": "2021-04-19T13:17:56.585Z"
40
31
}
41
32
```
33
+
## Available event payloads
34
+
The following table lists available event payloads.
42
35
43
-
For more information on event payloads, see the following table.
36
+
> **Note:** As payloads can be updated due to changes of the APIs that provide payloads, you can ignore unknown fields.
44
37
45
38
<tablename="payloadAPITable">
46
39
<thead>
@@ -231,28 +224,3 @@ For more information on event payloads, see the following table.
231
224
</td>
232
225
</tbody>
233
226
</table>
234
-
235
-
<!-- Ask the team: are the payloads for ApplicationConnectionRemoved, PersonalAssertionDeleted, OrganizationUpdated, and OrganizationFeatureUpdated from the Pusher API? -->
236
-
> **Note:** As payloads can be updated due to changes of the APIs that provide payloads, you can ignore unknown fields.
237
-
238
-
239
-
## Plan subscriptions
240
-
Before subscribing to events, plan which events to use for your use cases.
241
-
242
-
To get started, you may want to subscribe to the following events:
243
-
244
-
* To monitor inventory changes in Zettle Point of Sales (POS): `InventoryBalanceChanged`, `InventoryTrackingStarted`, and `InventoryTrackingStopped`
245
-
* To monitor product library changes: `ProductCreated`, `ProductUpdated`, and `ProductDeleted`
246
-
* To monitor purchases: `PurchaseCreated`
247
-
<!-- We can extend this section to be more focused on use cases later on. -->
248
-
249
-
For more events that you can subscribe, see [Pusher API reference](../api-reference.md).
250
-
251
-
## Manage subscriptions
252
-
With the Pusher API, you can create, view, update, and delete subscriptions as you need.
With subscriptions, the Pusher API will immediately update you of those events that are triggered on your Zettle Go. So you don't need to pull information from other Zettle Go APIs.
4
+
5
+
*[Understand how subscriptions work](#understand-how-subscriptions-work)
6
+
*[Plan subscriptions](#plan-subscriptions)
7
+
*[Manage subscriptions](#manage-subscriptions)
8
+
9
+
## Understand how subscriptions work
10
+
The Pusher API provides events for you to listen to certain activities of the Zettle Go app at a working HTTPS endpoint on your server.
11
+
12
+
After you subscribe to events, when an event is triggered, the Pusher API sends a `POST` request that contains a `payload` field. The field contains event information to the HTTPS endpoint in real time.
13
+
14
+
For more information about event payloads, see [event payloads](concept/event-payloads.md).
15
+
16
+
## Plan subscriptions
17
+
Before subscribing to events, plan which events to use for your use cases.
18
+
19
+
To get started, you may want to subscribe to the following events:
20
+
21
+
* To monitor inventory changes in Zettle Point of Sales (POS): `InventoryBalanceChanged`, `InventoryTrackingStarted`, and `InventoryTrackingStopped`
22
+
* To monitor product library changes: `ProductCreated`, `ProductUpdated`, and `ProductDeleted`
23
+
* To monitor purchases: `PurchaseCreated`
24
+
<!-- We can extend this section to be more focused on use cases later on. -->
25
+
26
+
For more events that you can subscribe, see [Pusher API reference](api-reference.md).
27
+
28
+
## Manage subscriptions
29
+
With the Pusher API, you can create, view, update, and delete subscriptions as you need.
Copy file name to clipboardExpand all lines: pusher-api/user-guides/create-subscriptions.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ Subscribe to events to stay updated of activities that happen on your Zettle Go
12
12
13
13
## Prerequisites
14
14
* Make sure that authorization is set up using [Authorization OAuth2 API](../../authorization.md).
15
-
* Make sure that you have set up an HTTPS endpoint as the destination URL on your server for receiving event notifications. The endpoint must be publicly accessible and correctly process event payloads. For events payloads, see [Payloads](subscriptions.md/#payloads).
15
+
* Make sure that you have set up an HTTPS endpoint as the destination URL on your server for receiving event notifications. The endpoint must be publicly accessible and correctly process event payloads. See [event payloads](concept/event-payloads.md).
16
16
* Make sure that you understand the events that are supported by the Pusher API. For events that are supported by the Pusher API, see [Pusher API reference](../api-reference.md#supported-events).
0 commit comments