POS LineItem productCategory - #4681
Open
chadcromwell wants to merge 3 commits into
Open
Conversation
fatbattk
approved these changes
Sep 10, 2026
chadcromwell
marked this pull request as draft
September 10, 2026 00:21
chadcromwell
marked this pull request as ready for review
September 10, 2026 12:48
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
LineItempayload 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
productCategoryfield to the point of saleLineIteminterface, plus a newProductCategorytype exported from the point of sale surface:id: the stable, locale-independent Standard Product Taxonomy GID (for examplegid://shopify/TaxonomyCategory/aa-1-2-3), safe as a mapping key.name: the category's own name (for exampleShirts & Tops).fullName: the full ancestor path (for exampleApparel & 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-checkpasses.eslintpasses on the changed files.productCategoryis present and optional onLineItem, andProductCategoryis importable from the point of sale surface, in thebuilt types.
Checklist