Method: inappproducts.batchUpdate
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Cập nhật hoặc chèn một hoặc nhiều sản phẩm trong ứng dụng (sản phẩm được quản lý hoặc gói thuê bao).
Đặt trường latencyTolerance trên các yêu cầu lồng nhau thành PRODUCT_UPDATE_LATENCY_TOLERANCE_LATENCY_TOLERANT để đạt được thông lượng cập nhật tối đa.
Bạn không nên sử dụng phương thức này để cập nhật gói thuê bao nữa. Hãy xem bài viết này để biết thêm thông tin.
Yêu cầu HTTP
POST https://androidpublisher.googleapis.com/androidpublisher/v3/applications/{packageName}/inappproducts:batchUpdate
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Tham số |
packageName |
string
Tên gói của ứng dụng.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa dữ liệu có cấu trúc sau:
Trường |
requests[] |
object (InappproductsUpdateRequest )
Bắt buộc. Yêu cầu cập nhật riêng lẻ. Cần có ít nhất một yêu cầu. Có thể chứa tối đa 100 yêu cầu. Tất cả yêu cầu phải tương ứng với nhiều sản phẩm trong ứng dụng.
|
Nội dung phản hồi
Phản hồi yêu cầu cập nhật sản phẩm theo lô trong ứng dụng.
Nếu thành công, phần nội dung phản hồi sẽ chứa dữ liệu có cấu trúc sau:
Biểu diễn dưới dạng JSON |
{
"inappproducts": [
{
object (InAppProduct )
}
]
} |
Trường |
inappproducts[] |
object (InAppProduct )
Sản phẩm được cập nhật hoặc chèn trong ứng dụng.
|
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/androidpublisher
InappproductsUpdateRequest
Yêu cầu cập nhật một sản phẩm trong ứng dụng.
Biểu diễn dưới dạng JSON |
{
"packageName": string,
"sku": string,
"autoConvertMissingPrices": boolean,
"inappproduct": {
object (InAppProduct )
},
"allowMissing": boolean,
"latencyTolerance": enum (ProductUpdateLatencyTolerance )
} |
Trường |
packageName |
string
Tên gói của ứng dụng.
|
sku |
string
Giá trị nhận dạng duy nhất của sản phẩm trong ứng dụng.
|
autoConvertMissingPrices |
boolean
Nếu đúng giá cho tất cả các khu vực mà ứng dụng gốc nhắm đến nhưng chưa có mức giá được chỉ định cho sản phẩm trong ứng dụng này, hệ thống sẽ tự động chuyển đổi sang đơn vị tiền tệ mục tiêu dựa trên giá mặc định. Giá trị mặc định là false.
|
inappproduct |
object (InAppProduct )
Sản phẩm mới trong ứng dụng.
|
allowMissing |
boolean
Nếu bạn đặt chính sách này thành true (đúng) và sản phẩm trong ứng dụng có packageName và sku đã cho không tồn tại, thì sản phẩm trong ứng dụng sẽ được tạo.
|
latencyTolerance |
enum (ProductUpdateLatencyTolerance )
Không bắt buộc. Dung sai độ trễ cho việc truyền tải bản cập nhật sản phẩm này. Giá trị mặc định là nhạy cảm với độ trễ.
|
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\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. |"]]