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, "autoRenewing": boolean, "priceCurrencyCode": string, "priceAmountMicros": long, "countryCode": string, "developerPayload": string, "paymentState": integer, "cancelReason": integer, "userCancellationTimeMillis": long, "cancelSurveyResult": { "cancelSurveyReason": integer, "userInputCancelReason": string }, "orderId": string, "linkedPurchaseToken": string, "purchaseType": integer, "profileName": string, "emailAddress": string, "givenName": string, "familyName": string, "profileId": string }
Property name | Value | Description | Notes |
---|---|---|---|
autoRenewing |
boolean |
Whether the subscription will automatically be renewed when it reaches its current expiry time. | |
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'. | |
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 . |
|
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 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
- 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.