Skip to content

Conversation

@vctrchu
Copy link
Contributor

@vctrchu vctrchu commented Nov 21, 2025

Part of https://github.com/shop/issues-retail/issues/20825

Background

Below is a table showing the APIs with New Examples Added (7)

API New Example File What It Demonstrates Reason
Session API current-session.jsx Access currentSession properties (shop, user, staff, location, currency, POS version) Two distinct methods: currentSession vs getSessionToken()
Order API order-details.jsx Display name and customerId properties 3 properties available, only 1 was documented
Draft Order API draft-order-details.jsx Display name and customerId properties 3 properties available, only 1 was documented
Scanner API scanner-data-subscribe.jsx Subscribe to scannerData for scan events with history tracking Two subscribables: sources and scannerData
Product API product-variant.jsx Access both id and variantId 2 properties available, only 1 was documented
PinPad API validation-with-options.jsx Use PinPadOptions with onDismissed callback for post-validation flow Optional parameters not previously demonstrated
Toast API show-with-duration.jsx Display toasts with custom duration (2s vs 8s examples) Optional duration parameter not previously demonstrated

Below is the table of APIs Excluded from Additional Examples (4)

API Existing Example Why Excluded
Cart Line Item API id.jsx Single property (cartLineItem) - API surface too small for meaningful second example
Connectivity API subscribe.jsx Single subscribable (current) - existing example adequately covers usage
Customer API id.jsx Single property (id) - API surface too small for meaningful second example
Locale API subscribe.jsx Single subscribable (current) - existing example adequately covers usage

Solution

  • Before: 11 APIs with only 1 example each
  • After: 7 APIs with 2+ examples, 4 APIs with 1 example (appropriate for their limited surface area)

🎩

https://pr-65216.shopify-dev.shopify.io/docs/api/pos-ui-extensions/latest/apis/draft-order-api
https://pr-65216.shopify-dev.shopify.io/docs/api/pos-ui-extensions/latest/apis/order-api
https://pr-65216.shopify-dev.shopify.io/docs/api/pos-ui-extensions/latest/apis/pinpad-api
https://pr-65216.shopify-dev.shopify.io/docs/api/pos-ui-extensions/latest/apis/product-api
https://pr-65216.shopify-dev.shopify.io/docs/api/pos-ui-extensions/latest/apis/scanner-api
https://pr-65216.shopify-dev.shopify.io/docs/api/pos-ui-extensions/latest/apis/session-api
https://pr-65216.shopify-dev.shopify.io/docs/api/pos-ui-extensions/latest/apis/toast-api

Checklist

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

@vctrchu vctrchu self-assigned this Nov 21, 2025
@vctrchu vctrchu force-pushed the 2025-10_pos_add_more_doc_examples branch from 7e8cc96 to 6feb16f Compare November 21, 2025 20:28
@vctrchu vctrchu requested review from a team and mcvinci November 21, 2025 20:29
@vctrchu
Copy link
Contributor Author

vctrchu commented Nov 21, 2025

I'll need to cherry-pick this into 2026-01-rc as well

@vctrchu vctrchu marked this pull request as ready for review November 21, 2025 20:46
@github-actions
Copy link
Contributor

We detected some changes in packages/*/package.json or packages/*/src, and there are no updates in the .changeset directory. If the changes are user-facing and should cause a version bump, run yarn changeset to track your changes and include them in the next release CHANGELOG. If you are making simple updates to repo configuration, examples, or documentation, you do not need to add a changeset.

Copy link
Contributor

@mcvinci mcvinci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for adding these new examples, @vctrchu! I've made some minor suggestions re: wording of codeblock titles.

@vctrchu vctrchu force-pushed the 2025-10_pos_add_more_doc_examples branch from 6feb16f to b8ce02c Compare November 24, 2025 21:43
@vctrchu vctrchu merged commit b8bba7e into 2025-10 Nov 24, 2025
6 checks passed
@vctrchu vctrchu deleted the 2025-10_pos_add_more_doc_examples branch November 24, 2025 21:45
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.

2 participants