- Resource: SubscriptionPurchaseV2
- SubscriptionState
- PausedStateContext
- CanceledStateContext
- UserInitiatedCancellation
- CancelSurveyResult
- CancelSurveyReason
- SystemInitiatedCancellation
- DeveloperInitiatedCancellation
- ReplacementCancellation
- TestPurchase
- AcknowledgementState
- ExternalAccountIdentifiers
- SubscribeWithGoogleInfo
- SubscriptionPurchaseLineItem
- AutoRenewingPlan
- PrepaidPlan
- Methods
Resource: SubscriptionPurchaseV2
Indicates the status of a user's subscription purchase.
JSON representation |
---|
{ "kind": string, "regionCode": string, "latestOrderId": string, "lineItems": [ { object ( |
Fields | |
---|---|
kind |
This kind represents a SubscriptionPurchaseV2 object in the androidpublisher service. |
regionCode |
ISO 3166-1 alpha-2 billing country/region code of the user at the time the subscription was granted. |
latestOrderId |
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. |
startTime |
Time at which the subscription was granted. Not set for pending subscriptions (subscription was created but awaiting payment during signup). A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
subscriptionState |
The current state of the subscription. |
linkedPurchaseToken |
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 |
Additional context around paused subscriptions. Only present if the subscription currently has subscriptionState SUBSCRIPTION_STATE_PAUSED. |
canceledStateContext |
Additional context around canceled subscriptions. Only present if the subscription currently has subscriptionState SUBSCRIPTION_STATE_CANCELED. |
testPurchase |
Only present if this subscription purchase is a test purchase. |
acknowledgementState |
The acknowledgement state of the subscription. |
externalAccountIdentifiers |
User account identifier in the third-party service. |
subscribeWithGoogleInfo |
User profile associated with purchases made with 'Subscribe with Google'. |
SubscriptionState
The potential states a subscription can be in, for example whether it is active or canceled. The items within a subscription purchase can either be all auto renewing plans or prepaid plans.
Enums | |
---|---|
SUBSCRIPTION_STATE_UNSPECIFIED |
Unspecified subscription state. |
SUBSCRIPTION_STATE_PENDING |
Subscription was created but awaiting payment during signup. In this state, all items are awaiting payment. |
SUBSCRIPTION_STATE_ACTIVE |
Subscription is active. - (1) If the subscription is an auto renewing plan, at least one item is autoRenewEnabled and not expired. - (2) If the subscription is a prepaid plan, at least one item is not expired. |
SUBSCRIPTION_STATE_PAUSED |
Subscription is paused. The state is only available when the subscription is an auto renewing plan. In this state, all items are in paused state. |
SUBSCRIPTION_STATE_IN_GRACE_PERIOD |
Subscription is in grace period. The state is only available when the subscription is an auto renewing plan. In this state, all items are in grace period. |
SUBSCRIPTION_STATE_ON_HOLD |
Subscription is on hold (suspended). The state is only available when the subscription is an auto renewing plan. In this state, all items are on hold. |
SUBSCRIPTION_STATE_CANCELED |
Subscription is canceled but not expired yet. The state is only available when the subscription is an auto renewing plan. All items have autoRenewEnabled set to false. |
SUBSCRIPTION_STATE_EXPIRED |
Subscription is expired. All items have expiryTime in the past. |
PausedStateContext
Information specific to a subscription in paused state.
JSON representation |
---|
{ "autoResumeTime": string } |
Fields | |
---|---|
autoResumeTime |
Time at which the subscription will be automatically resumed. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
CanceledStateContext
Information specific to a subscription in canceled state.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field cancellation_reason . The reason why a subscription was canceled. cancellation_reason can be only one of the following: |
|
userInitiatedCancellation |
Subscription was canceled by user. |
systemInitiatedCancellation |
Subscription was canceled by the system, for example because of a billing problem. |
developerInitiatedCancellation |
Subscription was canceled by the developer. |
replacementCancellation |
Subscription was replaced by a new subscription. |
UserInitiatedCancellation
Information specific to cancellations initiated by users.
JSON representation |
---|
{
"cancelSurveyResult": {
object ( |
Fields | |
---|---|
cancelSurveyResult |
Information provided by the user when they complete the subscription cancellation flow (cancellation reason survey). |
cancelTime |
The time at which the subscription was canceled by the user. The user might still have access to the subscription after this time. Use lineItems.expiry_time to determine if a user still has access. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
CancelSurveyResult
Result of the cancel survey when the subscription was canceled by the user.
JSON representation |
---|
{
"reason": enum ( |
Fields | |
---|---|
reason |
The reason the user selected in the cancel survey. |
reasonUserInput |
Only set for CANCEL_SURVEY_REASON_OTHERS. This is the user's freeform response to the survey. |
CancelSurveyReason
The reason the user selected in the cancel survey.
Enums | |
---|---|
CANCEL_SURVEY_REASON_UNSPECIFIED |
Unspecified cancel survey reason. |
CANCEL_SURVEY_REASON_NOT_ENOUGH_USAGE |
Not enough usage of the subscription. |
CANCEL_SURVEY_REASON_TECHNICAL_ISSUES |
Technical issues while using the app. |
CANCEL_SURVEY_REASON_COST_RELATED |
Cost related issues. |
CANCEL_SURVEY_REASON_FOUND_BETTER_APP |
The user found a better app. |
CANCEL_SURVEY_REASON_OTHERS |
Other reasons. |
SystemInitiatedCancellation
Information specific to cancellations initiated by Google system.
DeveloperInitiatedCancellation
Information specific to cancellations initiated by developers.
ReplacementCancellation
Information specific to cancellations caused by subscription replacement.
TestPurchase
Whether this subscription purchase is a test purchase.
AcknowledgementState
The possible acknowledgement states for a subscription.
Enums | |
---|---|
ACKNOWLEDGEMENT_STATE_UNSPECIFIED |
Unspecified acknowledgement state. |
ACKNOWLEDGEMENT_STATE_PENDING |
The subscription is not acknowledged yet. |
ACKNOWLEDGEMENT_STATE_ACKNOWLEDGED |
The subscription is acknowledged. |
ExternalAccountIdentifiers
User account identifier in the third-party service.
JSON representation |
---|
{ "externalAccountId": string, "obfuscatedExternalAccountId": string, "obfuscatedExternalProfileId": string } |
Fields | |
---|---|
externalAccountId |
User account identifier in the third-party service. Only present if account linking happened as part of the subscription purchase flow. |
obfuscatedExternalAccountId |
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 |
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. |
SubscribeWithGoogleInfo
Information associated with purchases made with 'Subscribe with Google'.
JSON representation |
---|
{ "profileId": string, "profileName": string, "emailAddress": string, "givenName": string, "familyName": string } |
Fields | |
---|---|
profileId |
The Google profile id of the user when the subscription was purchased. |
profileName |
The profile name of the user when the subscription was purchased. |
emailAddress |
The email address of the user when the subscription was purchased. |
givenName |
The given name of the user when the subscription was purchased. |
familyName |
The family name of the user when the subscription was purchased. |
SubscriptionPurchaseLineItem
Item-level info for a subscription purchase.
JSON representation |
---|
{ "productId": string, "expiryTime": string, // Union field |
Fields | |
---|---|
productId |
The purchased product ID (for example, 'monthly001'). |
expiryTime |
Time at which the subscription expired or will expire unless the access is extended (ex. renews). A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
Union field plan_type . The subscription plan type. plan_type can be only one of the following: |
|
autoRenewingPlan |
The item is auto renewing. |
prepaidPlan |
The item is prepaid. |
AutoRenewingPlan
Information related to an auto renewing plan.
JSON representation |
---|
{ "autoRenewEnabled": boolean } |
Fields | |
---|---|
autoRenewEnabled |
If the subscription is currently set to auto-renew, e.g. the user has not canceled the subscription |
PrepaidPlan
Information related to a prepaid plan.
JSON representation |
---|
{ "allowExtendAfterTime": string } |
Fields | |
---|---|
allowExtendAfterTime |
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. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
Methods |
|
---|---|
|
Get metadata about a subscription |