Skip to content

Commit 686bc34

Browse files
authored
Merge pull request #191778 from dannyevers/57262-webhook
57262-webhook
2 parents f162868 + 91f2784 commit 686bc34

File tree

1 file changed

+194
-24
lines changed

1 file changed

+194
-24
lines changed

articles/marketplace/partner-center-portal/pc-saas-fulfillment-webhook.md

Lines changed: 194 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn how to implement a webhook on the SaaS service by using the f
44
ms.service: marketplace
55
ms.subservice: partnercenter-marketplace-publisher
66
ms.topic: reference
7-
ms.date: 10/27/2021
7+
ms.date: 03/15/2022
88
author: arifgani
99
ms.author: argani
1010
---
@@ -23,29 +23,41 @@ When creating a transactable SaaS offer in Partner Center, the partner provides
2323
* Reinstate
2424
* Unsubscribe
2525

26-
The publisher must implement a webhook in the SaaS service to keep the SaaS subscription status consistent with the Microsoft side. The SaaS service is required to call the Get Operation API to validate and authorize the webhook call and payload data before taking action based on the webhook notification. The publisher should return HTTP 200 to Microsoft as soon as the webhook call is processed. This value acknowledges that the webhook call has been received successfully by the publisher.
26+
The publisher must implement a webhook in the SaaS service to keep the SaaS subscription status consistent with the Microsoft side. The SaaS service is required to call the Get Operation API to validate and authorize the webhook call and payload data before taking action based on the webhook notification. The publisher should return HTTP 200 to Microsoft as soon as the webhook call is processed. This value acknowledges that the webhook call has been received successfully by the publisher.
2727

2828
> [!IMPORTANT]
29-
> The webhook URL service must be up and running 24x7, and ready to receive new calls from Microsoft time at all times. Microsoft does have a retry policy for the webhook call (500 retries over 8 hours), but if the publisher doesn't accept the call and return a response, the operation that webhook notifies about will eventually fail on the Microsoft side.
29+
> The webhook URL service must be up and running 24x7, and ready to receive new calls from Microsoft time at all times. Microsoft does have a retry policy for the webhook call (500 retries over 8 hours), but if the publisher doesn't accept the call and return a response, the operation that webhook notifies about will eventually fail on the Microsoft side.
3030
31-
*Webhook payload example of a purchase event:*
31+
*Webhook payload example of ChangePlan:*
3232

3333
```json
34-
// end user changed a quantity of purchased seats for a plan on Microsoft side
3534
{
36-
"id": "<guid>", // this is the operation ID to call with get operation API
37-
"activityId": "<guid>", // do not use
38-
"subscriptionId": "guid", // The GUID identifier for the SaaS resource which status changes
39-
"publisherId": "contoso", // A unique string identifier for each publisher
40-
"offerId": "offer1", // A unique string identifier for each offer
41-
"planId": "silver", // the most up-to-date plan ID
42-
"quantity": "25", // the most up-to-date number of seats, can be empty if not relevant
43-
"timeStamp": "2019-04-15T20:17:31.7350641Z", // UTC time when the webhook was called
44-
"action": "ChangeQuantity", // the operation the webhook notifies about
45-
"status": "Success" // Can be either InProgress or Success
35+
"id": "<guid>",
36+
"activityId": "<guid>",
37+
"operationRequestSource": "Azure",
38+
"subscriptionId": "<guid>",
39+
"timeStamp": "2021-06-23T05:05:29.9799053Z",
40+
"action": "ChangePlan"
4641
}
4742
```
4843

44+
*Webhook payload example of ChangeQuantity event:*
45+
46+
```json
47+
{
48+
"id": "<guid>",
49+
"activityId": "<guid>",
50+
"publisherId": "XXX",
51+
"offerId": "offerid",
52+
"planId": "planid",
53+
"quantity": 100,
54+
"subscriptionId": "<guid>",
55+
"timeStamp": "2022-02-14T20:26:05.1419317Z",
56+
"action": "ChangeQuantity",
57+
"status": "InProgress",
58+
"operationRequestSource": "Partner",
59+
```
60+
4961
*Webhook payload example of a subscription reinstatement event:*
5062

5163
```json
@@ -64,21 +76,179 @@ The publisher must implement a webhook in the SaaS service to keep the SaaS subs
6476
}
6577
```
6678

67-
*Webhook payload example of a renewal event:*
79+
*Webhook payload example of a Renew event:*
80+
81+
```json
82+
// end user's subscription renewal
83+
{
84+
"id": "<guid>",
85+
"activityId": "<guid>",
86+
"publisherId": "contoso",
87+
"offerId": "offer1",
88+
"planId": "plan1",
89+
"quantity": 1,
90+
"subscriptionId": "<guid>",
91+
"timeStamp": "2021-12-04T19:48:06.7054737Z",
92+
"action": "Renew",
93+
"status": "Succeeded",
94+
"operationRequestSource": "Azure",
95+
"subscription": {
96+
"id": "<guid>",
97+
"name": "name",
98+
"publisherId": "contoso",
99+
"offerId": "offerId",
100+
"planId": "planId",
101+
"quantity": null,
102+
"beneficiary": {
103+
"emailId": "[email protected]",
104+
"objectId": "<guid>",
105+
"tenantId": "<guid>",
106+
"puid": null
107+
},
108+
"purchaser": {
109+
"emailId": "[email protected]",
110+
"objectId": "<guid>",
111+
"tenantId": "<guid>",
112+
"puid": null
113+
},
114+
"allowedCustomerOperations": [
115+
"Delete",
116+
"Update",
117+
"Read"
118+
],
119+
"sessionMode": "None",
120+
"isFreeTrial": false,
121+
"isTest": false,
122+
"sandboxType": "None",
123+
"saasSubscriptionStatus": "Subscribed",
124+
"term": {
125+
"startDate": "2021-12-04T00:00:00Z",
126+
"endDate": "2022-01-03T00:00:00Z",
127+
"termUnit": "P1M",
128+
"chargeDuration": null
129+
},
130+
"autoRenew": true,
131+
"created": "2021-09-10T07:03:17.5098444Z",
132+
"lastModified": "2021-12-04T19:48:06.0754649Z"
133+
},
134+
"purchaseToken": null
135+
}
136+
```
137+
138+
*Webhook payload example of a Suspend event:*
68139

