驗證帳戶和 Merchant API 的連線
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
如果您已有 Merchant Center 帳戶,可以使用參考文件中的 Google API Explorer,確認您的帳戶已準備好使用 Merchant API。
- 將
accounts/
和您的 merchantId
連結,找出帳戶的資源名稱。你可以在 Google Merchant Center 的頂端找到 merchantId
。
- 在
accounts.products.list
方法的 API Explorer 中,執行下列操作:
- 在
parent
欄位中輸入帳戶的資源名稱。
- 在「憑證」部分中,選取「Google OAuth 2.0」和「API 金鑰」。
- 按一下 [Execute] (執行)。
- 如果系統顯示提示,請使用與 Google Merchant Center 帳戶相關聯的 Google 帳戶登入。
如果 Merchant Center 帳戶設定正確,要求就會成功,並傳回 HTTP 回應碼 200
。如果您剛建立新帳戶,accounts.products.list
方法不會傳回任何產品。
接著,請嘗試使用用戶端程式庫,要求存取其他 Merchant Center 帳戶。用戶端程式庫支援使用者授權,可授予應用程式存取及管理 Merchant Center 帳戶資料的權限。
您也可以使用服務帳戶,授權 API 存取您自己的帳戶。服務帳戶是一種特殊類型的帳戶,屬於應用程式,而非個別使用者。詳情請參閱「服務帳戶總覽」。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[null,null,["上次更新時間:2025-08-08 (世界標準時間)。"],[[["\u003cp\u003eExisting merchant account holders can use the API explorer to verify their account's compatibility with the Merchant API.\u003c/p\u003e\n"],["\u003cp\u003eAccount verification involves locating your \u003ccode\u003emerchantId\u003c/code\u003e, constructing the resource name, and executing the \u003ccode\u003eaccounts.products.list\u003c/code\u003e method within the API Explorer using your credentials.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful verification is indicated by an HTTP response code \u003ccode\u003e200\u003c/code\u003e, although new accounts may not return any product data.\u003c/p\u003e\n"],["\u003cp\u003eAfter verification, users can proceed to utilize client libraries for accessing other merchant accounts or employ service accounts for authorizing API access to their own account.\u003c/p\u003e\n"]]],["To verify a merchant account for API use, locate your `merchantId` in Google Merchant Center and construct the account's resource name. In the API Explorer, use the `accounts.products.list` method, input the resource name in the `parent` field, and select Google OAuth 2.0 and API key credentials. Executing the request should return an HTTP 200 code, confirming successful setup. For new accounts, the product list will be empty. Further access can be configured via client libraries or service accounts.\n"],null,["# Verify your account's connection to Merchant API\n\nIf you have an existing Merchant Center account, you can use [Google APIs\nExplorer](https://developers.google.com/apis-explorer) in the [reference documentation](/merchant/api/reference/rest) to verify\nthat your account is ready to use with the Merchant API.\n\n1. Find the resource name of your account by concatenating `accounts/` and your `merchantId`. You can find your `merchantId` in the top of [Google Merchant Center](//merchants.google.com/).\n2. In the API Explorer for the [`accounts.products.list`](/merchant/api/reference/rest/products_v1/accounts.products/list) method, do the following:\n 1. Enter the resource name of your account in the `parent` field.\n 2. In the **Credentials** section, select **Google OAuth 2.0** and **API\n key**.\n 3. Click **Execute**.\n 4. If prompted, sign in with the Google Account associated with your Google Merchant Center account.\n\nIf your Merchant Center account is set up correctly, the request succeeds and\nreturns an HTTP response code `200`. If you just created a new account, the\n`accounts.products.list` method doesn't return any products.\n\nNext, try [using a client library](/merchant/api/client-libraries) to request\naccess to other Merchant Center accounts. Client libraries support user\nauthorization, which grants an application permission to access and manage\nMerchant Center account data.\n\nYou can also [use a service\naccount](/merchant/api/guides/authorization/access-your-account) to authorize\nAPI access to your own account. A service account is a special type of account\nthat belongs to an application instead of an individual end user. For more\ninformation, see [Service accounts overview](https://cloud.google.com/iam/docs/service-account-overview)."]]