Google Play Android Developer API . purchases . subscriptionsv2

Instance Methods

close()

Close httplib2 connections.

get(packageName, token, x__xgafv=None)

Get metadata about a subscription

Method Details

close()
Close httplib2 connections.
get(packageName, token, x__xgafv=None)
Get metadata about a subscription

Args:
  packageName: string, The package of the application for which this subscription was purchased (for example, 'com.some.thing'). (required)
  token: string, Required. The token provided to the user's device when the subscription was purchased. (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Indicates the status of a user's subscription purchase.
  "acknowledgementState": "A String", # The acknowledgement state of the subscription.
  "canceledStateContext": { # Information specific to a subscription in canceled state. # Additional context around canceled subscriptions. Only present if the subscription currently has subscription_state SUBSCRIPTION_STATE_CANCELED.
    "developerInitiatedCancellation": { # Information specific to cancellations initiated by developers. # Subscription was canceled by the developer.
    },
    "replacementCancellation": { # Information specific to cancellations caused by subscription replacement. # Subscription was replaced by a new subscription.
    },
    "systemInitiatedCancellation": { # Information specific to cancellations initiated by Google system. # Subscription was canceled by the system, for example because of a billing problem.
    },
    "userInitiatedCancellation": { # Information specific to cancellations initiated by users. # Subscription was canceled by user.
      "cancelSurveyResult": { # Result of the cancel survey when the subscription was canceled by the user. # Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey).
        "reason": "A String", # The reason the user selected in the cancel survey.
        "reasonUserInput": "A String", # Only set for CANCEL_SURVEY_REASON_OTHERS. This is the user's freeform response to the survey.
      },
      "cancelTime": "A String", # The time at which the subscription was canceled by the user. The user might still have access to the subscription after this time. Use line_items.expiry_time to determine if a user still has access.
    },
  },
  "externalAccountIdentifiers": { # User account identifier in the third-party service. # User account identifier in the third-party service.
    "externalAccountId": "A String", # User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow.
    "obfuscatedExternalAccountId": "A String", # 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": "A String", # 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.
  },
  "kind": "A String", # This kind represents a SubscriptionPurchaseV2 object in the androidpublisher service.
  "latestOrderId": "A String", # The order id of the latest order associated with the purchase of the subscription. For autoRenewing subscription, this is the order id of signup order if it is not renewed yet, or the last recurring order id (success, pending, or declined order). For prepaid subscription, this is the order id associated with the queried purchase token.
  "lineItems": [ # Item-level info for a subscription purchase. The items in the same purchase should be either all with AutoRenewingPlan or all with PrepaidPlan.
    { # Item-level info for a subscription purchase.
      "autoRenewingPlan": { # Information related to an auto renewing plan. # The item is auto renewing.
        "autoRenewEnabled": True or False, # If the subscription is currently set to auto-renew, e.g. the user has not canceled the subscription
      },
      "expiryTime": "A String", # Time at which the subscription expired or will expire unless the access is extended (ex. renews).
      "prepaidPlan": { # Information related to a prepaid plan. # The item is prepaid.
        "allowExtendAfterTime": "A String", # After this time, the subscription is allowed for a new top-up purchase. Not present if the subscription is already extended by a top-up purchase.
      },
      "productId": "A String", # The purchased product ID (for example, 'monthly001').
    },
  ],
  "linkedPurchaseToken": "A String", # The purchase token of the old subscription if this subscription is one of the following: * Re-signup of a canceled but non-lapsed subscription * Upgrade/downgrade from a previous subscription. * Convert from prepaid to auto renewing subscription. * Convert from an auto renewing subscription to prepaid. * Topup a prepaid subscription.
  "pausedStateContext": { # Information specific to a subscription in paused state. # Additional context around paused subscriptions. Only present if the subscription currently has subscription_state SUBSCRIPTION_STATE_PAUSED.
    "autoResumeTime": "A String", # Time at which the subscription will be automatically resumed.
  },
  "regionCode": "A String", # ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted.
  "startTime": "A String", # Time at which the subscription was granted. Not set for pending subscriptions (subscription was created but awaiting payment during signup).
  "subscribeWithGoogleInfo": { # Information associated with purchases made with 'Subscribe with Google'. # User profile associated with purchases made with 'Subscribe with Google'.
    "emailAddress": "A String", # The email address of the user when the subscription was purchased.
    "familyName": "A String", # The family name of the user when the subscription was purchased.
    "givenName": "A String", # The given name of the user when the subscription was purchased.
    "profileId": "A String", # The Google profile id of the user when the subscription was purchased.
    "profileName": "A String", # The profile name of the user when the subscription was purchased.
  },
  "subscriptionState": "A String", # The current state of the subscription.
  "testPurchase": { # Whether this subscription purchase is a test purchase. # Only present if this subscription purchase is a test purchase.
  },
}