Method: monetization.onetimeproducts.purchaseOptions.batchUpdateStates

Activates or deactivates purchase options across one or multiple one-time products.

HTTP request

POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/oneTimeProducts/{productId}/purchaseOptions:batchUpdateStates

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
packageName

string

Required. The parent app (package name) of the updated purchase options.

productId

string

Required. The product ID of the parent one-time product, if all updated purchase options belong to the same one-time product. If this batch update spans multiple one-time products, set this field to "-".

Request body

The request body contains data with the following structure:

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

object (UpdatePurchaseOptionStateRequest)

Required. The update request list of up to 100 elements. All requests must update different purchase options.

Response body

Response message for purchaseOptions.batchUpdateStates.

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

JSON representation
{
  "oneTimeProducts": [
    {
      object (OneTimeProduct)
    }
  ]
}
Fields
oneTimeProducts[]

object (OneTimeProduct)

The list of updated one-time products. 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

UpdatePurchaseOptionStateRequest

Request message to update the state of a one-time product purchase option.

JSON representation
{

  // Union field state_transition_type can be only one of the following:
  "activatePurchaseOptionRequest": {
    object (ActivatePurchaseOptionRequest)
  },
  "deactivatePurchaseOptionRequest": {
    object (DeactivatePurchaseOptionRequest)
  }
  // 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:
activatePurchaseOptionRequest

object (ActivatePurchaseOptionRequest)

Activates a purchase option. Once activated, the purchase option will be available.

deactivatePurchaseOptionRequest

object (DeactivatePurchaseOptionRequest)

Deactivates a purchase option. Once deactivated, the purchase option will become unavailable.

ActivatePurchaseOptionRequest

Request message for UpdatePurchaseOptionState.

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

string

Required. The parent app (package name) of the purchase option to activate.

productId

string

Required. The parent one-time product (ID) of the purchase option to activate.

purchaseOptionId

string

Required. The purchase option ID of the purchase option to activate.

latencyTolerance

enum (ProductUpdateLatencyTolerance)

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

DeactivatePurchaseOptionRequest

Request message for UpdatePurchaseOptionState.

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

string

Required. The parent app (package name) of the purchase option to deactivate.

productId

string

Required. The parent one-time product (ID) of the purchase option to deactivate.

purchaseOptionId

string

Required. The purchase option ID of the purchase option to deactivate.

latencyTolerance

enum (ProductUpdateLatencyTolerance)

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