Skip to content

POS LineItem productCategory - #4681

Open
chadcromwell wants to merge 3 commits into
2026-10-rcfrom
pos-line-item-product-category
Open

POS LineItem productCategory#4681
chadcromwell wants to merge 3 commits into
2026-10-rcfrom
pos-line-item-product-category

Conversation

@chadcromwell

@chadcromwell chadcromwell commented Sep 9, 2026

Copy link
Copy Markdown
Member

Background

Extensions that render receipts or read the cart often need a line item's product category, for example to apply category-specific treatment or for categorization and reporting. Today the LineItem payload does not carry it, so an extension has to resolve the category with a separate API call.

https://github.com/shop/issues-retail/issues/34611

Solution

Adds an optional productCategory field to the point of sale LineItem interface, plus a new ProductCategory type exported from the point of sale surface:

  • id: the stable, locale-independent Standard Product Taxonomy GID (for example gid://shopify/TaxonomyCategory/aa-1-2-3), safe as a mapping key.
  • name: the category's own name (for example Shirts & Tops).
  • fullName: the full ancestor path (for example Apparel & Accessories > Clothing > Shirts & Tops).

All three are sent so consumers never have to resolve the name or path from the id, which is the whole point of putting it on the payload rather than having each extension look it up.

The field is optional and populated per line item by the host. It is omitted for line items with no underlying product (custom or quick sale items, gift cards) and for products with no taxonomy category assigned, so the change is additive and existing extensions are unaffected. No other surface is changed.

Alternative considered: leave extensions to fetch the category themselves. Rejected because it adds a per-receipt lookup and latency for data the host already has.

🎩

Type-only change on this repo, so there is nothing to exercise at runtime here; the field is populated by the POS host in a separate change and will be tophatted end to end there.

  • yarn type-check passes.
  • eslint passes on the changed files.
  • productCategory is present and optional on LineItem, and
    ProductCategory is importable from the point of sale surface, in the
    built types.

Checklist

  • I have 🎩'd these changes
  • I have updated relevant documentation

@chadcromwell chadcromwell self-assigned this Sep 9, 2026
@chadcromwell
chadcromwell marked this pull request as ready for review September 9, 2026 23:49
@chadcromwell
chadcromwell marked this pull request as draft September 10, 2026 00:21
@chadcromwell
chadcromwell marked this pull request as ready for review September 10, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants