Programy umożliwiają kontrolowanie promocji produktów i ulepszanie funkcji konta w różnych przestrzeniach Google.
Typowym przykładem jest program bezpłatnych informacji o produktach, który umożliwia bezpłatne wyświetlanie produktów z Twojego sklepu internetowego w usługach Google.
Interfejs API podrzędny programów umożliwia pobieranie i aktualizowanie informacji o Twoim udziale we wszystkich dostępnych programach zakupowych.
Aby pobierać, włączać i wyłączać programy, możesz użyć tych metod:
Wyświetlanie wszystkich programów
Aby pobrać wszystkie programy dla konta, użyj
accounts.programs.list
metody.
Oto przykładowa treść wiadomości:
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
Oto przykładowa odpowiedź na prawidłowe żądanie:
{
"programs": [
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
]
}
Pobieranie pojedynczego programu
Aby pobrać konkretny program, użyj accounts.programs.get
metody.
Oto przykładowa treść wiadomości:
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
Oto przykładowa odpowiedź na prawidłowe żądanie:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
Włączanie programu
Aby włączyć udział konta w określonym programie, użyj
accounts.programs.enable
metody. Aby uruchomić to uprawnienie, musisz mieć dostęp administratora.
Oto przykładowa treść wiadomości:
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
Oto przykładowa odpowiedź na prawidłowe żądanie:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}",
"unmetRequirements": [
{
"title": "{TITLE}",
"documentationUri": "{URI}",
"affectedRegionCodes": [
"{REGION_CODE}"
]
}
]
}
Wyłączanie programu
Aby wyłączyć udział konta w określonym programie, użyj accounts.programs.disable
metody. Aby uruchomić to uprawnienie, musisz mieć dostęp administratora.
Oto przykładowa treść wiadomości:
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
Oto przykładowa odpowiedź na prawidłowe żądanie:
{
"name": "accounts/{ACCOUNT_ID}/programs/free-listings",
"documentationUri": "{URI}",
"state": "{ACCOUNT_STATE}"
}