rocket
Giới thiệu
Merchant API – API chính thức thay thế cho Content API for Shopping.
add_alert
Lưu ý: Content API for Shopping sẽ ngừng hoạt động từ ngày 18 tháng 8 năm 2026.
Thêm đường liên kết thanh toán vào trang thông tin miễn phí
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.
Bạn có thể sử dụng thuộc tính checkoutSettings
của trang thông tin miễn phí để cung cấp một đường liên kết giúp khách hàng truy cập trực tiếp vào trang thanh toán. Để biết thêm thông tin, hãy xem bài viết thêm đường liên kết để thanh toán cho trang thông tin miễn phí.
Bạn phải cung cấp thông tin cụ thể về doanh nghiệp và sản phẩm của mình thì mới có thể chọn tham gia chương trình thanh toán. Bạn phải đáp ứng các tiêu chí sau để sử dụng checkoutSettings
:
Kiểm tra giao diện người dùng Google Merchant Center để xem bạn đã đăng ký tham gia chương trình trang thông tin miễn phí hay chưa. Nếu bạn chưa đăng ký, hãy hoàn tất các bước tham gia trang thông tin miễn phí. Hãy sử dụng định dạng sau cho URL thanh toán:
https://mystore.com/path-to-product/{id}
Khi khách hàng nhấp vào URL thanh toán trong trang thông tin miễn phí của bạn, {id}
sẽ tự động được thay thế bằng offerId
của sản phẩm.
Thêm URL thanh toán
Bạn có thể sử dụng freelistingsprogram.checkoutsettings.insert
để thêm hoặc cập nhật mẫu URL thanh toán. Lệnh gọi này sẽ cập nhật mẫu URL thanh toán của bạn ở cấp tài khoản và chọn sử dụng tính năng thanh toán cho tất cả các mặt hàng hợp lệ.
POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings
Ví dụ:
{
uri_settings: {
checkout_uri_template: "https://domain_name.com/custom_path/{id}"
}
}
Xem URL thanh toán hiện tại
Bạn có thể sử dụng freelistingsprogram.checkoutsettings.get
để xem URL thanh toán hiện có. get
chỉ có thể đọc và yêu cầu bạn cung cấp merchantId
. Phương thức get
trả về tài nguyên checkout
tương ứng.
GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings
Xoá URL thanh toán
Bạn có thể xoá URL thanh toán bằng cách sử dụng freelistingsprogram.checkoutsettings.delete
.
Thao tác này sẽ loại bỏ tất cả các mặt hàng của bạn khỏi tính năng thanh toán.
DELETE https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings
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-13 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-08-13 UTC."],[[["\u003cp\u003eGoogle is introducing the Merchant API beta, the new version of the Content API for Shopping.\u003c/p\u003e\n"],["\u003cp\u003eUse the \u003ccode\u003echeckoutSettings\u003c/code\u003e attribute to add a checkout link directly to your free listings, enhancing the customer shopping experience.\u003c/p\u003e\n"],["\u003cp\u003eTo utilize \u003ccode\u003echeckoutSettings\u003c/code\u003e, you need an active product feed in Google Merchant Center and be enrolled in the free listings program.\u003c/p\u003e\n"],["\u003cp\u003eImplement the checkout feature by adding or updating your checkout URL template using the provided API calls, allowing customers to purchase directly from your free listings.\u003c/p\u003e\n"],["\u003cp\u003eManage your checkout URL by viewing, updating, or removing it via the respective API calls, giving you control over the checkout process for your free listings.\u003c/p\u003e\n"]]],["The Merchant API beta, a new version of the Content API for Shopping, is introduced. To use `checkoutSettings` for free listings, users need an active product feed and enrollment in the free listings program. Merchants can add or update their checkout URL templates using `freelistingsprogram.checkoutsettings.insert`, view existing URLs with `get`, and remove them with `delete`. The checkout URL directs customers to a product's checkout page, automatically replacing `{id}` with the product's `offerId`.\n"],null,["# Add a checkout link to your free listings\n\nYou can use the\n[`checkoutSettings`](/shopping-content/reference/rest/v2.1/CheckoutSettings)\nattribute of free listings to provide a link for customers to go directly to the\ncheckout page. For more information, see [add a checkout link for your free\nlistings](//support.google.com/merchants/answer/13580732).\n\nYou must provide specific information about your business and products before\nyou can opt in to the checkout program. You must meet the following criteria to\nuse `checkoutSettings`:\n\n- Have an active [product\n feed](//support.google.com/merchants/answer/7439882?) in the [Google\n Merchant Center](//merchants.google.com/).\n- Your merchant account must be enrolled in the free listings program.\n\nCheck the Google Merchant Center UI to see if you're already enrolled in the\nfree listings program. If you're not enrolled, complete the [free listings\nonboarding](//support.google.com/merchants/answer/9455788) steps. Use the\nfollowing format for your checkout URLs: \n\n https://mystore.com/path-to-product/{id}\n\nWhen a customer clicks on the checkout URL in your free listing, `{id}` is\nautomatically replaced with the [`offerId`](/shopping-content/guides/products/product-id) of the product.\n\nAdd your checkout URL\n---------------------\n\nYou can use\n[`freelistingsprogram.checkoutsettings.insert`](/shopping-content/reference/rest/v2.1/freelistingsprogram.checkoutsettings/insert)to\nadd or update your checkout URL template. This call updates your checkout URL\ntemplate at the account level, and opts all valid offers into the checkout\nfeature. \n\n POST https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings\n\nHere's an example: \n\n {\n uri_settings: {\n checkout_uri_template: \"https://domain_name.com/custom_path/{id}\"\n }\n }\n\nView your current checkout URL\n------------------------------\n\nYou can use\n[`freelistingsprogram.checkoutsettings.get`](/shopping-content/reference/rest/v2.1/freelistingsprogram.checkoutsettings/get)\nto view your existing checkout URL. `get` is read-only, and requires your\n`merchantId`. The `get` method returns the corresponding `checkout` resource. \n\n GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings\n\nRemove your checkout URL\n------------------------\n\nYou can remove your checkout URL by using\n[`freelistingsprogram.checkoutsettings.delete`](/shopping-content/reference/rest/v2.1/freelistingsprogram.checkoutsettings/delete).\nThis opts all your offers out of the checkout feature. \n\n DELETE https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/freelistingsprogram/checkoutsettings"]]