Design note — Google Merchant Center connector (google_merchant_center)

Target registry item: C5 ("Merchant API vs Content API to verify"). Status: design note only — NOT built as a connector. Measured on 2026-10-12: the catalog row exists with wave: 2, available: false and zero fields; an adapter EXISTS (MerchantCenterAdapter, services/service-marketing-connectors/direct_connectors.py:958, API compatibility repair 2026-10-01) reading Merchant API Reports v1 (provider_versions.MERCHANT_REPORTS_VERSION = "v1", v1beta retired 2026-02-28) with required_env = ("GOOGLE_MERCHANT_ID",) and no vault_fields; since D11 the resolver reads the vault only, so with no vault field every tenant is refused merchant_credentials_not_configured before any provider call — the adapter is live code that no tenant can reach, honestly dark (checklist §5.6 last paragraph). CDoD points 1–14 are tracked in docs/reports/ONBOARDING_CONNECTORS_STATE.md.

Merchant API vs Content API — resolved by the vendor calendar

Content API for Shopping was sunset on 2026-08-18 with progressive errors from 2026-09-01 (fetched 2026-10-12). Merchant API Reports v1 is Active. The adapter already targets Merchant API; nothing is to be built on Content API, and the vendor-references section records the dates so the next reader does not re-open the question.

Auth

The adapter authenticates as the gateway's own runtime identity via ADC with the content scope (_google_access_token([".../auth/content"])) — the platform service account, not a per-tenant token. Merchant API v1 additionally works only after a one-time registerGcp of the calling Cloud project; the adapter never registers (it only reads developerRegistration after an access refusal, to say whether any project is registered). So the merchant-owned path is the GA4 / Search Console shape:

  1. Platform service account as a user on the merchant's Merchant Center account. The merchant adds the platform service account email under Merchant Center → Settings → People and access with a role that can read reports (which role is the minimum is verified at build, CDoD point 1). Merchant-owned account, merchant-granted access (D2/D11).
  2. OAuth (fallback). content scope through a platform OAuth client on Track O; shares the OB-GAP-1 consent-screen gate, so path 1 is preferred.

Vault-only per (tenant, provider); no environment fallback (GOOGLE_MERCHANT_ID is a process-global env NAME and must never serve a tenant — the resolver's docstring); vault error → 503; absent → merchant_credentials_not_configured; a merchant_id / account_id in a sync body is a confirmation against the declared one, never an override.

Fields (catalog row, when built)

key label secret required pattern help
merchant_id Merchant Center account ID no yes ^\d+$ The numeric account id shown top-right in Merchant Center. Also grant report access on the account to {service_account} (completed at catalog-serve time, the GA4 _with_runtime_help mechanism).

Wiring: MerchantCenterAdapter.vault_fields = {"merchant_id": "GOOGLE_MERCHANT_ID"} and vault_provider = "google_merchant_center", so the existing overlay path feeds the adapter from the vault and onboarding_supported becomes true. The service-account grant is a state: Test connection proves it.

Scopes

https://www.googleapis.com/auth/content — the Merchant API scope (write-capable; no read-only scope is known). Read-only is enforced by the adapter: only reports:search (and the one diagnostic developerRegistration GET) are called; no products, accounts or promotions write method is imported or constructed (rule-01 style test). The card help text says the grant covers more than the platform reads.

Data topics

product_performance (clicks, impressions, conversions, conversion value by product / date — Merchant Reports v1 views in MERCHANT_VIEWS), product catalog view (status, availability, price with micros converted once). All aggregate. The record contract is the one already in the adapter (record_type is the concept, provider in source_system).

topic posture
product performance rows de-personalised remainder; products, not people
product catalog rows configuration/catalog data

Posture test in the TestD3ProcessingPosture style pins that no emitted field is person-level.

Mapper target

Unchanged: MerchantCenterAdapter → CanonicalRecord (product_performance / feed_item) → gateway callback → canonical ingestion → mizoki_unified_data. No new store; this note adds one catalog field and one vault_fields map.

Failure modes → test-connection verdicts

Failure Verdict / fix
401/403 from Merchant API 503 merchant_access_not_configured (existing) carrying api_version: reports_v1 and the registration readout: gcp_ids empty → operator must registerGcp the platform project; non-empty → merchant must grant the service account on the account
Unknown view 422 unknown_merchant_view with supported (existing)
merchant_id not numeric 422 invalid_field_format
Vault read error 503 fail-closed
No vault entry merchant_credentials_not_configured (existing)

Flag

No new flag: the adapter is already unreachable per tenant until a vault entry exists, and the catalog row stays available: false (409 provider_not_available on any post) until the field is enumerated AND the adapter is live-verified against a real merchant-owned account with date and revision recorded (CDoD point 14; the checklist's standing rule for this provider). Flipping available is the gate.

Owner / operator gates

Vendor references

← All docsView source on GitHub →