Skip to main content

Print API
APIs

The Print API enables document printing functionality in your point of sale extension. Use this API to trigger the native print dialog for your documents.

The print() method accepts either:

  • A relative path that will be appended to your app's application_url
  • A full URL to your app's backend that will be used to return the document to print

Supported document types:

  • HTML documents (recommended for best printing experience)
  • Text files
  • Image files (PNG, JPEG, etc.)
  • PDF files (Note: On Android devices, PDFs will be downloaded and must be printed using an external application)

Interface for handling print operations

(src: string) => Promise<void>
required

Trigger a print dialog.

The src must be either:

  • A relative path that will be appended to your app's application_url
  • A full URL to your app's backend that will be used to return the document to print

Supported document types:

  • HTML documents (recommended for best printing experience)
  • Text files
  • Image files (PNG, JPEG, etc.)
  • PDF files (Note: On Android devices, PDFs will be downloaded and must be printed using an external application)
Was this section helpful?

Examples of using the Print API

Was this section helpful?

Print directly from the tile

jsx

import {render} from 'preact';

export default async () => {
render(<Extension />, document.body);
};

const Extension = () => {
return (
<s-tile
heading="My app"
subheading="Hello world!"
onClick={() => {
shopify.print.print('documents/test-print');
}}
/>
);
};