In Parakou, the internet often drops. Rachidi Yarou cannot wait for the network while a customer holds a prescription. The point-of-sale computer of Pharmacie Bonne Santé keeps a copy of the catalogue, so it can keep selling offline and catch up later. Dr Aminatou Chabi wants to decide which computers may hold that copy. This page follows a POS device from its first request to its retirement. The same steps apply to any shop that needs to keep selling when the connection fails.

The computer asks to join

A new computer uses the organization’s POS registration key to ask for registration with Request a POS registration. It receives a request id and a secret token, shown once, to follow its request. A computer that already has an active device or an open request in the organization is refused. This is limited to 5 per minute. The computer can check where it stands with Check POS registration status, using its token.

The manager decides

Dr Chabi lists the waiting computers with List POS registration requests and opens one with View a POS registration request. Then:

The computer starts syncing

Once approved, the computer finishes its registration with Finish POS registration. Exowpee creates its access to the sync service and an active POS device, and gives the computer the connection details and the access token. If it asks again, it gets the same details, until the device’s credentials are renewed or the device is revoked; after that, asking again is refused. If this is the only active device of the organization, a first snapshot of the catalogue is queued. After that, the device works with its own access token, not with a member’s login:

Follow and steer the devices

List POS sync devices and View a POS sync device show each device with its sync state. After a large change of the catalogue, a counter looks out of date, so Dr Chabi asks a device to resync with Ask a device to resync. At its next heartbeat, the device is told to reload its catalogue. The request is cleared when the device reports that it has synced after the request.

Renew the credentials

For safety, Dr Chabi asks a device to renew its credentials with Ask a device to renew credentials. At its next heartbeat the device is told to rotate. It then renews them with Renew device credentials, which gives a new secret once and stops the previous one. This is refused if nobody asked for a rotation. The API token stays valid.

Retire a device

When a computer is lost, Dr Chabi revokes the device with Revoke a POS sync device. Its access to the sync service is deleted first, so any running sync stops. If the sync service refuses, nothing changes and the device stays active. A revoked device cannot be restored: the computer must register again.

The rules

  • Without a valid device token, the device calls are refused with 401. A revoked device is refused too.
  • The sync topic of the organization must have been provisioned, or the calls that need it are refused as not ready.
  • A cash register computer can also name its POS device when it asks for a link: see Connect cash register computers.

All the actions of this topic