Skip to main content

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.

  • 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.
Support
Targets (22)

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 getPrinters
getPrinters
() => Promise<[]>
required

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 printer option is provided to print().

Anchor to print
print
(src: string, options?: ) => Promise<void>
required

Triggers a print operation for the specified document source.

When called without a printer option, opens the device's system print dialog (e.g., AirPrint on iOS, Android print service). When a printer reference is provided (from getPrinters()), sends the content directly to that printer without showing a dialog.

The src parameter accepts either:

  • A relative path that will be appended to your app's application_url
  • A full URL to your app's backend

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 printer with a PDF src throws, because hardware (receipt) printers render HTML and image content only.


  • Check printer.connected before 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.

  • The src passed to print() must use the same origin as your app's application_url.
  • getPrinters() returns hardware printers only. The system print dialog isn't included in that list.
  • Direct printing requires a connected Printer returned by getPrinters().
  • PDFs can only be printed through the system print dialog. Passing a printer with a PDF src throws an error.

Was this page helpful?