Skip to main content
Migrate to Polaris

Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.

Transaction events

Transaction event targets operate in the background, responding to activities that occur during POS operations. These extensions don't display user interfaces but automatically react to merchant actions.

  • Real-time monitoring: Track cart changes for inventory updates, pricing, or promotions.
  • Cash management: Monitor cash sessions for compliance, audits, and security.
  • Post-transaction workflows: Automate loyalty updates, inventory adjustments, and follow-ups.
  • External integrations: Connect with reporting, fraud detection, and analytics systems.

Anchor to Transaction events targetsTransaction events targets

Use these targets for event monitoring, automated workflows, or integration with external systems for real-time transaction processing.

pos.cart-update.event.observe

Observes cart updates during active transactions, triggering whenever merchants add, remove, or modify line items. Use this target for real-time responses to cart changes like dynamic pricing, inventory validation, or promotional offer applications based on current cart contents.

Extensions at this target receive complete cart data including line items, totals, discounts, and customer information whenever the cart state changes.

The data object provided to cart update extension targets. Contains the current cart state along with device, session, and connectivity information. This data is passed to extensions whenever the cart changes, enabling real-time cart monitoring and cart-based business logic.

required

The complete current Cart object containing all cart data including line items with products and quantities, pricing totals (subtotal, tax, grand total), associated customer information, applied discounts, custom properties, and editability state. This represents the cart's state at the moment the extension is triggered, reflecting all recent changes. The cart object is read-only in this context—modifications should be made through the Cart API methods.

Anchor to connectivity
connectivity
required

The current Internet connectivity state of the POS device. Indicates whether the device is connected to or disconnected from the Internet. This state updates in real-time as connectivity changes, allowing extensions to adapt behavior for offline scenarios, show connectivity warnings, or queue operations for when connectivity is restored.

Anchor to device
device
required

Comprehensive information about the physical POS device where the extension is currently running. Includes the device name, unique device ID, and form factor information (tablet vs other). This data is static for the session and helps extensions adapt to different device types, log device-specific information, or implement device-based configurations.

Anchor to locale
locale
string
required

The IETF BCP 47 locale string for the current POS session (for example, "en-US", "fr-CA", "de-DE"). This indicates the merchant's language and regional preferences. Commonly used for internationalization (i18n), locale-specific date/time/number formatting, translating UI text, and providing localized content. The locale remains constant for the session and reflects the language selected in POS settings.

Anchor to session
session
required

Comprehensive information about the current POS session including shop ID and domain, authenticated user, pinned staff member, active location, currency settings, and POS version. This session data remains constant for the session duration and provides critical context for business logic, permissions, API authentication, and transaction processing. Session data updates when users switch locations or change pinned staff members.

Anchor to storage
storage
required

Provides access to the persistent local storage methods for storing and retrieving extension data.

pos.cash-tracking-session-start.event.observe

Observes when cash tracking sessions begin, triggering when merchants start cash handling operations. Use this target for monitoring cash handling activities for compliance, security, or operational reporting purposes.

Extensions at this target receive session data including the session ID and opening time when a new cash tracking session is initiated.

Anchor to cashtrackingsessionstartdataCashTrackingSessionStartData

The data object provided to cash tracking session start extension targets. Contains information about a newly opened cash tracking session along with device and session context.

Anchor to cashTrackingSessionStart
cashTrackingSessionStart
{ id: number; openingTime: string; }
required

The cash tracking session start data containing the session identifier and the time when the session began. Cash tracking sessions represent the period during which a cash drawer is open and being used for transactions, typically corresponding to a staff member's shift.

Anchor to connectivity
connectivity
required

The current Internet connectivity state of the POS device. Indicates whether the device is connected to or disconnected from the Internet. This state updates in real-time as connectivity changes, allowing extensions to adapt behavior for offline scenarios, show connectivity warnings, or queue operations for when connectivity is restored.

Anchor to device
device
required

Comprehensive information about the physical POS device where the extension is currently running. Includes the device name, unique device ID, and form factor information (tablet vs other). This data is static for the session and helps extensions adapt to different device types, log device-specific information, or implement device-based configurations.

Anchor to locale
locale
string
required

The IETF BCP 47 locale string for the current POS session (for example, "en-US", "fr-CA", "de-DE"). This indicates the merchant's language and regional preferences. Commonly used for internationalization (i18n), locale-specific date/time/number formatting, translating UI text, and providing localized content. The locale remains constant for the session and reflects the language selected in POS settings.

Anchor to session
session
required

Comprehensive information about the current POS session including shop ID and domain, authenticated user, pinned staff member, active location, currency settings, and POS version. This session data remains constant for the session duration and provides critical context for business logic, permissions, API authentication, and transaction processing. Session data updates when users switch locations or change pinned staff members.

Anchor to storage
storage
required

Provides access to the persistent local storage methods for storing and retrieving extension data.

pos.cash-tracking-session-complete.event.observe

Observes when cash tracking sessions complete, triggering when merchants finish cash handling operations. Use this target for monitoring cash handling completion for audit trails, compliance reporting, or operational analytics.

Extensions at this target receive session data including the session ID, opening time, and closing time when a cash tracking session is completed.

