Google Play Android Developer API
  1. purchases
Google Play Android Developer API
  • internalappsharingartifacts
    • /androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/apk
      POST
    • /androidpublisher/v3/applications/internalappsharing/{packageName}/artifacts/bundle
      POST
  • applications
    • /androidpublisher/v3/applications/{packageName}/deviceTierConfigs
      GET
    • /androidpublisher/v3/applications/{packageName}/deviceTierConfigs
      POST
    • /androidpublisher/v3/applications/{packageName}/deviceTierConfigs/{deviceTierConfigId}
      GET
  • edits
    • /androidpublisher/v3/applications/{packageName}/edits
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}
      DELETE
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/externallyHosted
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/deobfuscationFiles/{deobfuscationFileType}
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}
      PATCH
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/apks/{apkVersionCode}/expansionFiles/{expansionFileType}
      PUT
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/bundles
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/countryAvailability/{track}
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/details
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/details
      PATCH
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/details
      PUT
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings
      DELETE
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}
      DELETE
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}
      PATCH
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}
      PUT
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}
      DELETE
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/listings/{language}/{imageType}/{imageId}
      DELETE
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}
      PATCH
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/testers/{track}
      PUT
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}
      GET
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}
      PATCH
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}/tracks/{track}
      PUT
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}:commit
      POST
    • /androidpublisher/v3/applications/{packageName}/edits/{editId}:validate
      POST
  • generatedapks
    • /androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}
    • /androidpublisher/v3/applications/{packageName}/generatedApks/{versionCode}/downloads/{downloadId}:download
  • inappproducts
    • /androidpublisher/v3/applications/{packageName}/inappproducts
    • /androidpublisher/v3/applications/{packageName}/inappproducts
    • /androidpublisher/v3/applications/{packageName}/inappproducts/{sku}
    • /androidpublisher/v3/applications/{packageName}/inappproducts/{sku}
    • /androidpublisher/v3/applications/{packageName}/inappproducts/{sku}
    • /androidpublisher/v3/applications/{packageName}/inappproducts/{sku}
  • orders
    • /androidpublisher/v3/applications/{packageName}/orders/{orderId}:refund
  • monetization
    • /androidpublisher/v3/applications/{packageName}/pricing:convertRegionPrices
    • /androidpublisher/v3/applications/{packageName}/subscriptions
    • /androidpublisher/v3/applications/{packageName}/subscriptions
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:activate
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers/{offerId}:deactivate
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:activate
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:deactivate
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}:migratePrices
    • /androidpublisher/v3/applications/{packageName}/subscriptions/{productId}:archive
  • purchases
    • /androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}
      GET
    • /androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge
      POST
    • /androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}
      GET
    • /androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge
      POST
    • /androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:cancel
      POST
    • /androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:defer
      POST
    • /androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:refund
      POST
    • /androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:revoke
      POST
    • /androidpublisher/v3/applications/{packageName}/purchases/subscriptionsv2/tokens/{token}
      GET
    • /androidpublisher/v3/applications/{packageName}/purchases/voidedpurchases
      GET
  • reviews
    • /androidpublisher/v3/applications/{packageName}/reviews
    • /androidpublisher/v3/applications/{packageName}/reviews/{reviewId}
    • /androidpublisher/v3/applications/{packageName}/reviews/{reviewId}:reply
  • systemapks
    • /androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants
    • /androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants
    • /androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}
    • /androidpublisher/v3/applications/{packageName}/systemApks/{versionCode}/variants/{variantId}:download
  • users
    • /androidpublisher/v3/{name}
    • /androidpublisher/v3/{name}
    • /androidpublisher/v3/{parent}/users
    • /androidpublisher/v3/{parent}/users
  • grants
    • /androidpublisher/v3/{parent}/grants
  1. purchases

/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}

GET
/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}
purchases
Checks whether a user's subscription purchase is valid and returns its expiry time.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://androidpublisher.googleapis.com//androidpublisher/v3/applications//purchases/subscriptions//tokens/'
Response Response Example
{
    "acknowledgementState": 0,
    "autoRenewing": true,
    "autoResumeTimeMillis": "string",
    "cancelReason": 0,
    "cancelSurveyResult": {
        "cancelSurveyReason": 0,
        "userInputCancelReason": "string"
    },
    "countryCode": "string",
    "developerPayload": "string",
    "emailAddress": "string",
    "expiryTimeMillis": "string",
    "externalAccountId": "string",
    "familyName": "string",
    "givenName": "string",
    "introductoryPriceInfo": {
        "introductoryPriceAmountMicros": "string",
        "introductoryPriceCurrencyCode": "string",
        "introductoryPriceCycles": 0,
        "introductoryPricePeriod": "string"
    },
    "kind": "string",
    "linkedPurchaseToken": "string",
    "obfuscatedExternalAccountId": "string",
    "obfuscatedExternalProfileId": "string",
    "orderId": "string",
    "paymentState": 0,
    "priceAmountMicros": "string",
    "priceChange": {
        "newPrice": {
            "currency": "string",
            "priceMicros": "string"
        },
        "state": 0
    },
    "priceCurrencyCode": "string",
    "profileId": "string",
    "profileName": "string",
    "promotionCode": "string",
    "promotionType": 0,
    "purchaseType": 0,
    "startTimeMillis": "string",
    "userCancellationTimeMillis": "string"
}

Request

