All use cases

scan.is_first

This parcel, the first time

The same code answers differently the first time than the next. is_first is true per code, not per person: exactly once in the life of this label, no matter who scans. That is why the axis works where one code equals one item — on a shipping label. On a door sticker the same rule would be nonsense: exactly one passer-by worldwide would ever get the first branch.

Where it hangs
Parcel label, inner lid, return label.
Why the paper stays
Two QR codes on one label, and the recipient scans the wrong one.

Live resolution

scan.is_first = true
geo.country = USdevice.os = ioslang.primary = en
  1. 1This parcel, first scan
  2. 2This parcel, scanned before
  3. alwaysOtherwise
https://acme.com/setup

First scan of this label?

A cardboard box with a shipping label, carrying the code
The same code on every shot.Parcel label, inner lid, return label.

The ruleset

Valid, storable, mandatory rule last.

Not a description of what the engine could do — this is the text a code carries. The first matching rule wins, and the last one always matches.

ruleset · version 1

{
  "rules": [
    {
      "when": { "scan.is_first": { "eq": true } },
      "then": { "type": "redirect", "url": "https://acme.com/setup" }
    },
    {
      "when": { "scan.is_first": { "eq": false } },
      "then": { "type": "redirect", "url": "https://acme.com/support" }
    },
    {
      "when": "always",
      "then": { "type": "redirect", "url": "https://acme.com/product" }
    }
  ]
}

The third rule catches the case where the counter could not be determined. A scan still does not land in nothing.

Reprinting is the expensive part. Stop doing it.