- Resource: Subscription
- BasePlan
- State
- AutoRenewingBasePlanType
- ResubscribeState
- SubscriptionProrationMode
- PrepaidBasePlanType
- TimeExtension
- InstallmentsBasePlanType
- RenewalType
- RegionalBasePlanConfig
- OtherRegionsBasePlanConfig
- SubscriptionListing
- RestrictedPaymentCountries
- Methods
Resource: Subscription
A single subscription for an app.
JSON representation |
---|
{ "packageName": string, "productId": string, "basePlans": [ { object ( |
Fields | |
---|---|
package |
Immutable. Package name of the parent app. |
product |
Immutable. Unique product ID of the product. Unique within the parent app. Product IDs must be composed of lower-case letters (a-z), numbers (0-9), underscores (_) and dots (.). It must start with a lower-case letter or number, and be between 1 and 40 (inclusive) characters in length. |
base |
The set of base plans for this subscription. Represents the prices and duration of the subscription if no other offers apply. |
listings[] |
Required. List of localized listings for this subscription. Must contain at least an entry for the default language of the parent app. |
archived |
Output only. Deprecated: subscription archiving is not supported. |
tax |
Details about taxes and legal compliance. |
restricted |
Optional. Countries where the purchase of this subscription is restricted to payment methods registered in the same country. If empty, no payment location restrictions are imposed. |
BasePlan
A single base plan for a subscription.
JSON representation |
---|
{ "basePlanId": string, "state": enum ( |
Fields | |
---|---|
base |
Required. Immutable. The unique identifier of this base plan. Must be unique within the subscription, and conform with RFC-1034. That is, this ID can only contain lower-case letters (a-z), numbers (0-9), and hyphens (-), and be at most 63 characters. |
state |
Output only. The state of the base plan, i.e. whether it's active. Draft and inactive base plans can be activated or deleted. Active base plans can be made inactive. Inactive base plans can be canceled. This field cannot be changed by updating the resource. Use the dedicated endpoints instead. |
regional |
Region-specific information for this base plan. |
offer |
List of up to 20 custom tags specified for this base plan, and returned to the app through the billing library. Subscription offers for this base plan will also receive these offer tags in the billing library. |
other |
Pricing information for any new locations Play may launch in the future. If omitted, the BasePlan will not be automatically available any new locations Play may launch in the future. |
Union field base_plan_type . The type of this base plan. Exactly one must be set. The base plan type is immutable after the base plan is created. base_plan_type can be only one of the following: |
|
auto |
Set when the base plan automatically renews at a regular interval. |
prepaid |
Set when the base plan does not automatically renew at the end of the billing period. |
installments |
Set for installments base plans where a user is committed to a specified number of payments. |
State
Current state of a base plan.
Enums | |
---|---|
STATE_UNSPECIFIED |
Unspecified state. |
DRAFT |
The base plan is currently in a draft state, and hasn't been activated. It can be safely deleted at this point. |
ACTIVE |
The base plan is active and available for new subscribers. |
INACTIVE |
The base plan is inactive and only available for existing subscribers. |
AutoRenewingBasePlanType
Represents a base plan that automatically renews at the end of its subscription period.
JSON representation |
---|
{ "billingPeriodDuration": string, "gracePeriodDuration": string, "accountHoldDuration": string, "resubscribeState": enum ( |
Fields | |
---|---|
billing |
Required. Immutable. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center. The duration is immutable after the base plan is created. |
grace |
Grace period of the subscription, specified in ISO 8601 format. Acceptable values must be in days and between P0D and the lesser of 30D and base plan billing period. If not specified, a default value will be used based on the billing period. The sum of gracePeriodDuration and accountHoldDuration must be between P30D and P60D days, inclusive. |
account |
Optional. Account hold period of the subscription, specified in ISO 8601 format. Acceptable values must be in days and between P0D and P60D. If not specified, the default value is P30D. The sum of gracePeriodDuration and accountHoldDuration must be between P30D and P60D days, inclusive. |
resubscribe |
Whether users should be able to resubscribe to this base plan in Google Play surfaces. Defaults to RESUBSCRIBE_STATE_ACTIVE if not specified. |
proration |
The proration mode for the base plan determines what happens when a user switches to this plan from another base plan. If unspecified, defaults to CHARGE_ON_NEXT_BILLING_DATE. |
legacy |
Whether the renewing base plan is backward compatible. The backward compatible base plan is returned by the Google Play Billing Library deprecated method querySkuDetailsAsync(). Only one renewing base plan can be marked as legacy compatible for a given subscription. |
legacy |
Subscription offer id which is legacy compatible. The backward compatible subscription offer is returned by the Google Play Billing Library deprecated method querySkuDetailsAsync(). Only one subscription offer can be marked as legacy compatible for a given renewing base plan. To have no Subscription offer as legacy compatible set this field as empty string. |
ResubscribeState
Base plan resubscribe state.
Enums | |
---|---|
RESUBSCRIBE_STATE_UNSPECIFIED |
Unspecified state. |
RESUBSCRIBE_STATE_ACTIVE |
Resubscribe is active. |
RESUBSCRIBE_STATE_INACTIVE |
Resubscribe is inactive. |
SubscriptionProrationMode
The proration mode used for renewing base plans.
Enums | |
---|---|
SUBSCRIPTION_PRORATION_MODE_UNSPECIFIED |
Unspecified mode. |
SUBSCRIPTION_PRORATION_MODE_CHARGE_ON_NEXT_BILLING_DATE |
Users will be charged for their new base plan at the end of their current billing period. |
SUBSCRIPTION_PRORATION_MODE_CHARGE_FULL_PRICE_IMMEDIATELY |
Users will be charged for their new base plan immediately and in full. Any remaining period of their existing subscription will be used to extend the duration of the new billing plan. |
PrepaidBasePlanType
Represents a base plan that does not automatically renew at the end of the base plan, and must be manually renewed by the user.
JSON representation |
---|
{
"billingPeriodDuration": string,
"timeExtension": enum ( |
Fields | |
---|---|
billing |
Required. Immutable. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center. The duration is immutable after the base plan is created. |
time |
Whether users should be able to extend this prepaid base plan in Google Play surfaces. Defaults to TIME_EXTENSION_ACTIVE if not specified. |
TimeExtension
Base plan time extension.
Enums | |
---|---|
TIME_EXTENSION_UNSPECIFIED |
Unspecified state. |
TIME_EXTENSION_ACTIVE |
Time extension is active. Users are allowed to top-up or extend their prepaid plan. |
TIME_EXTENSION_INACTIVE |
Time extension is inactive. Users cannot top-up or extend their prepaid plan. |
InstallmentsBasePlanType
Represents an installments base plan where a user commits to a specified number of payments.
JSON representation |
---|
{ "billingPeriodDuration": string, "committedPaymentsCount": integer, "renewalType": enum ( |
Fields | |
---|---|
billing |
Required. Immutable. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center. The duration is immutable after the base plan is created. |
committed |
Required. Immutable. The number of payments the user is committed to. It is immutable after the base plan is created. |
renewal |
Required. Immutable. Installments base plan renewal type. Determines the behavior at the end of the initial commitment. The renewal type is immutable after the base plan is created. |
grace |
Grace period of the subscription, specified in ISO 8601 format. Acceptable values must be in days and between P0D and the lesser of 30D and base plan billing period. If not specified, a default value will be used based on the billing period. The sum of gracePeriodDuration and accountHoldDuration must be between P30D and P60D days, inclusive. |
account |
Optional. Account hold period of the subscription, specified in ISO 8601 format. Acceptable values must be in days and between P0D and P60D. If not specified, the default value is P30D. The sum of gracePeriodDuration and accountHoldDuration must be between P30D and P60D days, inclusive. |
resubscribe |
Whether users should be able to resubscribe to this base plan in Google Play surfaces. Defaults to RESUBSCRIBE_STATE_ACTIVE if not specified. |
proration |
The proration mode for the base plan determines what happens when a user switches to this plan from another base plan. If unspecified, defaults to CHARGE_ON_NEXT_BILLING_DATE. |
RenewalType
Installments base plan renewal type. Determines the behavior at the end of the initial commitment. The renewal type is immutable after the base plan is created.
Enums | |
---|---|
RENEWAL_TYPE_UNSPECIFIED |
Unspecified state. |
RENEWAL_TYPE_RENEWS_WITHOUT_COMMITMENT |
Renews periodically for the billing period duration without commitment. |
RENEWAL_TYPE_RENEWS_WITH_COMMITMENT |
Renews with the commitment of the same duration as the initial one. |
RegionalBasePlanConfig
Configuration for a base plan specific to a region.
JSON representation |
---|
{
"regionCode": string,
"newSubscriberAvailability": boolean,
"price": {
object ( |
Fields | |
---|---|
region |
Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g. "US". |
new |
Whether the base plan in the specified region is available for new subscribers. Existing subscribers will not have their subscription canceled if this value is set to false. If not specified, this will default to false. |
price |
The price of the base plan in the specified region. Must be set if the base plan is available to new subscribers. Must be set in the currency that is linked to the specified region. |
OtherRegionsBasePlanConfig
Pricing information for any new locations Play may launch in.
JSON representation |
---|
{ "usdPrice": { object ( |
Fields | |
---|---|
usd |
Required. Price in USD to use for any new locations Play may launch in. |
eur |
Required. Price in EUR to use for any new locations Play may launch in. |
new |
Whether the base plan is available for new subscribers in any new locations Play may launch in. If not specified, this will default to false. |
SubscriptionListing
The consumer-visible metadata of a subscription.
JSON representation |
---|
{ "languageCode": string, "title": string, "benefits": [ string ], "description": string } |
Fields | |
---|---|
language |
Required. The language of this listing, as defined by BCP-47, e.g. "en-US". |
title |
Required. The title of this subscription in the language of this listing. Plain text. |
benefits[] |
A list of benefits shown to the user on platforms such as the Play Store and in restoration flows in the language of this listing. Plain text. Ordered list of at most four benefits. |
description |
The description of this subscription in the language of this listing. Maximum length - 80 characters. Plain text. |
RestrictedPaymentCountries
Countries where the purchase of this product is restricted to payment methods registered in the same country. If empty, no payment location restrictions are imposed.
JSON representation |
---|
{ "regionCodes": [ string ] } |
Fields | |
---|---|
region |
Required. Region codes to impose payment restrictions on, as defined by ISO 3166-2, e.g. "US". |
Methods |
|
---|---|
(deprecated) |
Deprecated: subscription archiving is not supported. |
|
Reads one or more subscriptions. |
|
Updates a batch of subscriptions. |
|
Creates a new subscription. |
|
Deletes a subscription. |
|
Reads a single subscription. |
|
Lists all subscriptions under a given app. |
|
Updates an existing subscription. |