For a list of methods for this resource, see the end of this page.
Resource representations
A SubscriptionPurchase resource indicates the status of a user's subscription purchase.
{ "kind": "androidpublisher#subscriptionPurchase", "startTimeMillis": long, "expiryTimeMillis": long, "autoResumeTimeMillis": long, "autoRenewing": boolean, "priceCurrencyCode": string, "priceAmountMicros": long, "introductoryPriceInfo": { "introductoryPriceCurrencyCode": string, "introductoryPriceAmountMicros": long, "introductoryPricePeriod": string, "introductoryPriceCycles": integer }, "countryCode": string, "developerPayload": string, "paymentState": integer, "cancelReason": integer, "userCancellationTimeMillis": long, "cancelSurveyResult": { "cancelSurveyReason": integer, "userInputCancelReason": string }, "orderId": string, "linkedPurchaseToken": string, "purchaseType": integer, "priceChange": { "newPrice": { "priceMicros": string, "currency": string }, "state": integer }, "profileName": string, "emailAddress": string, "givenName": string, "familyName": string, "profileId": string, "acknowledgementState": integer }
Property name | Value | Description | Notes |
---|---|---|---|
acknowledgementState |
integer |
The acknowledgement state of the subscription product. Possible values are:
|
|
autoRenewing |
boolean |
Whether the subscription will automatically be renewed when it reaches its current expiry time. | |
autoResumeTimeMillis |
long |
Time at which the subscription will be automatically resumed, in milliseconds since the Epoch. Only present if the user has requested to pause the subscription. | |
cancelReason |
integer |
The reason why a subscription was canceled or is not auto-renewing. Possible values are:
|
|
cancelSurveyResult |
nested object |
Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey). | |
cancelSurveyResult.cancelSurveyReason |
integer |
The cancellation reason the user chose in the survey. Possible values are:
|
|
cancelSurveyResult.userInputCancelReason |
string |
The customized input cancel reason from the user. Only present when cancelReason is 0. | |
countryCode |
string |
ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. | |
developerPayload |
string |
A developer-specified string that contains supplemental information about an order. | |
emailAddress |
string |
The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. | |
expiryTimeMillis |
long |
Time at which the subscription will expire, in milliseconds since the Epoch. | |
familyName |
string |
The family name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. | |
givenName |
string |
The given name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. | |
introductoryPriceInfo |
nested object |
Introductory price information of the subscription. This is only present when the subscription was purchased with an introductory price. This field does not indicate the subscription is currently in introductory price period. |
|
introductoryPriceInfo.introductoryPriceAmountMicros |
long |
Introductory price of the subscription, not including tax. The currency is the same as price_currency_code. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000 . |
|
introductoryPriceInfo.introductoryPriceCurrencyCode |
string |
ISO 4217 currency code for the introductory subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP" . |
|
introductoryPriceInfo.introductoryPriceCycles |
integer |
The number of billing period to offer introductory pricing. | |
introductoryPriceInfo.introductoryPricePeriod |
string |
Introductory price period, specified in ISO 8601 format. Common values are (but not limited to) "P1W" (one week), "P1M" (one month), "P3M" (three months), "P6M" (six months), and "P1Y" (one year). |
|
kind |
string |
This kind represents a subscriptionPurchase object in the androidpublisher service. | |
linkedPurchaseToken |
string |
The purchase token of the originating purchase if this subscription is one of the following:
|
|
orderId |
string |
The order id of the latest recurring order associated with the purchase of the subscription. | |
paymentState |
integer |
The payment state of the subscription. Possible values are:
|
|
priceAmountMicros |
long |
Price of the subscription, not including tax. Price is expressed in micro-units, where 1,000,000 micro-units represents one unit of the currency. For example, if the subscription price is €1.99, price_amount_micros is 1990000 . |
|
priceChange |
nested object |
The latest price change information available. This is present only when there is an upcoming price change for the subscription yet to be applied. Once the subscription renews with the new price or the subscription is canceled, no price change information will be returned. |
|
priceChange.newPrice |
nested object |
The new price the subscription will renew with if the price change is accepted by the user. | |
priceChange.newPrice.currency |
string |
3 letter Currency code, as defined by ISO 4217. | |
priceChange.newPrice.priceMicros |
string |
The price in millionths of the currency base unit represented as a string. | |
priceChange.state |
integer |
The current state of the price change. Possible values are:
|
|
priceCurrencyCode |
string |
ISO 4217 currency code for the subscription price. For example, if the price is specified in British pounds sterling, price_currency_code is "GBP" . |
|
profileId |
string |
The Google profile id of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. | |
profileName |
string |
The profile name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'. | |
purchaseType |
integer |
The type of purchase of the subscription. This field is only set if this purchase was not made using the standard in-app billing flow. Possible values are:
|
|
startTimeMillis |
long |
Time at which the subscription was granted, in milliseconds since the Epoch. | |
userCancellationTimeMillis |
long |
The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0. |
Methods
- acknowledge
- Acknowledges a subscription purchase.
- cancel
- Cancels a user's subscription purchase. The subscription remains valid until its expiration time.
- defer
- Defers a user's subscription purchase until a specified future expiration time.
- get
- Checks whether a user's subscription purchase is valid and returns its expiry time.
- refund
- Refunds a user's subscription purchase, but the subscription remains valid until its expiration time and it will continue to recur.
- revoke
- Refunds and immediately revokes a user's subscription purchase. Access to the subscription will be terminated immediately and it will stop recurring.