Installation Guide for Google Content API in Opencart3.0

Module name in the admin panel: Google Merchant API (by Pinta Webware).

1. What changed at Google (read first)

ℹ️Note: Google's Content API for Shopping has been shut down. This module already works only with the Merchant API: none of its versions (OpenCart 2.3, 3.0, 4.x) calls the old Content API. You do not need to replace the module because of the shutdown.
Google's Content API for Shopping (v2.1) was sunset on August 18, 2026. Since September 1, 2026, its requests return progressive errors. Its replacement is the Merchant API (https://merchantapi.googleapis.com). Source: https://developers.google.com/merchant/api/guides/compatibility/overview.
What the Merchant API requires from you, and what this module does about it:
  • The Merchant Center account must be linked to your Google Cloud project ("developer registration"). The module has a Register as Developer button for this (OpenCart 3.0 and 4.x only; see "Developer registration").
  • Products are written into a Merchant Center data source of input type "API" (primary or supplemental). The module needs its numeric Data Source ID, or finds one in your account (see "Data source").
  • Prices are sent as amountMicros plus currencyCode, product ids use the form contentLanguage~feedLabel~offerId. The module does this for you; there is nothing to configure.
  • There is no batch endpoint. The module sends products one request per product (OpenCart 3.0 sends them in concurrent chunks).
Google's help center states that a product expires from Merchant Center 30 days after its last refresh unless it is refreshed. See "Syncing products".

2. Requirements

A Google Merchant Center account whose website is verified and claimed (Merchant Center > Business info / Website). Google requires this to show your products.
A Google Cloud project (free).
A Google account that has access to the Merchant Center account.
HTTPS storefront strongly recommended (the OAuth redirect URI is built from your store URL).
PHP cURL enabled (the module calls Google with cURL).

OpenCart versions and package files:

OpenCart 2.3.x - archive content-api_2.3.ocmod.zip. Older feature set: no Register as Developer button, no Detect / Create data source buttons.
OpenCart 3.0.x - archive content-api_3.0php7.3.ocmod.zip. Newest feature set; the archive name mentions PHP 7.3.
OpenCart 4.0.x and 4.1.x - archive ContentApi.ocmod.zip. One unified build; OpenCart 4 itself needs PHP 8.

Use the PHP version officially supported by your OpenCart release.

⚠️Note: Do not rename the 4.x archive ContentApi.ocmod.zip. Its file name determines the extension code, and a renamed file gives 404 on every module page.

3. Install or upgrade the module

1
In the OpenCart admin open Extensions (1) > Installer (2), upload the zip for your OpenCart version, and click Install on the uploaded entry.
2
Open Extensions > Extensions, choose the Modules type, find Google Merchant API, click Install (green plus), then Edit (pencil).
  • OpenCart 4: the module lives under the extension code ContentApi; the settings page title is "Edit Google Merchant API Module".
3
If your account group has no permission to the module, grant it in System > Users > User Groups (Access and Modify permission for the module). Without it the page shows "Warning: You do not have permission to modify Google Merchant API!".
4
Upgrading over an older version: upload the new zip over the old one and open the module settings once. Your saved settings stay in the database. See "Upgrading from an older version" for what to redo.

4. Google Cloud project and OAuth client

1
Open https://console.cloud.google.com and create (or pick) a project.
2
APIs and services > Library: search "Merchant API" and click Enable. If you skip this, sync fails with 403 SERVICE_DISABLED (see "Troubleshooting").
3
APIs and services > OAuth consent screen: configure it (External, add your Google account as a test user while the app is in Testing mode). If the consent screen lists scopes explicitly, add this one scope: https://www.googleapis.com/auth/content. The module requests only this scope.
4
APIs and services > Credentials > Create credentials > OAuth client ID, application type "Web application".
5
Under Authorized redirect URIs paste the URL the module shows. Do not type it from memory; copy it from the module settings page:
  • OpenCart 4.x: label "Authorized redirect URI:" (there is also a copy button). Format: https://YOUR-STORE/index.php?route=extension/ContentApi/module/google_merchant_api&language=XX&store_id=N
  • OpenCart 3.0: label "OAuth redirect URI". Format: https://YOUR-STORE/index.php?route=extension/module/google_merchant_api
  • OpenCart 2.3: the same format as in 3.0; the 2.3 form does not display it with a label, so use the URL shown in Google's redirect_uri_mismatch error message if needed.
6
Create the client and click Download JSON.
⚠️Note: The redirect URI must match character for character (http vs https, trailing parts).

5. Merchant Center account

1
Make sure you can sign in to Merchant Center with the same Google account you will use to connect the module.
2
Note your Merchant Center ID (the number in the top-right of Merchant Center, 7 to 26 digits; the module rejects other formats).
3
The account's website must be verified and claimed in Merchant Center, otherwise Google will not show your products.

