- [HTTP request](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#body.request_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#body.response_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#body.BatchUpdateOneTimeProductOfferStatesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#body.aspect)
- [UpdateOneTimeProductOfferStateRequest](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#UpdateOneTimeProductOfferStateRequest)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#UpdateOneTimeProductOfferStateRequest.SCHEMA_REPRESENTATION)
- [CancelOneTimeProductOfferRequest](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#CancelOneTimeProductOfferRequest)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#CancelOneTimeProductOfferRequest.SCHEMA_REPRESENTATION)
- [DeactivateOneTimeProductOfferRequest](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#DeactivateOneTimeProductOfferRequest)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#DeactivateOneTimeProductOfferRequest.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.onetimeproducts.purchaseOptions.offers/batchUpdateStates.md.txt#try-it)

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](https://google.aip.dev/127) 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 |
|---|
| ``` { // The following is a list of mutually exclusive fields. At most one of the // fields will be set in a response: "activateOneTimeProductOfferRequest": { object (`ActivateOneTimeProductOfferRequest`) }, "cancelOneTimeProductOfferRequest": { object (`CancelOneTimeProductOfferRequest`) }, "deactivateOneTimeProductOfferRequest": { object (`DeactivateOneTimeProductOfferRequest`) } // End of mutually exclusive fields. } ``` |

| Fields ||
|---|---|
| The type of state transition to apply, exactly one must be set. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `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 and game reward offers. |
| End of mutually exclusive fields. ||

## 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. |