Welcome to the Jose Madrid Salsa developer docs — explore features, APIs, and deployment guides.
Jose Madrid SalsaJMS Docs

Point of Sale

In-person selling at shows and the counter, running through a Square Terminal.

Point of Sale

/pos is the in-person register — the counter, farmers markets, shows. It is a staff-facing surface inside the storefront app, not a separate deployment.

RoutePurpose
/posThe register: search products, build a cart, take payment
/pos/ordersOrders taken on this register
/pos/settingsTerminal and receipt-printer configuration

Taking a payment

POST /api/pos/create-terminal-checkout does the work. It:

  1. Requires an RBAC permission (requirePermission) — the register is not open to anonymous callers.
  2. Validates the payload with Zod: at least one line item, a positive integer total, an optional taxAmount, and a deviceId (defaulting to 'default').
  3. Reserves inventory for every line via reserveMultipleProducts() before charging, and calls releaseInventory() if the checkout does not complete.
  4. Creates the Order with a POS-YYYYMMDD-NNNN order number and emits orderCreated.
  5. Sends the amount to the Square Terminal via the Square SDK.

GET /api/pos/terminal-status polls for the result — the customer taps or inserts their card on the terminal, and the register waits for Square to report back.

Payments are recorded with provider: SQUARE and channel: POS, which is what separates counter takings from online orders in reporting and in the ledger.

Configuration

VariablePurpose
SQUARE_ACCESS_TOKENRequired — the route throws without it
SQUARE_TERMINAL_DEVICE_IDThe terminal to send the charge to when deviceId is 'default'. Without it the route returns "No Square Terminal device configured."
SQUARE_LOCATION_IDRequired by the Square provider
SQUARE_SANDBOXSandbox vs production

/pos/settings is not yet real. The "Paired Devices" list renders two hard-coded example terminals, and "Pair New Device" is disabled. The printer dropdown is a static list of models. Nothing on that page is read from Square or persisted anywhere — the register itself works, but device pairing must be done in the Square dashboard, and the terminal actually charged comes from SQUARE_TERMINAL_DEVICE_ID (or an explicit deviceId in the request), never from this page.

How is this guide?

Edit on GitHub

Last updated on

On this page