6. Connect the module to Google (OAuth)

1
Open the module settings (Extensions > Extensions > Modules > Google Merchant API > Edit).
2
Next to Upload json file click the upload button and choose the client JSON downloaded in the previous section. The page then shows "client_secret.json is uploaded!" (red text "client_secret.json is not uploaded!" means it is missing).
3
Fill Merchant id with your Merchant Center ID (OpenCart 3.0 labels it "Merchant id" too).
4
Click the Login button. Google's consent screen opens; sign in and allow access. You return to the module settings page and the fields Your Access Token and Your Access Code are filled. Access tokens last about one hour; the module refreshes them with the stored refresh token (OpenCart 3.0 and 4.x).
5
Clicking Login again makes the module discard the stored token and send you through the consent screen again. Use this to re-authorize.
6
Multi-store: OpenCart 4 keeps one token file per store (token_store_N.json) and the settings page URL carries store_id; OpenCart 3.0 has a store selector on the settings page. Connect each store separately.

7. Developer registration (required by the Merchant API)

Google requires linking your Cloud project to the Merchant Center account before Merchant API calls work.

OpenCart 3.0 and 4.x:

1
In the settings fill Developer Email (an email address, e.g. yours). Click the Save button (top right) first so the email is stored.
2
Click Register as Developer. The module calls developerRegistration:registerGcp (the Cloud project is taken from your OAuth token) and then gives that email the roles ADMIN and API_DEVELOPER on the Merchant account.
3
Success message: "Developer <email> registered and granted the API_DEVELOPER role." If the project was registered earlier, this is treated as success.
4
Errors you may see: "Enter a valid developer email before registering.", "Failed to register the GCP developer.", "Failed to assign the API_DEVELOPER role." followed by the HTTP code and Google's message.
⚠️Note: Google's rule (from its documentation): add at least one backup API developer; if the last API_DEVELOPER user is removed, API calls are blocked after a 30-day grace period.

