Rules and supported checks
An entity condition's rule decides which check actually runs against
it at checkout. Two checks exist:
Age restriction (AGE_RESTRICTION)
Checks the shopper's age against a configured minimum.
- Condition value: a minimum age, e.g.
{ "minimum_age": 18 }. - Denied if the shopper's age is below the minimum.
- Can't be checked yet (soft denial) if the shopper's age isn't known at checkout at all — this is different from the shopper failing the check, and checkout may prompt for the missing information or retry.
License requirement (LICENSE_REQUIREMENT)
Checks whether the shopper holds a given license — for example, a professional license required to buy a restricted product — and, optionally, holds it at or above a minimum level.
- Condition value: the license to check for, and optionally a minimum level, e.g.
{ "license_type": "explosives_se", "minimum_level": 3 }.license_typeis required;minimum_levelis optional and, when set, a whole number of at least 1. - Input: each license the shopper holds, with its type and the level they hold it at.
- Allowed if the shopper holds
license_type— and, whenminimum_levelis set, holds it at that level or higher. - Denied if the shopper doesn't hold the license — including when the shopper is known to hold no licenses at all (an empty list is a definite answer, not a "we don't know yet").
- Denied if the shopper holds the license but not at the minimum level: the level they hold is lower, missing, or not a whole number.
- Can't be checked yet (soft denial) only when license information wasn't supplied at all.
See Decisions and outcomes for the reason codes that tell a missing license apart from an insufficient level.
Things worth knowing
- The condition's id isn't the license.
license_typenames the license, so several conditions can require the same license at different minimum levels — for exampleexplosives_level_2_seandexplosives_level_3_se, both onexplosives_se— and each enforces its own minimum. - Leaving out
minimum_levelaccepts the license at any level, including a license held with no level at all. There's no "minimum 0" — omit the field instead. - Levels are compared as numbers, so
"10"beats"9". A level that isn't a whole number never meets a minimum: the item is denied, not soft-denied. - Any one of the shopper's entries for the license is enough. If they hold it more than once at different levels, the highest one counts.
- A misspelled field in a condition value is rejected when you save the condition
(
400), not silently ignored —minimum_levlewon't quietly become a condition with no minimum.