Skip to main content

Codes and profiles

A consumer user is the person. What the machine reads is their code. What decides what they may take is the code's profile.

Code

The physical identifier the user presents. Supported types: QR, NFC, FINGERPRINT, CODE128, CODE39, PDF417, EAN13, UPCA, MAXICODE, MRZ.

A code has:

  • a value (the ID the machine reads);
  • a level: operation (the value exists and works only there) or account (same code, balance and quota across every operation of the account);
  • up to two profiles: one vending, one EAS. It must keep at least one;
  • balance and top-up if it operates vending (see Balances);
  • an active/inactive status, independent of the user's status.

The level belongs to the code, not to the profile: it defines where the code is valid and which other codes compete for the same value. A value cannot exist both at the account and inside one of its operations.

Profile

The consumption rule. It belongs to one account and one business line, and has no level: where it works is defined by its list of authorised devices.

Vending profile

FieldPurpose
Top-up periodHow often credit is granted: daily, weekly, biweekly, monthly, quarterly, semiannual, annual, or custom dates.
Top-up valueHow much is credited each period.
Max balanceCeiling for the subsidised balance.
Cumulative creditOn: the previous balance adds up to the top-up. Off: it replaces it.
Consumption daysOptional. Days when dispensing is allowed.

EAS profile

FieldPurpose
ProductsAllowed products, each with a quantity per period (or unlimited).
PeriodWindow that quantity applies to.
Time between deliveriesMinimum wait between two deliveries of the same product.
Consumption daysOptional, same as vending.
"Returnable" is not set on the profile

Whether a product is returnable or restricts delivery is an attribute of the product, not the profile.

Authorised devices: an explicit list

The profile carries the list of devices where it may dispense. On creation the app checks every device of the account for that line, and you uncheck what does not apply; there is a shortcut to check or uncheck a whole operation, but what gets saved are the devices.

Two consequences:

  • A device installed later is not added automatically. You must edit the profile and check it.
  • With no device checked, the profile dispenses nowhere, even while active.

Code ↔ profile: same account

The only pairing rule is the account: the profile must belong to the user's account. Otherwise the server answers The profile does not belong to the user's account. The code's level (account or operation) does not constrain which profile you may assign.

How a delivery gets authorised

  1. The user presents the code at a device.
  2. The device determines the business line; the code needs a profile for that line.
  3. That device must be in the profile's authorised devices list.
  4. If the code is operation-level, the device must belong to that operation.
  5. If consumption days are configured, today must be enabled.
  6. Vending: enough credit for the price. EAS: remaining quota and the time between deliveries elapsed.
  7. User and code must be active, and so must the profile.

If anything fails, the attempt is recorded in Failed deliveries with its reason.