Get subscription add-on acquisitions
Use this method in the Microsoft Store analytics API to get aggregate acquisition data for add-on subscriptions for your app during a given date range and other optional filters.
Prerequisites
To use this method, you need to first do the following:
- If you have not done so already, complete all the prerequisites for the Microsoft Store analytics API.
- Obtain an Azure AD access token to use in the request header for this method. After you obtain an access token, you have 60 minutes to use it before it expires. After the token expires, you can obtain a new one.
Request
Request syntax
Method | Request URI |
---|---|
GET | https://manage.devcenter.microsoft.com/v1.0/my/analytics/subscriptions |
Request header
Header | Type | Description |
---|---|---|
Authorization | string | Required. The Azure AD access token in the form Bearer <token>. |
Request parameters
Parameter | Type | Description | Required |
---|---|---|---|
applicationId | string | The Store ID of the app for which you want to retrieve subscription add-on acquisition data. | Yes |
subscriptionProductId | string | The Store ID of the subscription add-on for which you want to retrieve acquisition data. If you do not specify this value, this method returns acquisition data for all subscription add-ons for the specified app. | No |
startDate | date | The start date in the date range of subscription add-on acquisition data to retrieve. The default is the current date. | No |
endDate | date | The end date in the date range of subscription add-on acquisition data to retrieve. The default is the current date. | No |
top | int | The number of rows of data to return in the request. The maximum value and the default value if not specified is 100. If there are more rows in the query, the response body includes a next link that you can use to request the next page of data. | No |
skip | int | The number of rows to skip in the query. Use this parameter to page through large data sets. For example, top=100 and skip=0 retrieves the first 100 rows of data, top=100 and skip=100 retrieves the next 100 rows of data, and so on. | No |
filter | string | One or more statements that filter the response body. Each statement can use the eq or ne operators, and statements can be combined using and or or. You can specify the following strings in the filter statements (these correspond to values in the response body):
Here is an example filter parameter: filter=date eq '2017-07-08'. |
No |
aggregationLevel | string | Specifies the time range for which to retrieve aggregate data. Can be one of the following strings: day, week, or month. If unspecified, the default is day. | No |
orderby | string | A statement that orders the result data values for each subscription add-on acquisition. The syntax is orderby=field [order],field [order],.... The field parameter can be one of the following strings:
The order parameter is optional, and can be asc or desc to specify ascending or descending order for each field. The default is asc. Here is an example orderby string: orderby=date,market |
No |
groupby | string | A statement that applies data aggregation only to the specified fields. You can specify the following fields:
The groupby parameter can be used with the aggregationLevel parameter. For example: groupby=market&aggregationLevel=week |
No |
Request example
The following examples demonstrates how to get subscription add-on acquisition data. Replace the applicationId value with the appropriate Store ID for your app.
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/subscriptions?applicationId=9NBLGGGZ5QDR&startDate=2017-07-07&endDate=2017-07-08 HTTP/1.1
Authorization: Bearer <your access token>
Response
Response body
Value | Type | Description |
---|---|---|
Value | array | An array of objects that contain aggregate subscription add-on acquisition data. For more information about the data in each object, see the subscription acquisition values section below. |
@nextLink | string | If there are additional pages of data, this string contains a URI that you can use to request the next page of data. For example, this value is returned if the top parameter of the request is set to 100 but there are more than 100 rows of subscription add-on acquisition data for the query. |
TotalCount | int | The total number of rows in the data result for the query. |
Subscription acquisition values
Elements in the Value array contain the following values.
Value | Type | Description |
---|---|---|
date | string | The first date in the date range for the acquisition data. If the request specified a single day, this value is that date. If the request specified a week, month, or other date range, this value is the first date in that date range. |
subscriptionProductId | string | The Store ID of the subscription add-on for which you are retrieving acquisition data. |
subscriptionProductName | string | The display name of the subscription add-on. |
applicationId | string | The Store ID of the app for which you are retrieving subscription add-on acquisition data. |
applicationName | string | The display name of the app. |
skuId | string | The ID of the SKU of the subscription add-on for which you are retrieving acquisition data. |
deviceType | string | One of the following strings that specifies the type of device that completed the acquisition:
|
market | string | The ISO 3166 country code of the market where the acquisition occurred. |
currencyCode | string | The currency code in ISO 4217 format for gross sales before taxes. |
grossSalesBeforeTax | integer | The gross sales in the local currency specified by the currencyCode value. |
totalActiveCount | integer | The number of total active subscriptions during the specified time period. This is equivalent to the sum of the goodStandingActiveCount, pendingGraceActiveCount, graceActiveCount, and lockedActiveCount values. |
totalChurnCount | integer | The total count of subscriptions that were deactivated during the specified time period. This is equivalent to the sum of the billingChurnCount, nonRenewalChurnCount, refundChurnCount, chargebackChurnCount, earlyChurnCount, and otherChurnCount values. |
newCount | integer | The number of new subscription acquisitions during the specified time period, including trials. |
renewCount | integer | The number of subscription renewals during the specified time period, including user-initiated renewals and automatic renewals. |
goodStandingActiveCount | integer | The number of subscriptions that were active during the specified time period and where the expiration date is >= the endDate value for the query. |
pendingGraceActiveCount | integer | The number of subscriptions that were active during the specified time period but had a billing failure, and where the subscription expiration date is >= the endDate value for the query. |
graceActiveCount | integer | The number of subscriptions that were active during the specified time period but had a billing failure, and where:
|
lockedActiveCount | integer | The number of subscriptions that were in dunning (that is, the subscription is nearing expiration and Microsoft is trying to acquire funds to automatically renew the subscription) during the specified time period, and where:
|
billingChurnCount | integer | The number of subscriptions that were deactivated during the specified time period because of a failure to process a billing charge and where the subscriptions were previously in dunning. |
nonRenewalChurnCount | integer | The number of subscriptions that were deactivated during the specified time period because they were not renewed. |
refundChurnCount | integer | The number of subscriptions that were deactivated during the specified time period because they were refunded. |
chargebackChurnCount | integer | The number of subscriptions that were deactivated during the specified time period because of a chargeback. |
earlyChurnCount | integer | The number of subscriptions that were deactivated during the specified time period while they were in good standing. |
otherChurnCount | integer | The number of subscriptions that were deactivated during the specified time period for other reasons. |
Request and Response example
The following code snippets demonstrates some example request and JSON response body for those request.
Sample Request
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/subscriptions?applicationId=9NBLGGGZ5QDR
HTTP/1.1
Authorization: Bearer <your access token>
Sample Response
{
"Value": [
{
"date": "2022-04-18",
"applicationId": "9NBLGGGZ5QDR",
"applicationName": "Windows and Doors",
"grossSalesBeforeTax": 3460656.260391250,
"totalActiveCount": 20211321,
"totalChurnCount": 5605,
"newCount": 3810366,
"renewCount": 12102044,
"goodStandingActiveCount": 17893664,
"pendingGraceActiveCount": 2255792,
"graceActiveCount": 61833,
"lockedActiveCount": 32,
"billingChurnCount": 4,
"nonRenewalChurnCount": 0,
"refundChurnCount": 0,
"chargebackChurnCount": 0,
"earlyChurnCount": 2717,
"otherChurnCount": 2884
},
{
"date": "2022-04-18",
"applicationId": "9NBLGGGZ5QDR",
"applicationName": "Unknown",
"grossSalesBeforeTax": 2342.580615228,
"totalActiveCount": 50550,
"totalChurnCount": 7,
"newCount": 8312,
"renewCount": 31446,
"goodStandingActiveCount": 44047,
"pendingGraceActiveCount": 6503,
"graceActiveCount": 0,
"lockedActiveCount": 0,
"billingChurnCount": 0,
"nonRenewalChurnCount": 0,
"refundChurnCount": 0,
"chargebackChurnCount": 0,
"earlyChurnCount": 5,
"otherChurnCount": 2
}
],
"TotalCount": 2
}
Sample Request
GET https://manage.devcenter.microsoft.com/v1.0/my/analytics/subscriptions?applicationId=9NBLGGGZ5QDR&startDate=12/19/2021&endDate=04/20/2022&top=10&skip=0&orderby=date&groupby=date,subscriptionProductName,applicationName,skuId,market,deviceType&aggregationLevel=week
HTTP/1.1
Authorization: Bearer <your access token>
Sample Response
{
"Value": [
{
"date": "2022-04-18",
"subscriptionProductName": "realms.subscription.monthly.10player.01",
"applicationId": "9NBLGGGZ5QDR",
"applicationName": "Windows and Doors",
"skuId": "0100",
"market": "IT",
"deviceType": "Console-Xbox One",
"grossSalesBeforeTax": 0.0,
"totalActiveCount": 0,
"totalChurnCount": 0,
"newCount": 2,
"renewCount": 0,
"goodStandingActiveCount": 0,
"pendingGraceActiveCount": 0,
"graceActiveCount": 0,
"lockedActiveCount": 0,
"billingChurnCount": 0,
"nonRenewalChurnCount": 0,
"refundChurnCount": 0,
"chargebackChurnCount": 0,
"earlyChurnCount": 0,
"otherChurnCount": 0
},
{
"date": "2022-04-18",
"subscriptionProductName": "realms.subscription.monthly.10player.01",
"applicationId": "9NBLGGGZ5QDR",
"applicationName": "Windows and Doors",
"skuId": "0100",
"market": "NO",
"deviceType": "Unknown",
"grossSalesBeforeTax": 0.0,
"totalActiveCount": 0,
"totalChurnCount": 0,
"newCount": 0,
"renewCount": 13,
"goodStandingActiveCount": 0,
"pendingGraceActiveCount": 0,
"graceActiveCount": 0,
"lockedActiveCount": 0,
"billingChurnCount": 0,
"nonRenewalChurnCount": 0,
"refundChurnCount": 0,
"chargebackChurnCount": 0,
"earlyChurnCount": 0,
"otherChurnCount": 0
},
{
"date": "2022-04-18",
"subscriptionProductName": "realms.subscription.monthly.10player.02",
"applicationId": "9NBLGGGZ5QDR",
"applicationName": "Windows and Doors",
"skuId": "0100",
"market": "CA",
"deviceType": "Unknown",
"grossSalesBeforeTax": 0.0,
"totalActiveCount": 152,
"totalChurnCount": 0,
"newCount": 0,
"renewCount": 270,
"goodStandingActiveCount": 133,
"pendingGraceActiveCount": 19,
"graceActiveCount": 0,
"lockedActiveCount": 0,
"billingChurnCount": 0,
"nonRenewalChurnCount": 0,
"refundChurnCount": 0,
"chargebackChurnCount": 0,
"earlyChurnCount": 0,
"otherChurnCount": 0
}
],
"TotalCount": 3
}
Related topics