# Method: monetization.subscriptions.basePlans.offers.batchUpdateStates

- [HTTP request](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#body.HTTP_TEMPLATE)
- [Path parameters](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#body.PATH_PARAMETERS)
- [Request body](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#body.request_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#body.response_body)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#body.BatchUpdateSubscriptionOfferStatesResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#body.aspect)
- [UpdateSubscriptionOfferStateRequest](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#UpdateSubscriptionOfferStateRequest)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#UpdateSubscriptionOfferStateRequest.SCHEMA_REPRESENTATION)
- [ActivateSubscriptionOfferRequest](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#ActivateSubscriptionOfferRequest)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#ActivateSubscriptionOfferRequest.SCHEMA_REPRESENTATION)
- [DeactivateSubscriptionOfferRequest](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#DeactivateSubscriptionOfferRequest)
  - [JSON representation](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#DeactivateSubscriptionOfferRequest.SCHEMA_REPRESENTATION)
- [Try it!](https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#try-it)

Updates a batch of subscription offer states.

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/{basePlanId}/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 subscription offers. Must be equal to the packageName field on all the updated SubscriptionOffer resources. |
| `productId` | `string` Required. The product ID of the parent subscription, if all updated offers belong to the same subscription. If this request spans multiple subscriptions, set this field to "-". Must be set. |
| `basePlanId` | `string` Required. The parent base plan (ID) for which the offers should be updated. May be specified as '-' to update offers from multiple base plans. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "requests": [ { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#UpdateSubscriptionOfferStateRequest`) } ] } ``` |

| Fields ||
|---|---|
| `requests[]` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#UpdateSubscriptionOfferStateRequest`)`` 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 |
|---|
| ``` { "subscriptionOffers": [ { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer`) } ] } ``` |

| Fields ||
|---|---|
| `subscriptionOffers[]` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer`)`` The updated subscription offers list. |

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/androidpublisher`

## UpdateSubscriptionOfferStateRequest

Request message to update the state of a subscription offer.

| JSON representation |
|---|
| ``` { // Union field `state_transition_type` can be only one of the following: "activateSubscriptionOfferRequest": { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#ActivateSubscriptionOfferRequest`) }, "deactivateSubscriptionOfferRequest": { object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#DeactivateSubscriptionOfferRequest`) } // 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: ||
| `activateSubscriptionOfferRequest` | ``object (`ActivateSubscriptionOfferRequest`)`` Activates an offer. Once activated, the offer will be available to new subscribers. |
| `deactivateSubscriptionOfferRequest` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdateStates#DeactivateSubscriptionOfferRequest`)`` Deactivates an offer. Once deactivated, the offer will become unavailable to new subscribers, but existing subscribers will maintain their subscription |

## ActivateSubscriptionOfferRequest

Request message for ActivateSubscriptionOffer.

| JSON representation |
|---|
| ``` { "packageName": string, "productId": string, "basePlanId": string, "offerId": string, "latencyTolerance": enum (`https://developers.google.com/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance`) } ``` |

| Fields ||
|---|---|
| `packageName` | `string` Required. The parent app (package name) of the offer to activate. |
| `productId` | `string` Required. The parent subscription (ID) of the offer to activate. |
| `basePlanId` | `string` Required. The parent base plan (ID) of the offer to activate. |
| `offerId` | `string` Required. The unique offer ID of the offer to activate. |
| `latencyTolerance` | ``enum (`https://developers.google.com/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance`)`` Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive. |

## DeactivateSubscriptionOfferRequest

Request message for offers.deactivate.

| JSON representation |
|---|
| ``` { "packageName": string, "productId": string, "basePlanId": string, "offerId": string, "latencyTolerance": enum (`https://developers.google.com/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance`) } ``` |

| Fields ||
|---|---|
| `packageName` | `string` Required. The parent app (package name) of the offer to deactivate. |
| `productId` | `string` Required. The parent subscription (ID) of the offer to deactivate. |
| `basePlanId` | `string` Required. The parent base plan (ID) of the offer to deactivate. |
| `offerId` | `string` Required. The unique offer ID of the offer to deactivate. |
| `latencyTolerance` | ``enum (`https://developers.google.com/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance`)`` Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive. |