Method: monetization.subscriptions.basePlans.batchUpdateStates

Activates or deactivates base plans across one or multiple subscriptions.

Set the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.

HTTP request

POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans:batchUpdateStates

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
packageName

string

Required. The parent app (package name) of the updated base plans.

productId

string

Required. The product ID of the parent subscription, if all updated base plans belong to the same subscription. If this batch update spans multiple subscriptions, set this field to "-". Must be set.

Request body

The request body contains data with the following structure:

JSON representation
{
  "requests": [
    {
      object (UpdateBasePlanStateRequest)
    }
  ]
}
Fields
requests[]

object (UpdateBasePlanStateRequest)

Required. The update request list of up to 100 elements. All requests must update different base plans.

Response body

Response message for basePlans.batchUpdateStates.

If successful, the response body contains data with the following structure:

JSON representation
{
  "subscriptions": [
    {
      object (Subscription)
    }
  ]
}
Fields
subscriptions[]

object (Subscription)

The list of updated subscriptions. This list will match the requests one to one, in the same order.

Authorization scopes

Requires the following OAuth scope:

  • https://www.googleapis.com/auth/androidpublisher

UpdateBasePlanStateRequest

Request message to update the state of a subscription base plan.

JSON representation
{

  // Union field state_transition_type can be only one of the following:
  "activateBasePlanRequest": {
    object (ActivateBasePlanRequest)
  },
  "deactivateBasePlanRequest": {
    object (DeactivateBasePlanRequest)
  }
  // End of list of possible types for union field state_transition_type.
}
Fields
Union field state_transition_type. The type of state transition to apply, exactly one must be set. state_transition_type can be only one of the following:
activateBasePlanRequest

object (ActivateBasePlanRequest)

Activates a base plan. Once activated, base plans will be available to new subscribers.

deactivateBasePlanRequest

object (DeactivateBasePlanRequest)

Deactivates a base plan. Once deactivated, the base plan will become unavailable to new subscribers, but existing subscribers will maintain their subscription

ActivateBasePlanRequest

Request message for ActivateBasePlan.

JSON representation
{
  "packageName": string,
  "productId": string,
  "basePlanId": string,
  "latencyTolerance": enum (ProductUpdateLatencyTolerance)
}
Fields
packageName

string

Required. The parent app (package name) of the base plan to activate.

productId

string

Required. The parent subscription (ID) of the base plan to activate.

basePlanId

string

Required. The unique base plan ID of the base plan to activate.

latencyTolerance

enum (ProductUpdateLatencyTolerance)

Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.

DeactivateBasePlanRequest

Request message for basePlans.deactivate.

JSON representation
{
  "packageName": string,
  "productId": string,
  "basePlanId": string,
  "latencyTolerance": enum (ProductUpdateLatencyTolerance)
}
Fields
packageName

string

Required. The parent app (package name) of the base plan to deactivate.

productId

string

Required. The parent subscription (ID) of the base plan to deactivate.

basePlanId

string

Required. The unique base plan ID of the base plan to deactivate.

latencyTolerance

enum (ProductUpdateLatencyTolerance)

Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive.