Android · Schema

SubscriptionPurchase

Represents a subscription purchase. Contains the subscription state, expiry time, auto-renewal status, and cancellation details.

AIAndroidAutomotiveGoogleMachine LearningMobile DevelopmentSDKTVWearables

Properties

Name Type Description
kind string Resource type identifier.
startTimeMillis string Time at which the subscription was granted (milliseconds since Epoch).
expiryTimeMillis string Time at which the subscription will expire (milliseconds since Epoch). For cancelled subscriptions, this is when access ends.
userCancellationTimeMillis string Time at which the subscription was canceled by the user (milliseconds since Epoch). Only present if cancelReason is 0.
autoRenewing boolean Whether the subscription will automatically be renewed.
priceCurrencyCode string ISO 4217 currency code for the subscription price.
priceAmountMicros string Price of the subscription in micro-units of the currency. For example, 7990000 represents $7.99.
countryCode string ISO 3166-1 alpha-2 country code of the user at the time the subscription was granted.
developerPayload string Developer-specified string for additional information.
paymentState integer The payment state of the subscription. 0 = Payment pending, 1 = Payment received, 2 = Free trial, 3 = Pending deferred upgrade/downgrade.
cancelReason integer The reason a subscription was cancelled or not auto-renewed. 0 = User cancelled, 1 = System cancelled (billing issue), 2 = Replaced with a new subscription, 3 = Developer cancelled.
linkedPurchaseToken string The purchase token of the previous subscription if this subscription is a replacement (upgrade/downgrade).
purchaseType integer The type of purchase. 0 = Test (sandbox), 1 = Promo.
orderId string The order ID of the latest recurring order.
acknowledgementState integer The acknowledgement state. 0 = Yet to be acknowledged, 1 = Acknowledged.
externalAccountId string User account identifier in the third-party service.
promotionType integer The type of promotion applied on this purchase. 0 = One-time code, 1 = Vanity code.
promotionCode string The promotion code applied on this purchase.
obfuscatedExternalAccountId string Obfuscated user account ID in the third-party service.
obfuscatedExternalProfileId string Obfuscated user profile ID in the third-party service.
View JSON Schema on GitHub

JSON Schema

google-play-developer-subscription-purchase-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "SubscriptionPurchase",
  "type": "object",
  "description": "Represents a subscription purchase. Contains the subscription state, expiry time, auto-renewal status, and cancellation details.",
  "properties": {
    "kind": {
      "type": "string",
      "description": "Resource type identifier."
    },
    "startTimeMillis": {
      "type": "string",
      "description": "Time at which the subscription was granted (milliseconds since Epoch)."
    },
    "expiryTimeMillis": {
      "type": "string",
      "description": "Time at which the subscription will expire (milliseconds since Epoch). For cancelled subscriptions, this is when access ends."
    },
    "userCancellationTimeMillis": {
      "type": "string",
      "description": "Time at which the subscription was canceled by the user (milliseconds since Epoch). Only present if cancelReason is 0."
    },
    "autoRenewing": {
      "type": "boolean",
      "description": "Whether the subscription will automatically be renewed."
    },
    "priceCurrencyCode": {
      "type": "string",
      "description": "ISO 4217 currency code for the subscription price."
    },
    "priceAmountMicros": {
      "type": "string",
      "description": "Price of the subscription in micro-units of the currency. For example, 7990000 represents $7.99."
    },
    "countryCode": {
      "type": "string",
      "description": "ISO 3166-1 alpha-2 country code of the user at the time the subscription was granted."
    },
    "developerPayload": {
      "type": "string",
      "description": "Developer-specified string for additional information."
    },
    "paymentState": {
      "type": "integer",
      "description": "The payment state of the subscription. 0 = Payment pending, 1 = Payment received, 2 = Free trial, 3 = Pending deferred upgrade/downgrade."
    },
    "cancelReason": {
      "type": "integer",
      "description": "The reason a subscription was cancelled or not auto-renewed. 0 = User cancelled, 1 = System cancelled (billing issue), 2 = Replaced with a new subscription, 3 = Developer cancelled."
    },
    "linkedPurchaseToken": {
      "type": "string",
      "description": "The purchase token of the previous subscription if this subscription is a replacement (upgrade/downgrade)."
    },
    "purchaseType": {
      "type": "integer",
      "description": "The type of purchase. 0 = Test (sandbox), 1 = Promo."
    },
    "orderId": {
      "type": "string",
      "description": "The order ID of the latest recurring order."
    },
    "acknowledgementState": {
      "type": "integer",
      "description": "The acknowledgement state. 0 = Yet to be acknowledged, 1 = Acknowledged."
    },
    "externalAccountId": {
      "type": "string",
      "description": "User account identifier in the third-party service."
    },
    "promotionType": {
      "type": "integer",
      "description": "The type of promotion applied on this purchase. 0 = One-time code, 1 = Vanity code."
    },
    "promotionCode": {
      "type": "string",
      "description": "The promotion code applied on this purchase."
    },
    "obfuscatedExternalAccountId": {
      "type": "string",
      "description": "Obfuscated user account ID in the third-party service."
    },
    "obfuscatedExternalProfileId": {
      "type": "string",
      "description": "Obfuscated user profile ID in the third-party service."
    }
  }
}