Rachidi Yarou is the cashier at Pharmacie Bonne Santé in Parakou. The pharmacy has bought a new computer for the counter. Dr Aminatou Chabi does not want any machine to be able to open her register: she wants to know which computer is linked to it, and to cut it off if it is lost. This page follows the link between a computer and a cash register. The same steps apply to any shop that adds or replaces a counter computer. The computer is not logged in, so it does not log in with a member account. It uses the company’s cash registration key, which Dr Chabi gives to Rachidi. With the key, the computer lists the company’s registers with List registers by company key, then picks one and asks for a link with Request a cash register computer link. The request waits for approval. The computer receives a private token, shown once, and keeps it to follow its request. These requests are rate limited, and a machine cannot have two open requests (pending, or approved and not yet completed) for the same register, nor a request for a register where it already has an active device. If the computer is also a POS device that syncs the catalogue, the request can name it (see Connect offline POS devices).

The manager decides

Dr Chabi sees the waiting requests with List device registration requests, filtered by status, and opens one with View a device request. Then she decides: Only a pending request can be approved or rejected.

The computer finishes its setup

With its token, the computer checks whether the request is pending, approved or rejected with Check device request status. Once approved, it finishes its setup with Finish device setup. Exowpee records the computer as active and gives it its secret. The secret is shown only once and is stored only as a hash, so the computer must keep it. If the computer asks again, it gets its record without a secret. The secret is what the cashier’s register session needs: Open a cash register session from this computer is refused with a wrong secret. See Run a register session.

See and revoke devices

List cash register computers shows the computers linked to the registers, optionally by status. View a cash register computer shows one. When a computer is lost, Dr Chabi revokes the device with Revoke a cash register computer. The device can no longer open a register. A computer with an open register session cannot be revoked: the session must be closed first. Revoking a device that is already revoked changes nothing.

The rules

  • Only a pending request that is not completed can be approved or rejected; otherwise the answer is 409.
  • The computer’s calls with its request token are refused with 401 without that token.
  • The completion is refused if an active device already exists for this machine on this register.
  • Requests to link are limited to 10 calls per minute, and the list of registers by key to 30 calls per minute.

All the actions of this topic

  • Request a cash register computer link: A computer asks to be linked to a cash register of a company, using the company registration key. The request waits for a manager approval and returns a private token the machine keeps to follow its request.
  • Check device request status: The computer checks whether its link request is still pending, approved or rejected.
  • Finish device setup: Once a request is approved, the computer finishes its setup and receives its device credentials. Calling again after completion returns the already created device without a new secret.
  • List device registration requests: Shows the requests from computers asking to be linked to one of your cash registers, optionally filtered by status. Used to see which machines are waiting for approval.
  • View a device request: Shows one request from a computer to be linked to a cash register, including its status.
  • Delete a device request: Removes a device registration request that has not yet been completed.
  • Approve a device request: Approves a pending request from a computer to act as a cash register computer. The machine can then finish its setup.
  • Reject a device request: Refuses a pending request from a computer to be linked to a cash register.
  • List registers by company key: A computer that is not yet logged in lists the cash registers of a company by presenting its registration key, so it can pick one to link to.
  • List cash register computers: Lists the cash register computers linked to your cash registers, optionally by status.
  • View a cash register computer: Shows one computer linked to a cash register.
  • Revoke a cash register computer: Cuts off a linked computer so it can no longer open a cash register session.