AI-generated Key Takeaways
-
The offers.batchUpdateStates method updates the state of multiple subscription offers simultaneously.
-
Use the provided HTTP request template and path parameters to structure your API call, including the package name, product ID, and base plan ID.
-
The request body should contain a list of
UpdateSubscriptionOfferStateRequestobjects, each specifying the offer and the desired state transition (activate or deactivate). -
The response body includes a list of the updated
SubscriptionOfferobjects. -
Authorization requires the
https://www.googleapis.com/auth/androidpublisherOAuth scope.
- HTTP request
- Path parameters
- Request body
- Response body
- Authorization scopes
- UpdateSubscriptionOfferStateRequest
- ActivateSubscriptionOfferRequest
- DeactivateSubscriptionOfferRequest
- 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 syntax.
Path parameters
| Parameters | |
|---|---|
package |
Required. The parent app (package name) of the updated subscription offers. Must be equal to the packageName field on all the updated SubscriptionOffer resources. |
product |
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. |
base |
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 ( |
| Fields | |
|---|---|
requests[] |
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 ( |
| Fields | |
|---|---|
subscription |
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 |
| 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: |
|
activate |
Activates an offer. Once activated, the offer will be available to new subscribers. |
deactivate |
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 ( |
| Fields | |
|---|---|
packageName |
Required. The parent app (package name) of the offer to activate. |
productId |
Required. The parent subscription (ID) of the offer to activate. |
basePlanId |
Required. The parent base plan (ID) of the offer to activate. |
offerId |
Required. The unique offer ID of the offer to activate. |
latencyTolerance |
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 ( |
| Fields | |
|---|---|
package |
Required. The parent app (package name) of the offer to deactivate. |
product |
Required. The parent subscription (ID) of the offer to deactivate. |
base |
Required. The parent base plan (ID) of the offer to deactivate. |
offer |
Required. The unique offer ID of the offer to deactivate. |
latency |
Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive. |