- Resource: SubscriptionOffer
- State
- SubscriptionOfferPhase
- RegionalSubscriptionOfferPhaseConfig
- RegionalSubscriptionOfferPhaseFreePriceOverride
- OtherRegionsSubscriptionOfferPhaseConfig
- OtherRegionsSubscriptionOfferPhasePrices
- OtherRegionsSubscriptionOfferPhaseFreePriceOverride
- SubscriptionOfferTargeting
- AcquisitionTargetingRule
- TargetingRuleScope
- TargetingRuleScopeThisSubscription
- TargetingRuleScopeAnySubscriptionInApp
- UpgradeTargetingRule
- RegionalSubscriptionOfferConfig
- OtherRegionsSubscriptionOfferConfig
- Methods
Resource: SubscriptionOffer
A single, temporary offer
JSON representation |
---|
{ "packageName": string, "productId": string, "basePlanId": string, "offerId": string, "state": enum ( |
Fields | |
---|---|
packageName |
Required. Immutable. The package name of the app the parent subscription belongs to. |
productId |
Required. Immutable. The ID of the parent subscription this offer belongs to. |
basePlanId |
Required. Immutable. The ID of the base plan to which this offer is an extension. |
offerId |
Required. Immutable. Unique ID of this subscription offer. Must be unique within the base plan. |
state |
Output only. The current state of this offer. Can be changed using Activate and Deactivate actions. NB: the base plan state supersedes this state, so an active offer may not be available if the base plan is not active. |
phases[] |
Required. The phases of this subscription offer. Must contain at least one and at most two entries. Users will always receive all these phases in the specified order. |
targeting |
The requirements that users need to fulfil to be eligible for this offer. Represents the requirements that Play will evaluate to decide whether an offer should be returned. Developers may further filter these offers themselves. |
regionalConfigs[] |
Required. The region-specific configuration of this offer. Must contain at least one entry. |
otherRegionsConfig |
The configuration for any new locations Play may launch in the future. |
offerTags[] |
List of up to 20 custom tags specified for this offer, and returned to the app through the billing library. |
State
The current state of the subscription offer.
Enums | |
---|---|
STATE_UNSPECIFIED |
Default value, should never be used. |
DRAFT |
The subscription offer is not and has never been available to users. |
ACTIVE |
The subscription offer is available to new and existing users. |
INACTIVE |
The subscription offer is not available to new users. Existing users retain access. |
SubscriptionOfferPhase
A single phase of a subscription offer.
JSON representation |
---|
{ "recurrenceCount": integer, "duration": string, "regionalConfigs": [ { object ( |
Fields | |
---|---|
recurrenceCount |
Required. The number of times this phase repeats. If this offer phase is not free, each recurrence charges the user the price of this offer phase. |
duration |
Required. The duration of a single recurrence of this phase. Specified in ISO 8601 format. |
regionalConfigs[] |
Required. The region-specific configuration of this offer phase. This list must contain exactly one entry for each region for which the subscription offer has a regional config. |
otherRegionsConfig |
Pricing information for any new locations Play may launch in. |
RegionalSubscriptionOfferPhaseConfig
Configuration for a single phase of a subscription offer in a single region.
JSON representation |
---|
{ "regionCode": string, // Union field |
Fields | |
---|---|
regionCode |
Required. Immutable. The region to which this config applies. |
Union field price_override . The price override of this phase. Required. price_override can be only one of the following: |
|
price |
The absolute price the user pays for this offer phase. The price must not be smaller than the minimum price allowed for this region. |
relativeDiscount |
The fraction of the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a 50% discount for a phase of a duration of 3 months would correspond to a price of $1.50. The discount must be specified as a fraction strictly larger than 0 and strictly smaller than 1. The resulting price will be rounded to the nearest billable unit (e.g. cents for USD). The relative discount is considered invalid if the discounted price ends up being smaller than the minimum price allowed in this region. |
absoluteDiscount |
The absolute amount of money subtracted from the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a $1 absolute discount for a phase of a duration of 3 months would correspond to a price of $2. The resulting price may not be smaller than the minimum price allowed for this region. |
free |
Set to specify this offer is free to obtain. |
RegionalSubscriptionOfferPhaseFreePriceOverride
This type has no fields.
Represents the free price override configuration for a single phase of a subscription offer
OtherRegionsSubscriptionOfferPhaseConfig
Configuration for any new locations Play may launch in for a single offer phase.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field price_override . The price override of this phase. Required. price_override can be only one of the following: |
|
otherRegionsPrices |
The absolute price the user pays for this offer phase. The price must not be smaller than the minimum price allowed for any new locations Play may launch in. |
relativeDiscount |
The fraction of the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a 50% discount for a phase of a duration of 3 months would correspond to a price of $1.50. The discount must be specified as a fraction strictly larger than 0 and strictly smaller than 1. The resulting price will be rounded to the nearest billable unit (e.g. cents for USD). The relative discount is considered invalid if the discounted price ends up being smaller than the minimum price allowed in any new locations Play may launch in. |
absoluteDiscounts |
The absolute amount of money subtracted from the base plan price prorated over the phase duration that the user pays for this offer phase. For example, if the base plan price for this region is $12 for a period of 1 year, then a $1 absolute discount for a phase of a duration of 3 months would correspond to a price of $2. The resulting price may not be smaller than the minimum price allowed for any new locations Play may launch in. |
free |
Set to specify this offer is free to obtain. |
OtherRegionsSubscriptionOfferPhasePrices
Pricing information for any new locations Play may launch in.
JSON representation |
---|
{ "usdPrice": { object ( |
Fields | |
---|---|
usdPrice |
Required. Price in USD to use for any new locations Play may launch in. |
eurPrice |
Required. Price in EUR to use for any new locations Play may launch in. |
OtherRegionsSubscriptionOfferPhaseFreePriceOverride
This type has no fields.
Represents the free price override configuration for any new locations Play may launch for a single offer phase.
SubscriptionOfferTargeting
Defines the rule a user needs to satisfy to receive this offer.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field rule . Leave empty for developer-determined offer eligibility. rule can be only one of the following: |
|
acquisitionRule |
Offer targeting rule for new user acquisition. |
upgradeRule |
Offer targeting rule for upgrading users' existing plans. |
AcquisitionTargetingRule
Represents a targeting rule of the form: User never had {scope} before.
JSON representation |
---|
{
"scope": {
object ( |
Fields | |
---|---|
scope |
Required. The scope of subscriptions this rule considers. Only allows "this subscription" and "any subscription in app". |
TargetingRuleScope
Defines the scope of subscriptions which a targeting rule can match to target offers to users based on past or current entitlement.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
thisSubscription |
The scope of the current targeting rule is the subscription in which this offer is defined. |
anySubscriptionInApp |
The scope of the current targeting rule is any subscription in the parent app. |
specificSubscriptionInApp |
The scope of the current targeting rule is the subscription with the specified subscription ID. Must be a subscription within the same parent app. |
TargetingRuleScopeThisSubscription
This type has no fields.
Represents the targeting rule scope corresponding to the subscriptions in which this offer is defined.
TargetingRuleScopeAnySubscriptionInApp
This type has no fields.
Represents the targeting rule scope corresponding to any subscription in the parent app.
UpgradeTargetingRule
Represents a targeting rule of the form: User currently has {scope} [with billing period {billing_period}].
JSON representation |
---|
{
"oncePerUser": boolean,
"scope": {
object ( |
Fields | |
---|---|
oncePerUser |
Limit this offer to only once per user. If set to true, a user can never be eligible for this offer again if they ever subscribed to this offer. |
scope |
Required. The scope of subscriptions this rule considers. Only allows "this subscription" and "specific subscription in app". |
billingPeriodDuration |
The specific billing period duration, specified in ISO 8601 format, that a user must be currently subscribed to to be eligible for this rule. If not specified, users subscribed to any billing period are matched. |
RegionalSubscriptionOfferConfig
Configuration for a subscription offer in a single region.
JSON representation |
---|
{ "regionCode": string, "newSubscriberAvailability": boolean } |
Fields | |
---|---|
regionCode |
Required. Immutable. Region code this configuration applies to, as defined by ISO 3166-2, e.g. "US". |
newSubscriberAvailability |
Whether the subscription offer in the specified region is available for new subscribers. Existing subscribers will not have their subscription cancelled if this value is set to false. If not specified, this will default to false. |
OtherRegionsSubscriptionOfferConfig
Configuration for any new locations Play may launch in specified on a subscription offer.
JSON representation |
---|
{ "otherRegionsNewSubscriberAvailability": boolean } |
Fields | |
---|---|
otherRegionsNewSubscriberAvailability |
Whether the subscription offer in any new locations Play may launch in the future. If not specified, this will default to false. |
Methods |
|
---|---|
|
Activates a subscription offer. |
|
Reads one or more subscription offers. |
|
Updates a batch of subscription offers. |
|
Updates a batch of subscription offer states. |
|
Creates a new subscription offer. |
|
Deactivates a subscription offer. |
|
Deletes a subscription offer. |
|
Reads a single offer |
|
Lists all offers under a given subscription. |
|
Updates an existing subscription offer. |