Anchor to cashtrackingsessioncompletedataCashTrackingSessionCompleteData

The data object provided to cash tracking session complete extension targets. Contains information about a completed cash tracking session including when it opened and closed, along with device and session context.

Anchor to cashTrackingSessionComplete
cashTrackingSessionComplete
{ id: number; openingTime: string; closingTime: string; }
required

The cash tracking session complete data containing the session identifier, opening time, and closing time. This represents the full lifecycle of a cash drawer session from opening to closing.

Anchor to connectivity
connectivity
required

The current Internet connectivity state of the POS device. Indicates whether the device is connected to or disconnected from the Internet. This state updates in real-time as connectivity changes, allowing extensions to adapt behavior for offline scenarios, show connectivity warnings, or queue operations for when connectivity is restored.

Anchor to device
device
required

Comprehensive information about the physical POS device where the extension is currently running. Includes the device name, unique device ID, and form factor information (tablet vs other). This data is static for the session and helps extensions adapt to different device types, log device-specific information, or implement device-based configurations.

Anchor to locale
locale
string
required

The IETF BCP 47 locale string for the current POS session (for example, "en-US", "fr-CA", "de-DE"). This indicates the merchant's language and regional preferences. Commonly used for internationalization (i18n), locale-specific date/time/number formatting, translating UI text, and providing localized content. The locale remains constant for the session and reflects the language selected in POS settings.

Anchor to session
session
required

Comprehensive information about the current POS session including shop ID and domain, authenticated user, pinned staff member, active location, currency settings, and POS version. This session data remains constant for the session duration and provides critical context for business logic, permissions, API authentication, and transaction processing. Session data updates when users switch locations or change pinned staff members.

Anchor to storage
storage
required

Provides access to the persistent local storage methods for storing and retrieving extension data.

pos.transaction-complete.event.observe

Observes completed transactions including sales, returns, and exchanges, triggering when transactions are finalized. Use this target for post-transaction processing, analytics collection, and automated workflows that need to respond to completed sales activities.

Extensions at this target receive detailed transaction information including transaction type, totals, line items, and customer data when any transaction type is completed.

Anchor to transactioncompletedataTransactionCompleteData

The data object provided to receipt targets containing transaction details.

Anchor to connectivity
connectivity
required

The current Internet connectivity state of the POS device. Indicates whether the device is connected to or disconnected from the Internet. This state updates in real-time as connectivity changes, allowing extensions to adapt behavior for offline scenarios, show connectivity warnings, or queue operations for when connectivity is restored.

Anchor to device
device
required

Comprehensive information about the physical POS device where the extension is currently running. Includes the device name, unique device ID, and form factor information (tablet vs other). This data is static for the session and helps extensions adapt to different device types, log device-specific information, or implement device-based configurations.

Anchor to locale
locale
string
required

The IETF BCP 47 locale string for the current POS session (for example, "en-US", "fr-CA", "de-DE"). This indicates the merchant's language and regional preferences. Commonly used for internationalization (i18n), locale-specific date/time/number formatting, translating UI text, and providing localized content. The locale remains constant for the session and reflects the language selected in POS settings.

Anchor to session
session
required

Comprehensive information about the current POS session including shop ID and domain, authenticated user, pinned staff member, active location, currency settings, and POS version. This session data remains constant for the session duration and provides critical context for business logic, permissions, API authentication, and transaction processing. Session data updates when users switch locations or change pinned staff members.

Anchor to storage
storage
<Record<string, unknown>>
required

Provides access to persistent local storage methods for your POS UI extension. Use this to store, retrieve, and manage data that persists across sessions.

Anchor to transaction
transaction
| | |
required

The transaction data, which can be one of the following types:

  • SaleTransactionData: Defines the data structure for completed sale transactions.
  • ReturnTransactionData: Defines the data structure for completed return transactions.
  • ExchangeTransactionData: Defines the data structure for completed exchange transactions.

  • Implement robust error handling: Implement robust error handling to prevent event processing failures from affecting POS operations, such as try-catch blocks, graceful degradation, and error logging.
  • Process only relevant events: Only process events that are relevant to your use case to optimize performance and resource usage, such as filtering by transaction type, checking cart contents, and validating session data.
  • Respect data privacy: Handle transaction and customer data responsibly in accordance with privacy requirements and business policies. Event extensions have access to sensitive transaction data including customer information, payment details, and business metrics. Ensure you handle this data securely, only collect what's necessary, and comply with applicable privacy regulations and merchant policies.
  • Return consistent responses: Return appropriate BaseOutput responses to indicate successful processing or report errors when needed, such as returning success status, reporting processing errors, and providing meaningful error messages.
  • Validate event data before processing: Validate event data before processing.

  • Event extensions can't render UI components or interact with the POS interface. They are designed for background processing and data observation only.

  • Event extensions have access to event-specific data and the Storage API, but can't access other POS UI extensions APIs or modify POS state. To perform actions based on events, use external API calls or integrate with your app backend.

  • Event handlers must return a Promise<BaseOutput> response to indicate processing completion and report any errors that occurred during event handling.


Was this page helpful?