Printing API
The Printing API lets POS UI extensions print documents from your app backend. Use it for receipts, labels, slips, and other printable content.
Anchor to Use casesUse cases
- Direct printer jobs: Send HTML or image receipts directly to a connected hardware printer.
- Labels and slips: Print labels, pickup slips, or packing slips without opening the system print dialog.
- Dialog fallback: Show the system print dialog when no hardware printer is selected.
Supported targets
- pos.
cart. line-item-details. action. menu-item. render - pos.
cart. line-item-details. action. render - pos.
customer-details. action. menu-item. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. menu-item. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
home. modal. render - pos.
home. tile. render - pos.
order-details. action. menu-item. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. menu-item. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. menu-item. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
register-details. action. menu-item. render - pos.
register-details. action. render - pos.
register-details. block. render
Supported targets
- pos.
cart. line-item-details. action. menu-item. render - pos.
cart. line-item-details. action. render - pos.
customer-details. action. menu-item. render - pos.
customer-details. action. render - pos.
customer-details. block. render - pos.
draft-order-details. action. menu-item. render - pos.
draft-order-details. action. render - pos.
draft-order-details. block. render - pos.
home. modal. render - pos.
home. tile. render - pos.
order-details. action. menu-item. render - pos.
order-details. action. render - pos.
order-details. block. render - pos.
product-details. action. menu-item. render - pos.
product-details. action. render - pos.
product-details. block. render - pos.
purchase. post. action. menu-item. render - pos.
purchase. post. action. render - pos.
purchase. post. block. render - pos.
register-details. action. menu-item. render - pos.
register-details. action. render - pos.
register-details. block. render
Anchor to PropertiesProperties
The shopify global object provides methods for discovering hardware printers and printing documents. Access the following properties on shopify.printing to list printers or print HTML, image, and PDF content.
- Anchor to getPrintersget
Printersget Printers () => Promise<Printer[]>() => Promise<Printer[]>requiredrequired Returns the list of hardware printers currently available to the device. Each printer includes its connection status and a reference that can be passed to
print().When no hardware printers are available, returns an empty array. The system print dialog is not included in this list — it is the default behavior when no
printeroption is provided toprint().- Anchor to printprintprint(src: string, options?: PrintOptions) => Promise<void>(src: string, options?: PrintOptions) => Promise<void>requiredrequired
Triggers a print operation for the specified document source.
When called without a
printeroption, opens the device's system print dialog (e.g., AirPrint on iOS, Android print service). When aprinterreference is provided (from), sends the content directly to that printer without showing a dialog.The
srcparameter accepts either:The content at the URL is fetched with the extension's session token for authentication. HTML, PDFs, and images are supported content types. PDFs can only be printed via the system print dialog: selecting a
printerwith a PDFsrcthrows, because hardware (receipt) printers render HTML and image content only.
Printer
A hardware printer available to the device, as returned by `shopify.printing.getPrinters()`.
- connected
Whether the printer is currently able to accept print jobs.
boolean - id
Unique identifier for this printer.
string - name
Human-readable display name (e.g., "Star TSP143" or "Front Counter Printer").
string
PrintOptions
Options for `shopify.printing.print()`.
- printer
A printer reference obtained from `getPrinters()`. When provided, the print job is sent directly to this printer without showing a system print dialog. When omitted, the system print dialog is shown, allowing the user to select a printer and configure print settings.
Printer
jsx
Examples
Description
Call `shopify.printing.print()` without a `printer` option to open the system print dialog from a POS tile.
jsx
import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; const Extension = () => { return ( <s-tile heading="My app" subheading="Print document" onClick={() => { shopify.printing.print('documents/test-print'); }} /> ); };Description
Print documents hosted by your app backend using a full URL.
jsx
import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; const Extension = () => { return ( <s-tile heading="My app" subheading="Print with full URL" onClick={async () => { await shopify.printing.print( 'https://my-print-service.com/api/print/document', ); }} /> ); };Description
Print documents using a path relative to your app's `application_url`.
jsx
import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; const Extension = () => { return ( <s-tile heading="My app" subheading="Print with relative path" onClick={async () => { await shopify.printing.print('/api/print/document'); }} /> ); };Description
Find a connected hardware printer and send a receipt directly to it. If none is connected, fall back to the system print dialog.
jsx
import {render} from 'preact'; export default async () => { render(<Extension />, document.body); }; const Extension = () => { async function printReceipt() { try { const printers = await shopify.printing.getPrinters(); const receiptPrinter = printers.find((printer) => printer.connected); if (receiptPrinter) { await shopify.printing.print('/print/receipt', {printer: receiptPrinter}); return; } await shopify.printing.print('/print/receipt'); } catch (error) { console.error('Unable to print receipt', error); } } return ( <s-tile heading="Print receipt" subheading="Use receipt printer" onClick={printReceipt} /> ); };
Anchor to Best practicesBest practices
- Check
printer.connectedbefore sending a direct print job. - Keep direct-print documents simple. Use HTML or images sized for the target printer.
- Use the system print dialog for PDFs.
- Show a clear fallback when no hardware printer is available.
Anchor to LimitationsLimitations
- The
srcpassed toprint()must use the same origin as your app'sapplication_url. getPrinters()returns hardware printers only. The system print dialog isn't included in that list.- Direct printing requires a connected
Printerreturned bygetPrinters(). - PDFs can only be printed through the system print dialog. Passing a
printerwith a PDFsrcthrows an error.