Path Params
packageName
string 
required
The package name of the application for which this subscription was purchased (for example, 'com.some.thing').
subscriptionId
string 
required
The purchased subscription ID (for example, 'monthly001').
token
string 
required
The token provided to the user's device when the subscription was purchased.

Responses

🟢200Successful response
application/json
Body
A SubscriptionPurchase resource indicates the status of a user's subscription purchase.
acknowledgementState
integer <int32>
optional
The acknowledgement state of the subscription product. Possible values are: 0. Yet to be acknowledged 1. Acknowledged
autoRenewing
boolean 
optional
Whether the subscription will automatically be renewed when it reaches its current expiry time.
autoResumeTimeMillis
string <int64>
optional
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 <int32>
optional
The reason why a subscription was canceled or is not auto-renewing. Possible values are: 0. User canceled the subscription 1. Subscription was canceled by the system, for example because of a billing problem 2. Subscription was replaced with a new subscription 3. Subscription was canceled by the developer
cancelSurveyResult
object (SubscriptionCancelSurveyResult) 
optional
Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).
cancelSurveyReason
integer <int32>
optional
The cancellation reason the user chose in the survey. Possible values are: 0. Other 1. I don't use this service enough 2. Technical issues 3. Cost-related reasons 4. I found a better app
userInputCancelReason
string 
optional
The customized input cancel reason from the user. Only present when cancelReason is 0.
countryCode
string 
optional
ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.
developerPayload
string 
optional
A developer-specified string that contains supplemental information about an order.
emailAddress
string 
optional
The email address of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
expiryTimeMillis
string <int64>
optional
Time at which the subscription will expire, in milliseconds since the Epoch.
externalAccountId
string 
optional
User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow.
familyName
string 
optional
The family name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
givenName
string 
optional
The given name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
introductoryPriceInfo
object (IntroductoryPriceInfo) 
optional
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.
introductoryPriceAmountMicros
string <int64>
optional
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.
introductoryPriceCurrencyCode
string 
optional
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".
introductoryPriceCycles
integer <int32>
optional
The number of billing period to offer introductory pricing.
introductoryPricePeriod
string 
optional
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 
optional
This kind represents a subscriptionPurchase object in the androidpublisher service.
linkedPurchaseToken
string 
optional
The purchase token of the originating purchase if this subscription is one of the following: 0. Re-signup of a canceled but non-lapsed subscription 1. Upgrade/downgrade from a previous subscription For example, suppose a user originally signs up and you receive purchase token X, then the user cancels and goes through the resignup flow (before their subscription lapses) and you receive purchase token Y, and finally the user upgrades their subscription and you receive purchase token Z. If you call this API with purchase token Z, this field will be set to Y. If you call this API with purchase token Y, this field will be set to X. If you call this API with purchase token X, this field will not be set.
obfuscatedExternalAccountId
string 
optional
An obfuscated version of the id that is uniquely associated with the user's account in your app. Present for the following purchases: * If account linking happened as part of the subscription purchase flow. * It was specified using https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedaccountid when the purchase was made.
obfuscatedExternalProfileId
string 
optional
An obfuscated version of the id that is uniquely associated with the user's profile in your app. Only present if specified using https://developer.android.com/reference/com/android/billingclient/api/BillingFlowParams.Builder#setobfuscatedprofileid when the purchase was made.
orderId
string 
optional
The order id of the latest recurring order associated with the purchase of the subscription. If the subscription was canceled because payment was declined, this will be the order id from the payment declined order.
paymentState
integer <int32>
optional
The payment state of the subscription. Possible values are: 0. Payment pending 1. Payment received 2. Free trial 3. Pending deferred upgrade/downgrade Not present for canceled, expired subscriptions.
priceAmountMicros
string <int64>
optional
Price of the subscription, For tax exclusive countries, the price doesn't include tax. For tax inclusive countries, the price includes 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
object (SubscriptionPriceChange) 
optional
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.
newPrice
object (Price) 
optional
The new price the subscription will renew with if the price change is accepted by the user.
state
integer <int32>
optional
The current state of the price change. Possible values are: 0. Outstanding: State for a pending price change waiting for the user to agree. In this state, you can optionally seek confirmation from the user using the In-App API. 1. Accepted: State for an accepted price change that the subscription will renew with unless it's canceled. The price change takes effect on a future date when the subscription renews. Note that the change might not occur when the subscription is renewed next.
priceCurrencyCode
string 
optional
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 
optional
The Google profile id of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
profileName
string 
optional
The profile name of the user when the subscription was purchased. Only present for purchases made with 'Subscribe with Google'.
promotionCode
string 
optional
The promotion code applied on this purchase. This field is only set if a vanity code promotion is applied when the subscription was purchased.
promotionType
integer <int32>
optional
The type of promotion applied on this purchase. This field is only set if a promotion is applied when the subscription was purchased. Possible values are: 0. One time code 1. Vanity code
purchaseType
integer <int32>
optional
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: 0. Test (i.e. purchased from a license testing account) 1. Promo (i.e. purchased using a promo code)
startTimeMillis
string <int64>
optional
Time at which the subscription was granted, in milliseconds since the Epoch.
userCancellationTimeMillis
string <int64>
optional
The time at which the subscription was canceled by the user, in milliseconds since the epoch. Only present if cancelReason is 0.
Modified at 2022-09-11 20:51:56
Previous
/androidpublisher/v3/applications/{packageName}/purchases/products/{productId}/tokens/{token}:acknowledge
Next
/androidpublisher/v3/applications/{packageName}/purchases/subscriptions/{subscriptionId}/tokens/{token}:acknowledge
Built with