Skip to main content

Print Action Extension API

Requires the admin print action component.

The Print Action Extension API lets you build print action extensions that generate custom printable documents for orders, products, and other resources. Use this API to create branded labels, packing slips, custom invoices, or specialty documents.

  • Custom print documents: Generate custom printable documents like labels, invoices, or packing slips for orders and products.
  • Branded materials: Create branded shipping labels, return labels, or custom receipts.
  • Order documentation: Generate custom order documentation, pick lists, or fulfillment sheets.
  • Product labels: Create product labels with barcodes, pricing, or custom information.

The shopify global object provides properties for print action extensions that generate custom printable documents. Access the following properties on shopify to access selected resources and display picker dialogs for print configuration.

required

Provides methods for authenticating calls to your app backend. Use the idToken() method to retrieve a signed JWT token that verifies the current user's identity for secure server-side operations.

required

An array of currently viewed or selected resource identifiers. Use this to access the IDs of items to include in the print document, such as selected orders or products.

Anchor to extension
extension
{ target: ; }
required

The identifier of the running extension target. Use this to determine which target your extension is rendering in and conditionally adjust functionality or UI based on the extension context.

required

Utilities for translating content according to the current localization of the admin. Use these methods to provide translated strings that match the merchant's language preferences, ensuring your extension is accessible to a global audience.

Anchor to intents
intents
required

Provides information to the receiver of an intent. Use this to access data passed from other extensions or parts of the admin when your extension is launched through intent-based navigation.

Anchor to picker
picker
required

Opens a custom selection dialog with your app-specific data. Use the Picker API to define the picker's heading, items, headers, and selection behavior. Returns a Promise that resolves to a Picker object with a selected property for accessing the merchant's selection.

Anchor to query
query
< = unknown, Variables = { [key: string]: unknown; }>(query: string, options?: { variables?: Variables; version?: Omit<, "2023-04">; }) => Promise<{ data?: ; errors?: []; }>
required

Executes GraphQL queries against the GraphQL Admin API. Use this to fetch shop data, manage resources, or perform mutations. Queries are automatically authenticated with the current user's permissions. Optionally specify GraphQL variables and API version for your query.

Anchor to resourcePicker
resourcePicker
required

Opens the resource picker modal for selecting products, variants, or collections. Returns the selected resources when the user confirms their selection, or undefined if they cancel.

Anchor to storage
storage
required

Provides methods for persisting data in browser storage that is scoped to your extension. Use this to store user preferences, cache data, maintain state across sessions, or save temporary working data. Storage is persistent across page reloads and isolated per extension.


  • Use @media print CSS for print-optimized styling: Apply print-specific styles with @media print queries to control page breaks, hide UI elements, and optimize for paper output. The print preview shows the screen styles until printing.
  • Set document MIME type correctly: Return Content-Type: application/pdf for PDFs, image/png for images, or text/html for HTML documents. Incorrect MIME types may cause browser download instead of preview.
  • Test window.print() behavior: If generating HTML, test that window.print() works correctly. Some CSS frameworks or scripts may interfere with browser print dialogs.

  • Print action extensions must return a URL string. You can't render the print UI directly within the extension or control the print preview appearance.
  • URLs must be publicly accessible with CORS headers allowing the Shopify admin origin. Authentication tokens in URLs can expire while merchants have the preview open.
  • Extensions don't have access to printer settings. You can't configure print options like page orientation, margins, or paper size. Merchants control these through browser print dialogs.

Was this page helpful?