Method: monetization.subscriptions.basePlans.offers.batchUpdate
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
更新一批订阅优惠。
将嵌套请求上的 delayTolerance 字段设置为 PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT,以实现最大更新吞吐量。
HTTP 请求
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdate
网址采用 gRPC 转码语法。
路径参数
参数 |
packageName |
string
必需。已更新订阅优惠的父级应用(软件包名称)。 必须等于所有已更新的 SubscriptionOffer 资源上的 packageName 字段。
|
productId |
string
必需。父级订阅的商品 ID(如果所有更新后的优惠都属于同一订阅)。如果此请求涉及多个订阅,请将此字段设置为“-”。必须设置。
|
basePlanId |
string
必需。应更新其优惠的父级基础方案 (ID)。可指定为“-”来更新多个基础方案中的优惠。
|
请求正文
请求正文中包含结构如下的数据:
字段 |
requests[] |
object (UpdateSubscriptionOfferRequest )
必需。最多包含 100 个元素的更新请求的列表。所有请求都必须更新不同的订阅优惠。
|
响应正文
Offer.batchUpdate 的响应消息。
如果成功,响应正文将包含结构如下的数据:
字段 |
subscriptionOffers[] |
object (SubscriptionOffer )
更新后的订阅方案列表。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/androidpublisher
UpdateSubscriptionOfferRequest
字段 |
subscriptionOffer |
object (SubscriptionOffer )
必需。要更新的订阅优惠。
|
updateMask |
string (FieldMask format)
必需。要更新的字段列表。 这是完全限定字段名称的逗号分隔列表。示例:"user.displayName,photo" 。
|
regionsVersion |
object (RegionsVersion )
必需。用于 subscriptionOffer 的可用地区的版本。
|
allowMissing |
boolean
可选。如果设为 true,并且具有指定 packageName、productId、basePlanId 和 offerId 的订阅优惠不存在,系统会创建优惠。 如果创建了新优惠,系统会忽略 updateMask。
|
latencyTolerance |
enum (ProductUpdateLatencyTolerance )
可选。传播此产品更新的延迟容忍度。默认为对延迟时间敏感。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eUpdates a batch of subscription offers, allowing for up to 100 update requests in a single call.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing the package name, product ID, and base plan ID for the offers being updated.\u003c/p\u003e\n"],["\u003cp\u003eAllows specifying latency tolerance to optimize update throughput using the \u003ccode\u003elatencyTolerance\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the \u003ccode\u003eUpdateSubscriptionOfferRequest\u003c/code\u003e to define the changes for each subscription offer within the batch.\u003c/p\u003e\n"],["\u003cp\u003eRequires authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This document details the process of batch updating subscription offers via a `POST` request to a specified URL. Key actions involve providing `packageName`, `productId`, and `basePlanId` as path parameters. The request body must include an array of `UpdateSubscriptionOfferRequest` objects, each specifying the offer to update, fields to modify, regions version and a latency tolerance. The response body will then return the list of updated `SubscriptionOffer` objects. Authorization requires the `androidpublisher` OAuth scope.\n"],null,["# Method: monetization.subscriptions.basePlans.offers.batchUpdate\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n - [JSON representation](#body.request_body.SCHEMA_REPRESENTATION)\n- [Response body](#body.response_body)\n - [JSON representation](#body.BatchUpdateSubscriptionOffersResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [UpdateSubscriptionOfferRequest](#UpdateSubscriptionOfferRequest)\n - [JSON representation](#UpdateSubscriptionOfferRequest.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nUpdates a batch of subscription offers.\n\nSet the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/subscriptions/{productId}/basePlans/{basePlanId}/offers:batchUpdate`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `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. |\n| `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. |\n| `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. |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"requests\": [ { object (/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdate#UpdateSubscriptionOfferRequest) } ] } ``` |\n\n| Fields ||\n|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requests[]` | `object (`[UpdateSubscriptionOfferRequest](/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers/batchUpdate#UpdateSubscriptionOfferRequest)`)` Required. A list of update requests of up to 100 elements. All requests must update different subscription offers. |\n\n### Response body\n\nResponse message for offers.batchUpdate.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-----------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"subscriptionOffers\": [ { object (/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer) } ] } ``` |\n\n| Fields ||\n|------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `subscriptionOffers[]` | `object (`[SubscriptionOffer](/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer)`)` The updated subscription offers list. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nUpdateSubscriptionOfferRequest\n------------------------------\n\nRequest message for offers.patch.\n\n| JSON representation |\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"subscriptionOffer\": { object (/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer) }, \"updateMask\": string, \"regionsVersion\": { object (/android-publisher/api-ref/rest/v3/RegionsVersion) }, \"allowMissing\": boolean, \"latencyTolerance\": enum (/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance) } ``` |\n\n| Fields ||\n|---------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `subscriptionOffer` | `object (`[SubscriptionOffer](/android-publisher/api-ref/rest/v3/monetization.subscriptions.basePlans.offers#SubscriptionOffer)`)` Required. The subscription offer to update. |\n| `updateMask` | `string (`[FieldMask](https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask)` format)` Required. The list of fields to be updated. This is a comma-separated list of fully qualified names of fields. Example: `\"user.displayName,photo\"`. |\n| `regionsVersion` | `object (`[RegionsVersion](/android-publisher/api-ref/rest/v3/RegionsVersion)`)` Required. The version of the available regions being used for the subscriptionOffer. |\n| `allowMissing` | `boolean` Optional. If set to true, and the subscription offer with the given packageName, productId, basePlanId and offerId doesn't exist, an offer will be created. If a new offer is created, updateMask is ignored. |\n| `latencyTolerance` | `enum (`[ProductUpdateLatencyTolerance](/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance)`)` Optional. The latency tolerance for the propagation of this product update. Defaults to latency-sensitive. |"]]