Programs 子 API 總覽
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
透過計畫,您可以控管產品的宣傳活動,並在各項 Google 平台上提升帳戶功能。
這類服務的典型例子是免費產品資訊計畫,可讓你免費在 Google 各平台上顯示網路商店的產品。
透過 Programs 子 API,你可以擷取並更新參與所有可用的購物計畫。
如要擷取、啟用及停用程式,您可以使用下列方法:
列出所有節目
如要擷取帳戶的所有節目,請使用 accounts.programs.list
方法。
以下是要求範例:
HTTP
GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs
cURL
curl \
'https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
以下是成功要求的回應範例:
{
"programs": [
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
]
}
擷取單一節目
如要擷取特定節目,請使用 accounts.programs.get
方法。
以下是要求範例:
HTTP
GET https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs/free-listings
cURL
curl \
'https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs/free-listing?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
以下是成功要求的回應範例:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
啟用計畫
如要讓帳戶參與指定的計畫,請使用 accounts.programs.enable
方法。您必須具備管理員存取權,才能執行這項權限。
以下是要求範例:
HTTP
POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs/free-listings:enable
cURL
curl --request POST \
'https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs/free-listing:enable?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{}' \
--compressed
以下是成功要求的回應範例:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
停用計畫
如要停用帳戶參與指定計畫的功能,請使用 accounts.programs.disable
方法。您必須具備管理員存取權,才能執行這項權限。
以下是要求範例:
HTTP
POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs/free-listings:disable
cURL
curl --request POST \
'https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/programs/free-listing:disable?key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{}' \
--compressed
以下是成功要求的回應範例:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}"
}
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-08-08 (世界標準時間)。
[null,null,["上次更新時間:2025-08-08 (世界標準時間)。"],[[["\u003cp\u003ePrograms allow users to manage the promotion of their products and enhance account features across Google.\u003c/p\u003e\n"],["\u003cp\u003eThe Programs API enables the retrieval and modification of participation in all available shopping programs.\u003c/p\u003e\n"],["\u003cp\u003eUsers can retrieve all programs for an account using the \u003ccode\u003eaccounts.programs.list\u003c/code\u003e method, with example requests and responses provided.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eaccounts.programs.get\u003c/code\u003e, \u003ccode\u003eaccounts.programs.enable\u003c/code\u003e, and \u003ccode\u003eaccounts.programs.disable\u003c/code\u003e methods can be used to manage specific programs, such as enabling or disabling free product listings.\u003c/p\u003e\n"],["\u003cp\u003eEnabling or disabling programs requires administrator access, as detailed in the provided documentation.\u003c/p\u003e\n"]]],["Programs API manages participation in Google shopping programs, like free product listings, to enhance product promotion across Google. You can retrieve, enable, and disable these programs using specific API methods. `accounts.programs.list` retrieves all programs; `accounts.programs.get` retrieves a single program. The methods `accounts.programs.enable` and `accounts.programs.disable` allow for enabling or disabling program participation, respectively. These actions require administrator access, and successful requests return program details, including state and unmet requirements.\n"],null,["# Overview of Programs sub-API\n\nPrograms let you control the\n[promotion of your products](https://www.google.com/retail/) and enhance the\nfeatures of your account across various Google surfaces.\n\nA typical example of this is the [free product listings](//support.google.com/merchants/topic/15190028)\nprogram, which enables products from your online store to be shown across\nGoogle with no charge.\n\nPrograms sub-API lets you retrieve and update your participation in all\navailable shopping programs.\n\nTo retrieve, enable, and disable programs, you can use the following methods:\n\n- [`accounts.programs.list`](#list)\n- [`accounts.programs.get`](#get)\n- [`accounts.programs.enable`](#enable)\n- [`accounts.programs.disable`](#disable)\n\nList all programs\n-----------------\n\nTo retrieve all programs for the account, use the [`accounts.programs.list`](/merchant/api/reference/rest/accounts_v1/accounts.programs/list)\nmethod.\n\nHere's a sample request: \n\n### HTTP\n\n GET https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs\n\n### cURL\n\n curl \\\n 'https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs?key=[YOUR_API_KEY]' \\\n --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \\\n --header 'Accept: application/json' \\\n --compressed\n\nHere's a sample response from a successful request: \n\n {\n \"programs\": [\n {\n \"name\": \"accounts/\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listings\",\n \"documentationUri\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{URI}\u003c/var\u003e\",\n \"state\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_STATE}\u003c/var\u003e\",\n \"unmetRequirements\": [\n {\n \"title\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{TITLE}\u003c/var\u003e\",\n \"documentationUri\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{URI}\u003c/var\u003e\",\n \"affectedRegionCodes\": [\n \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{REGION_CODE}\u003c/var\u003e\"\n ]\n }\n ]\n }\n ]\n }\n\nRetrieve a single program\n-------------------------\n\nTo retrieve a specific program, use the [`accounts.programs.get`](/merchant/api/reference/rest/accounts_v1/accounts.programs/get)\nmethod.\n\nHere's a sample request: \n\n### HTTP\n\n GET https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listings\n\n### cURL\n\n curl \\\n 'https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listing?key=[YOUR_API_KEY]' \\\n --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \\\n --header 'Accept: application/json' \\\n --compressed\n\nHere's a sample response from a successful request: \n\n {\n \"name\": \"accounts/\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listings\",\n \"documentationUri\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{URI}\u003c/var\u003e\",\n \"state\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_STATE}\u003c/var\u003e\",\n \"unmetRequirements\": [\n {\n \"title\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{TITLE}\u003c/var\u003e\",\n \"documentationUri\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{URI}\u003c/var\u003e\",\n \"affectedRegionCodes\": [\n \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{REGION_CODE}\u003c/var\u003e\"\n ]\n }\n ]\n }\n\nEnable a program\n----------------\n\nTo enable participation in the specified program for the account, use the [`accounts.programs.enable`](/merchant/api/reference/rest/accounts_v1/accounts.programs/enable)\nmethod. You must have [administrator access](/merchant/api/guides/accounts/control-access)\nto run this permission.\n\nHere's a sample request: \n\n### HTTP\n\n POST https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listings:enable\n\n### cURL\n\n curl --request POST \\\n 'https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listing:enable?key=[YOUR_API_KEY]' \\\n --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \\\n --header 'Accept: application/json' \\\n --header 'Content-Type: application/json' \\\n --data '{}' \\\n --compressed\n\nHere's a sample response from a successful request: \n\n {\n \"name\": \"accounts/\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listings\",\n \"documentationUri\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{URI}\u003c/var\u003e\",\n \"state\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_STATE}\u003c/var\u003e\",\n \"unmetRequirements\": [\n {\n \"title\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{TITLE}\u003c/var\u003e\",\n \"documentationUri\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{URI}\u003c/var\u003e\",\n \"affectedRegionCodes\": [\n \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{REGION_CODE}\u003c/var\u003e\"\n ]\n }\n ]\n }\n\nDisable a program\n-----------------\n\nTo disable participation in the specified program for the account, use the [`accounts.programs.disable`](/merchant/api/reference/rest/accounts_v1/accounts.programs/disable)\nmethod. You must have [administrator access](/merchant/api/guides/accounts/control-access)\nto run this permission.\n\nHere's a sample request: \n\n### HTTP\n\n POST https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listings:disable\n\n### cURL\n\n curl --request POST \\\n 'https://merchantapi.googleapis.com/accounts/v1/accounts/\u003cvar translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listing:disable?key=[YOUR_API_KEY]' \\\n --header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \\\n --header 'Accept: application/json' \\\n --header 'Content-Type: application/json' \\\n --data '{}' \\\n --compressed\n\nHere's a sample response from a successful request: \n\n {\n \"name\": \"accounts/\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_ID}\u003c/var\u003e/programs/free-listings\",\n \"documentationUri\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{URI}\u003c/var\u003e\",\n \"state\": \"\u003cvar class=\"readonly\" translate=\"no\"\u003e{ACCOUNT_STATE}\u003c/var\u003e\"\n }"]]