Vì Content API cho phép bạn tương tác với Google Merchant Center theo phương thức lập trình, nên bước đầu tiên để sử dụng Content API là thiết lập và kiểm thử tài khoản Merchant Center.
Để tạo và kiểm thử tài khoản Merchant Center, hãy hoàn tất các bước sau:
Trong Merchant Center, hãy tìm giá trị nhận dạng duy nhất của tài khoản. Đây là số ở góc trên cùng bên phải của trang, phía trên địa chỉ email của tài khoản.
Trong phần Thông tin xác thực, hãy chọn Google OAuth 2.0 và khoá API.
Nhấp vào Thực thi.
Nếu được nhắc, hãy đăng nhập bằng Tài khoản Google được liên kết với tài khoản Merchant Center của bạn.
Nếu tài khoản Merchant Center của bạn được định cấu hình chính xác, yêu cầu sẽ thành công và trả về mã phản hồi HTTP 200. Tuy nhiên, vì bạn vừa tạo một tài khoản mới nên phương thức products.list có thể không trả về sản phẩm nào. Trong phần sau của hướng dẫn này, bạn sẽ thêm một sản phẩm rồi gọi lại products.list để xác nhận rằng thao tác đã thành công.
[null,null,["Cập nhật lần gần đây nhất: 2024-11-20 UTC."],[[["The Merchant API beta is now available, offering a new and improved way to interact with Google Merchant Center."],["This API is the future of the Content API for Shopping, providing enhanced integration capabilities."],["To utilize the Merchant API, you need a Merchant Center account; detailed setup instructions are provided if you don't already have one."],["You can test your Merchant Center account and API integration using the `products.list` request with your unique Merchant Center ID."]]],["The Merchant API beta, the new version of the Content API for Shopping, is introduced. To use it, set up a Merchant Center account: sign up, verify and claim your website URL (unless using a third-party CSS), and set US tax settings. Locate your account's unique identifier. Test the setup by executing a `products.list` request via the API Explorer, entering your account ID, and authenticating with OAuth 2.0 and API key credentials. A successful setup yields a 200 HTTP response.\n"]]