Skip to content

[2026-04] Storefront & Customer Account API version update#3651

Merged
itsjustriley merged 4 commits intomainfrom
2026-04-sfapi-caapi-update
Apr 9, 2026
Merged

[2026-04] Storefront & Customer Account API version update#3651
itsjustriley merged 4 commits intomainfrom
2026-04-sfapi-caapi-update

Conversation

@itsjustriley
Copy link
Copy Markdown
Contributor

Summary

Updated Storefront API and Customer Account API from version 2026-01 to 2026-04 for the Hydrogen 2026.4 release.

Part of https://github.com/Shopify/developer-tools-team/issues/1178.

API Changes Overview

Change Type API Priority Issue Status
JSON metafield values limited to 128KB Breaking API Change SFAPI + CAAPI P1 Shopify/developer-tools-team#1189 No code changes needed
New MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR cart error code Update SFAPI P2 Shopify/developer-tools-team#1190 Types regenerated

JSON metafield 128KB limit

  • Impact: JSON type metafield writes limited to 128KB for new apps (grandfathered for existing apps)
  • Hydrogen impact: Hydrogen's cartMetafieldsSet is a passthrough — no code changes needed, but documented in changeset for merchant awareness
  • Reads unaffected: Large metafield values continue to be readable by all API versions

New cart error code

  • Impact: MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR replaces generic INVALID for Cart Transform Function failures
  • Hydrogen impact: Already included in regenerated types. Hydrogen passes cart errors through without per-code handling

Changes Made

  • Updated version constants in 3 files (storefront-api-constants.ts, customer/constants.ts, codegen.ts)
  • Regenerated GraphQL types and schemas from 2026-04 API endpoints
  • Updated all hardcoded 2026-01 version references in JSDoc comments, doc files, tests, stories, and examples (33 files)
  • Built all packages and verified typecheck passes
  • Regenerated skeleton template types (no output changes — 2026-04 schema is compatible with existing queries)

Validation Status

Test plan

  • npm run typecheck passes
  • npm run lint passes
  • npm run test passes (except pre-existing init.test.ts failure)
  • npm run build:pkg succeeds
  • Skeleton codegen succeeds
  • E2E tests (CI)

🤖 Generated with Claude Code

@shopify
Copy link
Copy Markdown
Contributor

shopify bot commented Apr 1, 2026

Oxygen deployed a preview of your 2026-04-sfapi-caapi-update branch. Details:

Storefront Status Preview link Deployment details Last update (UTC)
Skeleton (skeleton.hydrogen.shop) ✅ Successful (Logs) Preview deployment Inspect deployment April 9, 2026 4:13 PM

Learn more about Hydrogen's GitHub integration.

@itsjustriley itsjustriley force-pushed the 2026-04-sfapi-caapi-update branch from 7d65a9d to 1eaa732 Compare April 1, 2026 14:34
@itsjustriley itsjustriley marked this pull request as ready for review April 1, 2026 17:04
@itsjustriley itsjustriley requested a review from a team as a code owner April 1, 2026 17:04
@itsjustriley itsjustriley requested a review from fredericoo April 7, 2026 15:09
itsjustriley and others added 4 commits April 9, 2026 12:11
Update Storefront API and Customer Account API from 2026-01 to 2026-04.

Why: Quarterly API version update for the Hydrogen 2026.4 release.
The 2026-04 API version introduces:
- JSON metafield write size limit (128KB for new apps)
- New MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR cart error code

How: Updated version constants in 3 files, regenerated GraphQL types
and schemas from the new API endpoints, updated all hardcoded version
references in JSDoc comments, doc files, tests, stories, and examples.

No breaking schema changes affect Hydrogen's queries — skeleton codegen
produces identical output.

Tracking issues: Shopify/developer-tools-team#1189, #1190
Parent issue: Shopify/developer-tools-team#1178

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Per CLAUDE.md bundling chain rules, any skeleton bump requires
bumping cli-hydrogen AND create-hydrogen. The 2026-01 API update
precedent (commit d46c886) confirms this pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…trings

Changeset paragraphs clarified to be accurate for merchant-facing docs:
- 128KB metafield limit: explicitly states the limit is enforced by the
  Storefront API, not Hydrogen, to prevent merchants from filing bugs
  against Hydrogen for API-level behaviour
- MERCHANDISE_LINE_TRANSFORMERS_RUN_ERROR: reworded to avoid internal
  Shopify jargon ("Cart Transform Function") and added actionability
  ("you may want to add handling for this new code")

Test files: replaced hardcoded '2026-04' version strings with SFAPI_VERSION
constant in assertions that verify SDK-reported version. This prevents
the same manual-update churn on the next quarterly API bump.
- storefront-client.test.ts: X-SDK-Version assertion in getPrivateTokenHeaders
- ShopifyProvider.test.tsx: getShopifyConfig helper default (intentional
  test inputs in SHOPIFY_CONFIG are left as literals)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…RSION

Three X-SDK-Version assertions in getPrivateTokenHeaders (allows overrides)
and getPublicTokenHeaders (generates headers, allows overrides) still used the
literal '2026-04'. All four assertions use generateConfig without specifying
storefrontApiVersion, so the SDK falls back to SFAPI_VERSION — making the
constant the semantically correct reference in all cases.

Caught during consensus review (john-ousterhout, gray-verification-guardian).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@itsjustriley itsjustriley force-pushed the 2026-04-sfapi-caapi-update branch from 2247ca6 to a614ba2 Compare April 9, 2026 16:11
@itsjustriley itsjustriley merged commit b0caa5c into main Apr 9, 2026
33 of 36 checks passed
@itsjustriley itsjustriley deleted the 2026-04-sfapi-caapi-update branch April 9, 2026 17:55
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.

3 participants