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)
  }
}
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.

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)
  }
  // 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. 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.

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. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center.

gracePeriodDuration

string

Grace period of the subscription, specified in ISO 8601 format. Acceptable values are P0D (zero days), P3D (3 days), P7D (7 days), P14D (14 days), and P30D (30 days). If not specified, a default value will be used based on the recurring period duration.

accountHoldDuration

string

Optional. Account hold period of the subscription, specified in ISO 8601 format. Acceptable values must be in DAYS and in the range P0D (zero days) to P30D (30 days). If not specified, the default value is P30D (30 days).

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. Subscription period, specified in ISO 8601 format. For a list of acceptable billing periods, refer to the help center.

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.

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.

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.