--- title: Cash Drawer API description: >- The Cash Drawer API provides programmatic control over cash drawer hardware connected to POS devices. Use this API to trigger cash drawer operations for manual cash handling, custom payment api_version: 2026-01 api_name: pos-ui-extensions source_url: html: >- https://shopify.dev/docs/api/pos-ui-extensions/latest/target-apis/platform-apis/cash-drawer-api md: >- https://shopify.dev/docs/api/pos-ui-extensions/latest/target-apis/platform-apis/cash-drawer-api.md --- # Cash Drawer API The Cash Drawer API provides programmatic control over cash drawer hardware connected to POS devices. Use this API to trigger cash drawer operations for manual cash handling, custom payment workflows, or register management tasks. ### Use cases * **Manual operations:** Open cash drawers for verification, deposits, or withdrawals outside transactions. * **Dual authorization:** Implement workflows requiring manager approval before opening the drawer. * **Cash management:** Create tools for end-of-shift counting, till balancing, or float changes. * **Compliance:** Build features requiring cash drawer access logs or audit trails. ### Support Targets (3) ### Supported targets * [pos.​register-details.​action.​menu-item.​render](https://shopify.dev/docs/api/pos-ui-extensions/2026-01/targets/register-details#register-details-targets) * [pos.​register-details.​action.​render](https://shopify.dev/docs/api/pos-ui-extensions/2026-01/targets/register-details#register-details-action-modal-) * [pos.​register-details.​block.​render](https://shopify.dev/docs/api/pos-ui-extensions/2026-01/targets/register-details#register-details-block-) ### Properties The `shopify` object provides methods for controlling cash drawer hardware. Access the following properties on `shopify` to trigger cash drawer operations for manual cash handling. * **open** **() => Promise\** **required** Opens the connected cash drawer device. The drawer will automatically open if a compatible cash drawer is connected to the POS device. Use for manual cash drawer operations, implementing custom payment workflows, or providing explicit cash drawer access in register management interfaces. Examples ### Examples * #### ##### Description Open the cash drawer programmatically for manual cash handling or custom workflows. This example shows how to use \`shopify.cashDrawer.open()\` to trigger the connected cash drawer hardware. This is useful for no-sale transactions, manual cash operations, or register management tasks that require direct cash access. ##### jsx ```tsx import {render} from 'preact'; export default async () => { render(, document.body); }; const Extension = () => { return ( shopify.cashDrawer.open() } > Open cash drawer ); }; ``` *** ## Best practices * **Implement error handling:** Wrap `cashDrawer.open()` calls in try-catch blocks. Show clear error messages with resolution steps. * **Require authorization:** Implement authorization checks before opening for non-transaction operations. Consider PIN entry, manager approval, or staff permissions. * **Provide user feedback:** Show immediate confirmations like "Cash drawer opened successfully" so staff know the operation completed. * **Log operations for audit:** Track all openings including timestamps, staff info, and reason for loss prevention and compliance. * **Test without hardware:** Handle scenarios where no drawer is connected with fallback workflows or clear messaging. * **Consider timing:** Open at appropriate moments. Avoid opening multiple times in quick succession or in inappropriate workflow states. *** ## Limitations The API only triggers the drawer opening mechanism and cannot detect whether the drawer is currently open, closed, or physically jammed—your extension is responsible for any required state tracking. ***