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}"
}
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-08-08。
[null,null,["最后更新时间 (UTC):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 }"]]