69140
```json
70-
// end user's payment instrument became valid again, after being suspended, and the SaaS subscription is being reinstated
71141
{
72142
"id": "<guid>",
73143
"activityId": "<guid>",
144+
"publisherId": "testpublisher",
145+
"offerId": "testoffer",
146+
"planId": "starter",
147+
"quantity": 1,
74148
"subscriptionId": "<guid>",
75-
"publisherId": "contoso",
76-
"offerId": "offer1 ",
77-
"planId": "silver",
78-
"quantity": "25",
79-
"timeStamp": "2019-04-15T20:17:31.7350641Z",
80-
"action": "Renew",
81-
"status": "Success"
149+
"timeStamp": "2022-03-10T16:34:41.137017Z",
150+
"action": "Suspend",
151+
"status": "Succeeded",
152+
"operationRequestSource": "Azure",
153+
"subscription": {
154+
"id": "<guid>",
155+
"name": "testcms",
156+
"publisherId": "testpublisher",
157+
"offerId": "cmstestoffer",
158+
"planId": "starter",
159+
"quantity": null,
160+
"beneficiary": {
161+
"emailId": "XXX",
162+
"objectId": "<guid>",
163+
"tenantId": "<guid>",
164+
"puid": "XXX"
165+
},
166+
"purchaser": {
167+
"emailId": "XXX",
168+
"objectId": "<guid>",
169+
"tenantId": "<guid>",
170+
"puid": "XXX"
171+
},
172+
"allowedCustomerOperations": [ "Delete", "Update", "Read" ],
173+
"sessionMode": "None",
174+
"isFreeTrial": false,
175+
"isTest": false,
176+
"sandboxType": "None",
177+
"saasSubscriptionStatus": "Subscribed",
178+
"term": {
179+
"startDate": "2022-03-09T00:00:00Z",
180+
"endDate": "2022-04-08T00:00:00Z",
181+
"termUnit": "P1M",
182+
"chargeDuration": null
183+
},
184+
"autoRenew": true,
185+
"created": "2022-03-09T18:45:49.0735944Z",
186+
"lastModified": "2022-03-09T22:49:25.4181451Z"
187+
},
188+
"purchaseToken": null
189+
}
190+
```
191+
192+
*Webhook payload example of unsubscribe event:*
193+
194+
```json
195+
{
196+
"id": "<guid>",
197+
"activityId": "<guid>",
198+
"publisherId": "testpublisher",
199+
"offerId": "saasteam4-preview",
200+
"planId": "standard",
201+
"quantity": 1,
202+
"subscriptionId": "<guid>",
203+
"timeStamp": "2022-03-12T01:53:14.5038009Z",
204+
"action": "Unsubscribe",
205+
"status": "Succeeded",
206+
"operationRequestSource": "Azure",
207+
"subscription": {
208+
"id": "<guid>",
209+
"name": "Sub-test-ng",
210+
"publisherId": "testpublisher",
211+
"offerId": "saasteam4-preview",
212+
"planId": "standard",
213+
"quantity": null,
214+
"beneficiary": {
215+
"emailId": "*******************************",
216+
"objectId": "<guid>",
217+
"tenantId": "<guid>",
218+
"puid": "****************"
219+
},
220+
"purchaser": {
221+
"emailId": "*******************************",
222+
"objectId": "<guid>",
223+
"tenantId": "<guid>",
224+
"puid": "****************"
225+
},
226+
"allowedCustomerOperations": [ "Delete", "Update", "Read" ],
227+
"sessionMode": "None",
228+
"isFreeTrial": false,
229+
"isTest": false,
230+
"sandboxType": "None",
231+
"saasSubscriptionStatus": "Unsubscribed",
232+
"term": {
233+
"startDate": "2022-03-07T00:00:00Z",
234+
"endDate": "2022-04-06T00:00:00Z",
235+
"termUnit": "P1M",
236+
"chargeDuration": null
237+
},
238+
"autoRenew": true,
239+
"created": "2021-12-07T12:47:12.7474496Z",
240+
"lastModified": "2022-03-11T22:32:06.720473Z"
241+
},
242+
"purchaseToken": null
243+
}
244+
```
245+
246+
*Webhook payload example of reinstate event:*
247+
248+
```json
249+
{
250+
"subscriptionId": "<guid>",
251+
"operationType": "Reinstate"
82252
}
83253
```
84254

0 commit comments

Comments
 (0)