REST Resource: monetization.subscriptions

Resource: Subscription

A single subscription for an app.

JSON representation
{
  "packageName": string,
  "productId": string,
  "basePlans": [
    {
      object (BasePlan)
    }
  ],
  "listings": [
    {
      object (SubscriptionListing)
    }
  ],
  "archived": boolean,
  "taxAndComplianceSettings": {
    object (SubscriptionTaxAndComplianceSettings)
  },
  "restrictedPaymentCountries": {
    object (RestrictedPaymentCountries)
  }
}
Fields
packageName

string

Immutable. Package name of the parent app.

productId

string

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.

basePlans[]

object (BasePlan)

The set of base plans for this subscription. Represents the prices and duration of the subscription if no other offers apply.

listings[]

object (SubscriptionListing)

Required. List of localized listings for this subscription. Must contain at least an entry for the default language of the parent app.

archived
(deprecated)

boolean

Output only. Deprecated: subscription archiving is not supported.

taxAndComplianceSettings

object (SubscriptionTaxAndComplianceSettings)

Details about taxes and legal compliance.

restrictedPaymentCountries

object (RestrictedPaymentCountries)

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 (State),
  "regionalConfigs": [
    {
      object (RegionalBasePlanConfig)
    }
  ],
  "offerTags": [
    {
      object (OfferTag)
    }
  ],
  "otherRegionsConfig": {
    object (OtherRegionsBasePlanConfig)
  },

  // Union field base_plan_type can be only one of the following:
  "autoRenewingBasePlanType": {
    object (AutoRenewingBasePlanType)
  },
  "prepaidBasePlanType": {
    object (PrepaidBasePlanType)
  },
  "installmentsBasePlanType": {
    object (InstallmentsBasePlanType)
  }
  // End of list of possible types for union field base_plan_type.
}
Fields
basePlanId

string

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

enum (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.

regionalConfigs[]

object (RegionalBasePlanConfig)

Region-specific information for this base plan.

offerTags[]

object (OfferTag)

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.

otherRegionsConfig

object (OtherRegionsBasePlanConfig)

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:
autoRenewingBasePlanType

object (AutoRenewingBasePlanType)

Set when the base plan automatically renews at a regular interval.

prepaidBasePlanType

object (PrepaidBasePlanType)

Set when the base plan does not automatically renew at the end of the billing period.

installmentsBasePlanType

object (InstallmentsBasePlanType)

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 (ResubscribeState),
  "prorationMode": enum (SubscriptionProrationMode),
  "legacyCompatible": boolean,
  "legacyCompatibleSubscriptionOfferId": string
}
Fields
billingPeriodDuration

string

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.

gracePeriodDuration

string

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.

accountHoldDuration

string

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.

resubscribeState

enum (ResubscribeState)

Whether users should be able to resubscribe to this base plan in Google Play surfaces. Defaults to RESUBSCRIBE_STATE_ACTIVE if not specified.

prorationMode

enum (SubscriptionProrationMode)

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.

legacyCompatible

boolean

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.

legacyCompatibleSubscriptionOfferId

string

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 (TimeExtension)
}
Fields
billingPeriodDuration

string

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.

timeExtension

enum (TimeExtension)

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 (RenewalType),
  "gracePeriodDuration": string,
  "accountHoldDuration": string,
  "resubscribeState": enum (ResubscribeState),
  "prorationMode": enum (SubscriptionProrationMode)
}
Fields
billingPeriodDuration

string

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.

committedPaymentsCount

integer

Required. Immutable. The number of payments the user is committed to. It is immutable after the base plan is created.

renewalType

enum (RenewalType)

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.

gracePeriodDuration

string

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.

accountHoldDuration

string

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.

resubscribeState

enum (ResubscribeState)

Whether users should be able to resubscribe to this base plan in Google Play surfaces. Defaults to RESUBSCRIBE_STATE_ACTIVE if not specified.

prorationMode

enum (SubscriptionProrationMode)

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 (Money)
  }
}
Fields
regionCode

string

Required. Region code this configuration applies to, as defined by ISO 3166-2, e.g. "US".

newSubscriberAvailability

boolean

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

object (Money)

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 (Money)
  },
  "eurPrice": {
    object (Money)
  },
  "newSubscriberAvailability": boolean
}
Fields
usdPrice

object (Money)

Required. Price in USD to use for any new locations Play may launch in.

eurPrice

object (Money)

Required. Price in EUR to use for any new locations Play may launch in.

newSubscriberAvailability

boolean

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
languageCode

string

Required. The language of this listing, as defined by BCP-47, e.g. "en-US".

title

string

Required. The title of this subscription in the language of this listing. Plain text.

benefits[]

string

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

string

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
regionCodes[]

string

Required. Region codes to impose payment restrictions on, as defined by ISO 3166-2, e.g. "US".

Methods

archive
(deprecated)

Deprecated: subscription archiving is not supported.

batchGet

Reads one or more subscriptions.

batchUpdate

Updates a batch of subscriptions.

create

Creates a new subscription.

delete

Deletes a subscription.

get

Reads a single subscription.

list

Lists all subscriptions under a given app.

patch

Updates an existing subscription.