# Method: monetization.subscriptions.basePlans.batchUpdateStates

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

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](https://google.aip.dev/127) 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 (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans/batchUpdateStates#UpdateBasePlanStateRequest`) } ] } ``` |

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

| Fields ||
|---|---|
| `subscriptions[]` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions#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 (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans/batchUpdateStates#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 (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans/batchUpdateStates#ActivateBasePlanRequest`)`` Activates a base plan. Once activated, base plans will be available to new subscribers. |
| `deactivateBasePlanRequest` | ``object (`https://developers.google.com/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans/batchUpdateStates#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 (`https://developers.google.com/android-publisher/api-ref/rest/v3/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 (`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. |

## DeactivateBasePlanRequest

Request message for basePlans.deactivate.

| JSON representation |
|---|
| ``` { "packageName": string, "productId": string, "basePlanId": 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 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 (`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. |