Method: accounts.products.update
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.
Chèn hoặc cập nhật các thuộc tính của sản phẩm trong tài khoản Manufacturer Center.
Tạo một sản phẩm có các thuộc tính được cung cấp. Nếu sản phẩm đã tồn tại, thì tất cả thuộc tính sẽ được thay thế bằng các thuộc tính mới. Các bước kiểm tra tại thời điểm tải lên là tối thiểu. Bạn phải cung cấp tất cả các thuộc tính bắt buộc để sản phẩm hợp lệ. Các vấn đề có thể xuất hiện sau khi API chấp nhận một bản tải lên mới cho một sản phẩm và bạn có thể ghi đè một sản phẩm hợp lệ hiện có bằng một sản phẩm không hợp lệ. Để phát hiện vấn đề này, bạn nên truy xuất sản phẩm và kiểm tra xem sản phẩm có vấn đề gì không khi phiên bản mới có sẵn.
Trước tiên, bạn cần xử lý các thuộc tính đã tải lên thì mới có thể truy xuất được. Cho đến lúc đó, sản phẩm mới sẽ không có sẵn và việc truy xuất các sản phẩm đã tải lên trước đó sẽ trả về trạng thái ban đầu của sản phẩm.
Yêu cầu HTTP
PUT https://manufacturers.googleapis.com/v1/{parent=accounts/*}/products/{name}
URL sử dụng cú pháp Chuyển mã gRPC.
Tham số đường dẫn
Thông số |
parent |
string
Mã nhận dạng chính ở định dạng accounts/{account_id} . account_id – Mã nhận dạng của tài khoản Manufacturer Center.
|
name |
string
Tên ở định dạng {targetCountry}:{contentLanguage}:{productId} . targetCountry – Quốc gia mục tiêu của sản phẩm dưới dạng mã lãnh thổ CLDR (ví dụ: Hoa Kỳ).
contentLanguage – Ngôn ngữ nội dung của sản phẩm dưới dạng mã ngôn ngữ ISO 639-1 gồm hai chữ cái (ví dụ: en).
productId – Mã nhận dạng của sản phẩm. Để biết thêm thông tin, hãy xem https://support.google.com/manufacturers/answer/6124116#id.
|
Nội dung yêu cầu
Nội dung yêu cầu chứa một bản sao của Attributes
.
Nội dung phản hồi
Nếu thành công, phần nội dung phản hồi sẽ là một đối tượng JSON trống.
Phạm vi uỷ quyền
Yêu cầu phạm vi OAuth sau:
https://www.googleapis.com/auth/manufacturercenter
Để biết thêm thông tin, hãy xem OAuth 2.0 Overview.
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-08-17 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-17 UTC."],[[["\u003cp\u003eUpdates or creates product attributes within a Manufacturer Center account, potentially overwriting existing data.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing product details like target country, content language, and a unique product ID within the request.\u003c/p\u003e\n"],["\u003cp\u003eUploaded product data needs processing time before becoming visible or retrievable in its updated state.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes the \u003ccode\u003ePUT\u003c/code\u003e method and specific path parameters for identifying the account and product in the request URL.\u003c/p\u003e\n"],["\u003cp\u003eNeeds authorization with the \u003ccode\u003ehttps://www.googleapis.com/auth/manufacturercenter\u003c/code\u003e scope for access.\u003c/p\u003e\n"]]],[],null,["# Method: accounts.products.update\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nInserts or updates the attributes of the product in a Manufacturer Center account.\n\nCreates a product with the provided attributes. If the product already exists, then all attributes are replaced with the new ones. The checks at upload time are minimal. All required attributes need to be present for a product to be valid. Issues may show up later after the API has accepted a new upload for a product and it is possible to overwrite an existing valid product with an invalid product. To detect this, you should retrieve the product and check it for issues once the new version is available.\n\nUploaded attributes first need to be processed before they can be retrieved. Until then, new products will be unavailable, and retrieval of previously uploaded products will return the original state of the product.\n\n### HTTP request\n\n`PUT https://manufacturers.googleapis.com/v1/{parent=accounts/*}/products/{name}`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Parent ID in the format `accounts/{account_id}`. `account_id` - The ID of the Manufacturer Center account. |\n| `name` | `string` Name in the format `{targetCountry}:{contentLanguage}:{productId}`. `targetCountry` - The target country of the product as a CLDR territory code (for example, US). `contentLanguage` - The content language of the product as a two-letter ISO 639-1 language code (for example, en). `productId` - The ID of the product. For more information, see \u003chttps://support.google.com/manufacturers/answer/6124116#id\u003e. |\n\n### Request body\n\nThe request body contains an instance of [Attributes](/manufacturers/reference/rest/v1/Attributes).\n\n### Response body\n\nIf successful, the response body is an empty JSON object.\n\n### Authorization scopes\n\nRequires the following OAuth scope:\n\n- `https://www.googleapis.com/auth/manufacturercenter`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]