Method: inappproducts.batchUpdate
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
更新或插入一个或多个应用内商品(受管理的商品或订阅)。
将嵌套请求上的 delayTolerance 字段设置为 PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT,以实现最大更新吞吐量。
不应再使用此方法更新订阅。如需了解详情,请参阅这篇文章。
HTTP 请求
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate
网址采用 gRPC 转码语法。
路径参数
参数 |
packageName |
string
应用的软件包名称。
|
请求正文
请求正文中包含结构如下的数据:
字段 |
requests[] |
object (InappproductsUpdateRequest )
必需。个别更新请求。必须至少提供一个请求。最多可包含 100 个请求。所有请求都必须对应于不同的应用内商品。
|
响应正文
对应用内商品批量更新的响应。
如果成功,响应正文将包含结构如下的数据:
字段 |
inappproducts[] |
object (InAppProduct )
已更新或插入的应用内商品。
|
授权范围
需要以下 OAuth 范围:
https://www.googleapis.com/auth/androidpublisher
InappproductsUpdateRequest
JSON 表示法 |
{
"packageName": string,
"sku": string,
"autoConvertMissingPrices": boolean,
"inappproduct": {
object (InAppProduct )
},
"allowMissing": boolean,
"latencyTolerance": enum (ProductUpdateLatencyTolerance )
} |
字段 |
packageName |
string
应用的软件包名称。
|
sku |
string
应用内商品的唯一标识符。
|
autoConvertMissingPrices |
boolean
如果为 true,系统将根据默认价格,自动将父级应用所定位到的所有地区(没有为此应用内商品指定价格)换算成目标货币的价格。默认值为 false。
|
inappproduct |
object (InAppProduct )
新的应用内商品。
|
allowMissing |
boolean
如果设为 true,并且不存在具有指定 packageName 和 SKU 的应用内商品,则系统会创建该应用内商品。
|
latencyTolerance |
enum (ProductUpdateLatencyTolerance )
可选。传播此产品更新的延迟容忍度。默认为对延迟时间敏感。
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eUpdates or inserts one or more in-app products (managed products or subscriptions) using batch update.\u003c/p\u003e\n"],["\u003cp\u003eThis method utilizes an HTTP POST request to \u003ccode\u003ehttps://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEach request can contain up to 100 individual update requests, all corresponding to different in-app products.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003elatencyTolerance\u003c/code\u003e can be set to \u003ccode\u003ePRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT\u003c/code\u003e for maximum throughput.\u003c/p\u003e\n"],["\u003cp\u003eAuthorization requires the \u003ccode\u003ehttps://www.googleapis.com/auth/androidpublisher\u003c/code\u003e scope.\u003c/p\u003e\n"]]],["This outlines the `batchUpdate` method for in-app products, accessible via a POST HTTP request to a specified URL. It allows updating or inserting multiple in-app products (managed products) within a single request, capped at 100. The request body contains an array of `InappproductsUpdateRequest` objects, each defining updates to an in-app product using its package name and unique SKU, with option to automatically convert missing prices. The response returns a list of the updated or inserted in-app products. Subscription updates are not supported by this method.\n"],null,["# Method: inappproducts.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.InappproductsBatchUpdateResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [InappproductsUpdateRequest](#InappproductsUpdateRequest)\n - [JSON representation](#InappproductsUpdateRequest.SCHEMA_REPRESENTATION)\n- [Try it!](#try-it)\n\nUpdates or inserts one or more in-app products (managed products or subscriptions).\n\nSet the latencyTolerance field on nested requests to PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT to achieve maximum update throughput.\n\nThis method should no longer be used to update subscriptions. See [this article](https://android-developers.googleblog.com/2023/06/changes-to-google-play-developer-api-june-2023.html) for more information.\n\n### HTTP request\n\n`POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|---------------|-----------------------------------|\n| `packageName` | `string` Package name of the app. |\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/inappproducts/batchUpdate#InappproductsUpdateRequest) } ] } ``` |\n\n| Fields ||\n|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `requests[]` | `object (`[InappproductsUpdateRequest](/android-publisher/api-ref/rest/v3/inappproducts/batchUpdate#InappproductsUpdateRequest)`)` Required. Individual update requests. At least one request is required. Can contain up to 100 requests. All requests must correspond to different in-app products. |\n\n### Response body\n\nResponse for a batch in-app product update.\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------|\n| ``` { \"inappproducts\": [ { object (/android-publisher/api-ref/rest/v3/inappproducts#InAppProduct) } ] } ``` |\n\n| Fields ||\n|-------------------|-------------------------------------------------------------------------------------------------------------------------------------|\n| `inappproducts[]` | `object (`[InAppProduct](/android-publisher/api-ref/rest/v3/inappproducts#InAppProduct)`)` The updated or inserted in-app products. |\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/androidpublisher`\n\nInappproductsUpdateRequest\n--------------------------\n\nRequest to update an in-app product.\n\n| JSON representation |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"packageName\": string, \"sku\": string, \"autoConvertMissingPrices\": boolean, \"inappproduct\": { object (/android-publisher/api-ref/rest/v3/inappproducts#InAppProduct) }, \"allowMissing\": boolean, \"latencyTolerance\": enum (/android-publisher/api-ref/rest/v3/ProductUpdateLatencyTolerance) } ``` |\n\n| Fields ||\n|----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `packageName` | `string` Package name of the app. |\n| `sku` | `string` Unique identifier for the in-app product. |\n| `autoConvertMissingPrices` | `boolean` If true the prices for all regions targeted by the parent app that don't have a price specified for this in-app product will be auto converted to the target currency based on the default price. Defaults to false. |\n| `inappproduct` | `object (`[InAppProduct](/android-publisher/api-ref/rest/v3/inappproducts#InAppProduct)`)` The new in-app product. |\n| `allowMissing` | `boolean` If set to true, and the in-app product with the given packageName and sku doesn't exist, the in-app product will be created. |\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. |"]]