OpenCart 2.3: the module has no such button. Register once by calling the registerGcp method yourself (Google's "Register as a developer" quickstart: POST https://merchantapi.googleapis.com/accounts/v1/accounts/{ACCOUNT_ID}/developerRegistration:registerGcp with {"developerEmail": "..."}), or temporarily use a 3.0/4.x store with the same Cloud project and Merchant account.

8. Data source

Products must be inserted into a Merchant Center data source of type API (primary or supplemental). Create one in Merchant Center (Data sources > Add product source > API / "Content API" style source), or let the module create it (OpenCart 3.0 only).

OpenCart 3.0 ("Data source ID" field, digits only, up to 32):
  • Detect data sources lists the account's sources into a drop-down ("- select a data source -"); pick one and its id fills the field.
  • Create product data source creates a new primary product data source using the selected Target Country and Content Language, and fills the id.
  • If left empty, the sync auto-detects a primary/supplemental product source; if none exists it shows "No data source set and none found in the account - click Detect or Create to pick or create one."
OpenCart 4.x ("Data Source ID" field, required, digits only): there are no Detect/Create buttons. Enter the numeric id of an existing API data source (it is the last number of accounts/{merchantId}/dataSources/{id}; open your API data source in Merchant Center > Data sources to see it).
OpenCart 2.3 ("Source ID"): enter the numeric id manually.
⚠️Note: Guessing an id gives "Data source with id N was not found." on every insert.

9. Settings of the module

OpenCart 4.x settings page (OpenCart 3.0 is the same unless noted):

Content Language - store language whose product names/descriptions are sent.
Currency - the currency prices are sent in.
Target Country - required. It is also used as the Feed Label (default when no separate feed label is saved).
Merchant id; Developer Email and the Register as Developer button; Data Source ID.
Category Status - "If enabled it takes your categories, if disabled products are categorized by Google Merchant Center".
Taxes - "price after taxes".
Prefix offer Id - prefix added before the product id in the Merchant offer id (example in the module: yourstore.com_{product_id}). It also limits which remote offers the module treats as its own.
Upload json file; redirect URI; Login button; Your Access Token; Your Access Code.
Cron URLs (see "Syncing products").
Trigger add Product / Trigger edit product / Trigger delete product - when on, adding, editing or deleting a product in OpenCart sends the change to Merchant Center immediately. (OpenCart 3.0 shows these as Enabled/Disabled drop-downs.)
Buttons: Load Products, Delete all Products, Clear logs, and a collapsible "logs" panel.
OpenCart 4.x: Create Feed and a feed table (Feed Name, Merchant ID, Country, Status, Action: Edit Feed, Export Feed, Delete Feed) for extra feeds with their own settings. OpenCart 3.0: feeds page with Add / Edit / Delete / "Export to Merchant".

Fields the module sends for each product: title, description (HTML stripped), link, image link, additional images, availability (in stock if quantity above 0, else out of stock), condition NEW, price (and sale price when a special price is lower), brand (manufacturer), GTIN, MPN (model), and category when Category Status is on. Only enabled products are sent.

ℹ️Note: Anything else (shipping, tax rules, identifiers you want to supply) is not mapped by the module and must be set in Merchant Center.

10. Syncing products

Manual:

1
Save the settings, make sure the token is present and the data source is set.
2
Click Load Products. Message example: "Success! New: X. Updated: Y. Already in Merchant Center: Z." (OpenCart 4). OpenCart 3.0 shows a progress bar ("Sent: X of Y"), a Stop sync button, and a "Last sync" summary.
3
Unchanged products are skipped to save requests. Merchant Center may take some time to show changes.

Delete all Products (the red button) removes the module's products from Merchant Center; confirm your intent first.

Automatic (cron): the page shows the real URL; copy it. Cron URL formats:

OpenCart 4.x: https://YOUR-STORE/index.php?route=extension/ContentApi/module/google_merchant_api|loadProducts&store_id=N&language=XX (label "Synchronization cron URL:"). It carries no secret key, so keep the URL private. Run it with e.g. curl from the server cron.
OpenCart 3.0: https://YOUR-STORE/index.php?route=extension/module/google_merchant_api/cronLoadProducts&store_id=N&secret_key=SECRET (label "Cron URL (scheduled sync)"); add &force=1 to resend every product, ignoring the unchanged cache.
OpenCart 2.3: ...index.php?route=extension/module/google_merchant_api/cronLoadProducts&<admin token>&store_id=N&secret_key=SECRET (label "Cron / Browser export URL").
⚠️Note: Product expiry: Google removes a product 30 days after its last refresh. The module skips unchanged products, so a product you never edit may not be re-sent. To be safe, run a full re-send at least every 3 weeks. On OpenCart 3.0 call the cron URL with &force=1; on 4.x and 2.3 there is no force option, so use Delete all Products followed by Load Products, or check in Merchant Center that products stay active after 30 days.

11. Upgrading from an older version / after the Content API sunset

Nothing needs to be migrated because of the shutdown: the module never used the old API.
If you installed a build older than 1.1.5: reconnect the Google account. Older builds asked for the wrong scope (cloud-platform); every call failed with 403 "Request had insufficient authentication scopes". A stored token keeps its old scope, so refreshing does not help. Open the module settings, click Login and accept the consent screen again. Add https://www.googleapis.com/auth/content to the consent screen scopes if you listed scopes there.
Register as developer (see "Developer registration") if you never did; it is a Merchant API requirement.
Create or pick an API data source (see "Data source"); the old Content API data feeds are not used.
Then click Load Products once and verify in Merchant Center > Products.

12. Troubleshooting

410 with error `content_api_sunset` - this module does not produce it. It comes from a different tool still using the old Content API. This module uses the Merchant API only.
401 "invalid authentication credentials" / "No token!" - token missing or expired. Click Login and re-authorize. OpenCart 3.0 shows "Google authorization has expired or is missing. Please reconnect your Google account...".
403 "Request had insufficient authentication scopes" - the token has the wrong scope (builds before 1.1.5). Update the module and click Login again.
403 `SERVICE_DISABLED` - the Merchant API is not enabled in your Google Cloud project: enable it (see "Google Cloud project and OAuth client", step 2). No reconnect needed.
401/403 saying the account/project is not registered, or "Failed to register the GCP developer." - run Register as Developer (see "Developer registration").
"Data source with id N was not found." / "Data source not found. Set data_source_id or data_source_name." - wrong or empty Data Source ID. Use an existing API data source (see "Data source").
"Merchant sync is not ready. Select target country, enter Merchant ID and Data Source ID, and authorize the token." - a required field is empty (OpenCart 4).
"Merchant ID must contain only digits and be between 7 and 26 characters." - wrong Merchant ID format.
`redirect_uri_mismatch` on Google's page - the redirect URI in Google Cloud does not match the one shown by the module exactly.
"client_secret.json is not uploaded!" - upload the OAuth client JSON (see "Connect the module to Google (OAuth)").
Module page 404 on OpenCart 4 - the zip was renamed before install. Reinstall with the original file name ContentApi.ocmod.zip.
"No products to load" - no enabled products for the chosen Content Language.
Products show "Needs update" / disapproved in Merchant Center - this is Google's quality review, not a module error. Typical causes: missing GTIN/brand, price or availability mismatch with the product page, unclaimed website, missing shipping/tax settings in Merchant Center. Fix the product data or Merchant Center settings and re-send. Specific reasons are not shown by the module.
Products disappear after about 30 days - expiry; see "Syncing products".
Sync errors with details - open the "logs" panel on the module page (Clear logs empties it); real Google error codes are logged.
Chat
Bot Support Team

Hello! How can I assist you today with product selection?