Google Merchant Center API integration with managed OAuth. Manage products, inventories, data sources, promotions, and reports for Google Shopping.
Use this skill when users want to manage their Merchant Center product catalog, check product status, configure data sources, or analyze shopping performance.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Requires network access and valid Maton API key.
Google Merchant Center API integration with managed OAuth. Manage products, inventories, data sources, promotions, and reports for Google Shopping.
Use this skill when users want to manage their Merchant Center product catalog, check product status, configure data sources, or analyze shopping performance.
For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway).
Requires network access and valid Maton API key.
Google Merchant Center
Access the Google Merchant Center API with managed OAuth authentication. Manage products, inventories, promotions, data sources, and reports for Google Shopping.
Quick Start
# List products in your Merchant Center account
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/google-merchant/products/v1/accounts/{accountId}/products')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
print(json.dumps(json.load(urllib.request.urlopen(req)), indent=2))
EOF
Look at the URL - it contains your account ID: https://merchants.google.com/mc/overview?a=ACCOUNT_ID
Developer Registration
Important: Before using the v1 API, you must complete a one-time developer registration to associate your account with the API.
Step 1: Get Your Account ID
Option A: Try fetching via API first
Try listing accounts using the v1beta endpoint. If this works, you can get your account ID automatically:
python <<'EOF'
import urllib.request, os, json
req = urllib.request.Request('https://gateway.maton.ai/google-merchant/accounts/v1beta/accounts')
req.add_header('Authorization', f'Bearer {os.environ["MATON_API_KEY"]}')
try:
result = json.load(urllib.request.urlopen(req))
for account in result.get('accounts', []):
print(f"Account ID: {account['accountId']}, Name: {account['accountName']}")
except Exception as e:
print(f"v1beta not available - use Option B to get your account ID manually")
EOF
Option B: From Merchant Center UI (if Option A fails)
If the v1beta endpoint is unavailable or returns an error:
GET /google-merchant/inventories/v1/accounts/{accountId}/products/{productId}/localInventories
Note: Local inventories are only available for products with LOCAL channel. Use a product ID like local~en~US~sku123.
Insert Local Inventory
POST /google-merchant/inventories/v1/accounts/{accountId}/products/{productId}/localInventories:insert
Content-Type: application/json
{
"storeCode": "store123"
}
Note: The storeCode must be a valid store code configured in your Merchant Center account. Additional inventory attributes may be available - refer to the Google Merchant API Reference for the complete field list.
List Regional Inventories
GET /google-merchant/inventories/v1/accounts/{accountId}/products/{productId}/regionalInventories
Data Sources
List Data Sources
GET /google-merchant/datasources/v1/accounts/{accountId}/dataSources
Get Data Source
GET /google-merchant/datasources/v1/accounts/{accountId}/dataSources/{dataSourceId}
Create Data Source
POST /google-merchant/datasources/v1/accounts/{accountId}/dataSources
Content-Type: application/json
{
"displayName": "API Data Source",
"primaryProductDataSource": {
"feedLabel": "US",
"contentLanguage": "en"
}
}
Response:
{"name":"accounts/123456/dataSources/789","dataSourceId":"789","displayName":"API Data Source","primaryProductDataSource":{"feedLabel":"US","contentLanguage":"en"},"input":"API"}
POST /google-merchant/datasources/v1/accounts/{accountId}/dataSources/{dataSourceId}:fetch
Note: Fetch only works for data sources with FILE input type. API and UI data sources cannot be fetched.
Reports
Search Reports
POST /google-merchant/reports/v1/accounts/{accountId}/reports:search
Content-Type: application/json
{
"query": "SELECT offer_id, title, clicks, impressions FROM product_performance_view WHERE date BETWEEN '2026-01-01' AND '2026-01-31'"
}
Example: Query product_view (requires id field):
{"query":"SELECT id, offer_id, title, item_issues FROM product_view LIMIT 10"}
Note: The product_view table requires the id field in the SELECT clause.
Available report tables:
product_performance_view - Clicks, impressions, CTR by product
product_view - Current inventory with attributes and issues (requires id in SELECT)
price_competitiveness_product_view - Pricing vs competitors (requires Market Insights)
price_insights_product_view - Suggested pricing
best_sellers_product_cluster_view - Best sellers by category (requires Market Insights)
Note: You must specify either allManagedAccounts: true OR targetAccount: "accounts/{accountId}" to indicate which accounts the subscription applies to.
import os
import requests
account_id = '123456789'
response = requests.get(
f'https://gateway.maton.ai/google-merchant/products/v1/accounts/{account_id}/products',
headers={'Authorization': f'Bearer {os.environ["MATON_API_KEY"]}'}
)
data = response.json()
Notes
Developer registration required - You must complete Developer Registration once per Merchant Center account before using v1 endpoints
Product IDs use the format contentLanguage~feedLabel~offerId (e.g., en~US~sku123)
Products can only be inserted/updated/deleted in data sources with input: "API" type
After inserting/updating a product, it may take several minutes before the processed product appears
Monetary values use micros (divide by 1,000,000 for actual value)
Local inventories only work for products with LOCAL channel (not ONLINE)
The Promotions API requires your account to be enrolled in the Promotions program
List Sub-accounts only works for multi-client accounts (MCAs)
IMPORTANT: When using curl commands, use curl -g when URLs contain brackets to disable glob parsing
IMPORTANT: When piping curl output to jq or other commands, environment variables like $MATON_API_KEY may not expand correctly in some shell environments
Error Handling
Status
Meaning
400
Invalid request or missing Google Merchant connection
401
Invalid/missing Maton API key, or GCP project not registered (see Developer Registration)
403
Permission denied - account not enrolled in required program or feature not available
404
Resource not found
429
Rate limited
4xx/5xx
Passthrough error from Google Merchant API
Common Errors
"GCP project is not registered": You need to complete developer registration. See Developer Registration section.
"The caller does not have access to the accounts": The specified account ID is not accessible with your OAuth credentials. Verify you have access to the Merchant Center account.
"Promotion program not enabled": Your Merchant Center account is not enrolled in the Promotions program. Enable it in Merchant Center settings.
"This method can only be accessed by multi-client accounts": You're calling an endpoint (like listSubaccounts) that only works for multi-client accounts (MCAs).
"Mismatched channel": You're trying to access local inventories for an ONLINE product. Local inventories only work with LOCAL channel products.
Troubleshooting: API Key Issues
Check that the MATON_API_KEY environment variable is set:
echo$MATON_API_KEY
Verify the API key is valid by listing connections: