Skip to content

Add POS shopify.printing API (getPrinters + printer selection)#4515

Merged
aaronschubert0 merged 4 commits into
2026-07-rcfrom
retail-extensions/printing-api-types
Jun 30, 2026
Merged

Add POS shopify.printing API (getPrinters + printer selection)#4515
aaronschubert0 merged 4 commits into
2026-07-rcfrom
retail-extensions/printing-api-types

Conversation

@aaronschubert0

@aaronschubert0 aaronschubert0 commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

What

Adds the POS shopify.printing API to the 2026-07 surface, per the approved TAG spec Shopify/ui-api-design#1413. This is the types layer of the cross-repo Printing API work.

const printers = await shopify.printing.getPrinters();
const receiptPrinter = printers.find((p) => p.connected);

if (receiptPrinter) {
  await shopify.printing.print('/print/receipt', {printer: receiptPrinter});
} else {
  await shopify.printing.print('/print/receipt'); // system print dialog
}

Changes

  • api/printing-api/printing-api.ts (new):
    • PrintingApiContentgetPrinters(): Promise<Printer[]> and print(src, options?): Promise<void>
    • PrintOptions{ printer?: Printer }
    • Printer{ id: string; name: string; connected: boolean }
    • PrintingApi{ printing: PrintingApiContent } (the shopify.printing namespace)
    • JSDoc mirrors the committed spec; each interface carries @publicDocs for shopify.dev generation.
  • standard-api.ts: add PrintingApi to StandardApi.
  • api.ts: export the new public types.
  • print-api.ts: @deprecate PrintApi / PrintApiContent in favor of shopify.printing. shopify.print stays as a deprecated alias.
  • Changeset: minor.

Notes

  • This PR is types only. Runtime behavior (version gating to >= 2026-07, getPrinters() returning the connected receipt printer, and routing print(src, {printer}) to it) lands in the extensibility plugin (PR A2) and the pos-mobile bridge (PR B2).
  • Printer follows the committed spec exactly — { id, name, connected }, no type field.

Testing

  • tsc --noEmit over @shopify/ui-extensions: 0 errors.

Related

🤖 Drafted with pi.

@aaronschubert0 aaronschubert0 requested a review from a team June 17, 2026 08:34
@aaronschubert0 aaronschubert0 marked this pull request as ready for review June 17, 2026 08:35
@aaronschubert0 aaronschubert0 force-pushed the retail-extensions/printing-api-types branch from a1dac9f to 9d6b253 Compare June 18, 2026 08:49

aaronschubert0 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Jun 30, 12:39 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 30, 12:40 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 30, 12:41 PM UTC: @aaronschubert0 merged this pull request with Graphite.

Introduces the `shopify.printing` API for the 2026-07 POS surface:

- printing-api.ts: PrintingApi / PrintingApiContent with getPrinters() and
  print(src, options?), plus PrintOptions { printer?: Printer } and
  Printer { id, name, connected }. Mirrors the approved TAG spec
  (Shopify/ui-api-design#1413) and aligns with the WICG Web Printing model.
- standard-api.ts: add PrintingApi to StandardApi.
- api.ts: export the new public types.
- print-api.ts: deprecate PrintApi / PrintApiContent in favor of shopify.printing.

shopify.print remains as a deprecated alias; shopify.printing supersedes it.
… mock

- standard-api.ts: PrintApi is intentionally kept in the StandardApi
  intersection so shopify.print keeps working as a deprecated alias of
  shopify.printing.print(). Suppress import/no-deprecated at the import and
  the intersection use (eslint runs with --max-warnings 0).
- factories.ts: add the now-required `printing` property to the POS
  StandardApi test mock (getPrinters + print).

Assisted-By: devx/8a5a23f1-0153-4f26-8b62-47e474da9689
Aligns the schema with the host-plugin behavior: receipt printers render
HTML/image content only, so print(src, {printer}) with a PDF src throws.
Adds the @throws entry and clarifies that PDFs print via the system dialog.

Assisted-By: devx/8a5a23f1-0153-4f26-8b62-47e474da9689
Assisted-By: devx/8a5a23f1-0153-4f26-8b62-47e474da9689
@aaronschubert0 aaronschubert0 force-pushed the retail-extensions/printing-api-types branch from 5c83681 to da5fef8 Compare June 30, 2026 12:40
@aaronschubert0 aaronschubert0 merged commit 9f00a0e into 2026-07-rc Jun 30, 2026
6 checks passed
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