Method: monetization.onetimeproducts.purchaseOptions.offers.batchUpdateStates

Updates a batch of one-time product offer states.

HTTP request

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

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
packageName

string

Required. The parent app (package name) of the updated one-time product offers.

productId

string

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

purchaseOptionId

string

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

Request body

The request body contains data with the following structure:

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

object (UpdateOneTimeProductOfferStateRequest)

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

Response body

Response message for offers.batchUpdateStates.

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

JSON representation
{
  "oneTimeProductOffers": [
    {
      object (OneTimeProductOffer)
    }
  ]
}
Fields
oneTimeProductOffers[]

object (OneTimeProductOffer)

The updated one-time product offers list, in the same order as the request.

Authorization scopes

Requires the following OAuth scope:

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

UpdateOneTimeProductOfferStateRequest

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

JSON representation
{

  // Union field state_transition_type can be only one of the following:
  "activateOneTimeProductOfferRequest": {
    object (ActivateOneTimeProductOfferRequest)
  },
  "cancelOneTimeProductOfferRequest": {
    object (CancelOneTimeProductOfferRequest)
  },
  "deactivateOneTimeProductOfferRequest": {
    object (DeactivateOneTimeProductOfferRequest)
  }
  // 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:
activateOneTimeProductOfferRequest

object (ActivateOneTimeProductOfferRequest)

Activates an offer. Once activated, the offer is available to users, as long as its conditions are met.

cancelOneTimeProductOfferRequest

object (CancelOneTimeProductOfferRequest)

Cancels an offer. Once cancelled, the offer is not available to users. Any pending orders related to this offer will be cancelled. This state transition is specific to pre-orders.

deactivateOneTimeProductOfferRequest

object (DeactivateOneTimeProductOfferRequest)

Deactivates an offer. Once deactivated, the offer is no longer available to users. This state transition is specific to discounted offers.

CancelOneTimeProductOfferRequest

Request message for offers.cancel.

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

string

Required. The parent app (package name) of the offer to cancel.

productId

string

Required. The parent one-time product (ID) of the offer to cancel.

purchaseOptionId

string

Required. The parent purchase option (ID) of the offer to cancel.

offerId

string

Required. The offer ID of the offer to cancel.

latencyTolerance

enum (ProductUpdateLatencyTolerance)

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

DeactivateOneTimeProductOfferRequest

Request message for offers.deactivate.

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

string

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

productId

string

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

purchaseOptionId

string

Required. The parent purchase option (ID) of the offer to deactivate.

offerId

string

Required. The offer ID of the offer to deactivate.

latencyTolerance

enum (ProductUpdateLatencyTolerance)

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