Skip to content

Commit a004917

Browse files
committed
57262-webhook
1 parent 2887418 commit a004917

File tree

1 file changed

+200
-12
lines changed

1 file changed

+200
-12
lines changed

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

Lines changed: 200 additions & 12 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,10 +23,40 @@ 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.
30+
31+
*Webhook payload example of ChangePlan:*
32+
33+
```json
34+
{
35+
"id": "<guid>",
36+
"activityId": "<guid>",
37+
"operationRequestSource": "Azure",
38+
"subscriptionId": "<guid>",
39+
"timeStamp": "2021-06-23T05:05:29.9799053Z",
40+
"action": "ChangePlan"
41+
}
42+
```
43+
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+
```
3060

3161
*Webhook payload example of a purchase event:*
3262

@@ -64,21 +94,179 @@ The publisher must implement a webhook in the SaaS service to keep the SaaS subs
6494
}
6595
```
6696

67-
*Webhook payload example of a renewal event:*
97+
*Webhook payload example of a Renew event:*
98+
99+
```json
100+
// end user's subscription renewal
101+
{
102+
"id": "<guid>",
103+
"activityId": "<guid>",
104+
"publisherId": "contoso",
105+
"offerId": "offer1",
106+
"planId": "plan1",
107+
"quantity": 1,
108+
"subscriptionId": "<guid>",
109+
"timeStamp": "2021-12-04T19:48:06.7054737Z",
110+
"action": "Renew",
111+
"status": "Succeeded",
112+
"operationRequestSource": "Azure",
113+
"subscription": {
114+
"id": "<guid>",
115+
"name": "name",
116+
"publisherId": "contoso",
117+
"offerId": "offerId",
118+
"planId": "planId",
119+
"quantity": null,
120+
"beneficiary": {
121+
"emailId": "[email protected]",
122+
"objectId": "<guid>",
123+
"tenantId": "<guid>",
124+
"puid": null
125+
},
126+
"purchaser": {
127+
"emailId": "[email protected]",
128+
"objectId": "<guid>",
129+
"tenantId": "<guid>",
130+
"puid": null
131+
},
132+
"allowedCustomerOperations": [
133+
"Delete",
134+
"Update",
135+
"Read"
136+
],
137+
"sessionMode": "None",
138+
"isFreeTrial": false,
139+
"isTest": false,
140+
"sandboxType": "None",
141+
"saasSubscriptionStatus": "Subscribed",
142+
"term": {
143+
"startDate": "2021-12-04T00:00:00Z",
144+
"endDate": "2022-01-03T00:00:00Z",
145+
"termUnit": "P1M",
146+
"chargeDuration": null
147+
},
148+
"autoRenew": true,
149+
"created": "2021-09-10T07:03:17.5098444Z",
150+
"lastModified": "2021-12-04T19:48:06.0754649Z"
151+
},
152+
"purchaseToken": null
153+
}
154+
```
155+
156+
*Webhook payload example of a Suspend event:*
68157

69158
```json
70-
// end user's payment instrument became valid again, after being suspended, and the SaaS subscription is being reinstated
71159
{
72160
"id": "<guid>",
73161
"activityId": "<guid>",
162+
"publisherId": "testpublisher",
163+
"offerId": "testoffer",
164+
"planId": "starter",
165+
"quantity": 1,
74166
"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"
167+
"timeStamp": "2022-03-10T16:34:41.137017Z",
168+
"action": "Suspend",
169+
"status": "Succeeded",
170+
"operationRequestSource": "Azure",
171+
"subscription": {
172+
"id": "<guid>",
173+
"name": "testcms",
174+
"publisherId": "testpublisher",
175+
"offerId": "cmstestoffer",
176+
"planId": "starter",
177+
"quantity": null,
178+
"beneficiary": {
179+
"emailId": "XXX",
180+
"objectId": "<guid>",
181+
"tenantId": "<guid>",
182+
"puid": "XXX"
183+
},
184+
"purchaser": {
185+
"emailId": "XXX",
186+
"objectId": "<guid>",
187+
"tenantId": "<guid>",
188+
"puid": "XXX"
189+
},
190+
"allowedCustomerOperations": [ "Delete", "Update", "Read" ],
191+
"sessionMode": "None",
192+
"isFreeTrial": false,
193+
"isTest": false,
194+
"sandboxType": "None",
195+
"saasSubscriptionStatus": "Subscribed",
196+
"term": {
197+
"startDate": "2022-03-09T00:00:00Z",
198+
"endDate": "2022-04-08T00:00:00Z",
199+
"termUnit": "P1M",
200+
"chargeDuration": null
201+
},
202+
"autoRenew": true,
203+
"created": "2022-03-09T18:45:49.0735944Z",
204+
"lastModified": "2022-03-09T22:49:25.4181451Z"
205+
},
206+
"purchaseToken": null
207+
}
208+
```
209+
210+
*Webhook payload example of unsubscribe event:*
211+
212+
```json
213+
{
214+
"id": "<guid>",
215+
"activityId": "<guid>",
216+
"publisherId": "testpublisher",
217+
"offerId": "saasteam4-preview",
218+
"planId": "standard",
219+
"quantity": 1,
220+
"subscriptionId": "<guid>",
221+
"timeStamp": "2022-03-12T01:53:14.5038009Z",
222+
"action": "Unsubscribe",
223+
"status": "Succeeded",
224+
"operationRequestSource": "Azure",
225+
"subscription": {
226+
"id": "<guid>",
227+
"name": "Sub-test-ng",
228+
"publisherId": "testpublisher",
229+
"offerId": "saasteam4-preview",
230+
"planId": "standard",
231+
"quantity": null,
232+
"beneficiary": {
233+
"emailId": "*******************************",
234+
"objectId": "<guid>",
235+
"tenantId": "<guid>",
236+
"puid": "****************"
237+
},
238+
"purchaser": {
239+
"emailId": "*******************************",
240+
"objectId": "<guid>",
241+
"tenantId": "<guid>",
242+
"puid": "****************"
243+
},
244+
"allowedCustomerOperations": [ "Delete", "Update", "Read" ],
245+
"sessionMode": "None",
246+
"isFreeTrial": false,
247+
"isTest": false,
248+
"sandboxType": "None",
249+
"saasSubscriptionStatus": "Unsubscribed",
250+
"term": {
251+
"startDate": "2022-03-07T00:00:00Z",
252+
"endDate": "2022-04-06T00:00:00Z",
253+
"termUnit": "P1M",
254+
"chargeDuration": null
255+
},
256+
"autoRenew": true,
257+
"created": "2021-12-07T12:47:12.7474496Z",
258+
"lastModified": "2022-03-11T22:32:06.720473Z"
259+
},
260+
"purchaseToken": null
261+
}
262+
```
263+
264+
*Webhook payload example of reinstate event:*
265+
266+
```json
267+
{
268+
"subscriptionId": "<guid>",
269+
"operationType": "Reinstate"
82270
}
83271
```
84272

0 commit comments

Comments
 (0)