AI-generated Key Takeaways
-
Programs allow users to manage the promotion of their products and enhance account features across Google.
-
The Programs API enables the retrieval and modification of participation in all available shopping programs.
-
Users can retrieve all programs for an account using the
accounts.programs.list
method, with example requests and responses provided. -
The
accounts.programs.get
,accounts.programs.enable
, andaccounts.programs.disable
methods can be used to manage specific programs, such as enabling or disabling free product listings. -
Enabling or disabling programs requires administrator access, as detailed in the provided documentation.
Programs let you control the promotion of your products and enhance the features of your account across various Google surfaces.
A typical example of this is the free product listings program, which enables products from your online store to be shown across Google with no charge.
Programs sub-API lets you retrieve and update your participation in all available shopping programs.
To retrieve, enable, and disable programs, you can use the following methods:
List all programs
To retrieve all programs for the account, use the accounts.programs.list
method.
Here's a sample request:
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
Here's a sample response from a successful request:
{
"programs": [
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
]
}
Retrieve a single program
To retrieve a specific program, use the accounts.programs.get
method.
Here's a sample request:
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
Here's a sample response from a successful request:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
Enable a program
To enable participation in the specified program for the account, use the accounts.programs.enable
method. You must have administrator access
to run this permission.
Here's a sample request:
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
Here's a sample response from a successful request:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
Disable a program
To disable participation in the specified program for the account, use the accounts.programs.disable
method. You must have administrator access
to run this permission.
Here's a sample request:
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
Here's a sample response from a successful request:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}"
}