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
Copy file name to clipboardExpand all lines: README.md
+79Lines changed: 79 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ The xero-python SDK makes it easy for developers to access Xero's APIs in their
13
13
-[Configuration](#configuration)
14
14
-[Authentication](#authentication)
15
15
-[Custom Connections](#custom-connections)
16
+
-[App Store Subscriptions](#app-store-subscriptions)
16
17
-[API Clients](#api-clients)
17
18
-[Helper Methods](#helper-methods)
18
19
-[Usage Examples](#usage-examples)
@@ -332,6 +333,84 @@ Because Custom Connections are only valid for a single organisation you don't ne
332
333
333
334
> Because the SDK is generated from the OpenAPI spec the parameter remains. For now you are required to pass an empty string to use this SDK with a Custom Connection.
334
335
336
+
---
337
+
338
+
## App Store Subscriptions
339
+
340
+
If you are implementing subscriptions to participate in Xero's App Store you will need to setup [App Store subscriptions](https://developer.xero.com/documentation/guides/how-to-guides/xero-app-store-referrals/) endpoints.
341
+
342
+
When a plan is successfully purchased, the user is redirected back to the URL specified in the setup process. The Xero App Store appends the subscription Id to this URL so you can immediately determine what plan the user has subscribed to through the subscriptions API.
343
+
344
+
With your app credentials you can create a client via `client_credentials` grant_type with the `marketplace.billing` scope. This unique access_token will allow you to query any functions in `AppStoreApi`. Client Credentials tokens to query app store endpoints will only work for apps that have completed the App Store on-boarding process.
You should use the subscription data to provision user access/permissions to your application.
407
+
### App Store Subscription Webhooks
408
+
409
+
In additon to a subscription Id being passed through the URL, when a purchase or an upgrade takes place you will be notified via a webhook. You can then use the subscription Id in the webhook payload to query the AppStore endpoints and determine what plan the user purchased, upgraded, downgraded or cancelled.
410
+
411
+
Refer to Xero's documenation to learn more about setting up and receiving webhooks.
0 commit comments