Cash drawer
Most cash drawers plug into the receipt printer (an RJ11/RJ12 "DK" port). The printer opens the drawer when it receives a kick command on pin 2 or pin 5.
Open the drawer
Three ways:
-
On its own (browser SDK):
drawer.opensends the command at once, ahead of queued receipts.await jp.drawer.open({ alias: "receipt" }); // pin 2await jp.drawer.open({ alias: "receipt" }, 5); // pin 5 -
After a receipt, with the job option:
options: { openDrawer: true }. -
Inside a receipt, where you want it, with a block:
{ "type": "drawer", "pin": 2 }.
From a server, use option 2 or 3 with POST /v1/jobs.
Pin 2 or pin 5
Most drawers use pin 2, the default. If nothing opens, try pin 5. To set it once per printer instead of in each call, set printers.drawerPins in the device config (Dashboard → Config):
{ "printers": { "drawerPins": { "prn_7f3a": 5 } } }
Checks
- The printer needs
drawerin itscapabilities. Label and office printers have none. - Some printers only open the drawer when their cover is closed and they have paper.
- A drawer plugged into the computer by USB (not into the printer) is not supported.