Skip to content

fix(products): use productAttributes for Merchant API v1 (was attributes)#89

Merged
yasserstudio merged 1 commit into
mainfrom
fix/v1.0.11-product-attributes
Jun 13, 2026
Merged

fix(products): use productAttributes for Merchant API v1 (was attributes)#89
yasserstudio merged 1 commit into
mainfrom
fix/v1.0.11-product-attributes

Conversation

@yasserstudio

Copy link
Copy Markdown
Owner

Critical fix found by the first live API test. Merchant API v1 renamed the product attributes field attributesproductAttributes (for both processed products and product inputs). gmc still used attributes, so against the live API:

  • products list / get rendered blank titles, prices, and availability;
  • products insert failed outright with 400 INVALID_ARGUMENT: Unknown name "attributes";
  • feeds, migrate products, and preflight --remote were all affected.

The whole test suite mocks fetch, so nothing exercised a real response — the same blind spot that hid the v1beta shutdown.

Changes

  • Rename attributesproductAttributes on Product/ProductInput and every consumer: CLI renderers, toProductInput, the preflight rules (_util/format/policy/required), and the migrate transform output. Suggestion strings + docs updated to match.
  • ItemLevelIssue → real v1 shape: severity / reportingContext / applicableCountries (dropping v1beta servability / destination / attribute); disapproval count now keys on severity === "DISAPPROVED".
  • New contract test (api/tests/products.test.ts): a recorded-shape v1 product response that locks the field names at compile + runtime, so a future rename fails CI instead of shipping silently.
  • gmc issues severity doc fix: the live renderaccountissues value is ERROR, not the v1beta DISAPPROVED/DEMOTED/NOT_IMPACTED.

Promotions (its own attributes) and accounts (identity attributes) are deliberately untouched.

Verification

  • Build / lint / format / all tests green (+ the new contract test and a CLI disapproval-count render test).
  • Live-verified against a real Merchant Center account: products list now shows real titles + N disapproved / M issue(s) counts, and products insert succeeds. Three-agent review: 0 critical, rename complete, no over-reach.

Ships as v1.0.11. Changeset bumps @gmc-cli/{api,cli,preflight,migrate} (patch).

…tes)

Merchant API v1 renamed the product attributes field from `attributes` to
`productAttributes` (processed products and product inputs alike). gmc still
sent/read `attributes`, so against the live API `products list`/`get` showed
blank titles and `products insert` failed with
`400 INVALID_ARGUMENT: Unknown name "attributes"`. This also affected `feeds`,
`migrate products`, and `preflight --remote`.

- Rename the field on Product/ProductInput and every read/write site (CLI
  renderers, toProductInput, feeds, preflight rules, migrate transform).
- Fix ItemLevelIssue to the real v1 shape (severity / reportingContext /
  applicableCountries; drop v1beta servability / destination / attribute) and
  base the disapproval count on `severity === "DISAPPROVED"`.
- Add a recorded-shape v1 contract test so a future field rename fails CI.
- Correct the `gmc issues` severity docs (live value is ERROR).

Promotions (its own attributes) and accounts (identity attributes) are
unchanged. Verified against a live Merchant Center account: products list shows
titles, insert succeeds.
@yasserstudio yasserstudio merged commit 6c353d4 into main Jun 13, 2026
7 checks passed
@yasserstudio yasserstudio deleted the fix/v1.0.11-product-attributes branch June 13, 2026 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant