Rule basics
Ingestion rules are how lrp decides what to do with each receipt as it lands. Every rule is a pair: a when (a trigger) and a then (an action). They run in order — first match wins.
What is a rule?
A rule is a small, declarative if/then statement evaluated against every order that hits your account. The composer sentence reads like:
when vendor matches fcpeuro.com
and subject contains "shipped"
then tag → lifetime
and auto-commit You'll never write that syntax by hand — the editor builds it from chip pickers — but you can read it back anywhere lrp displays a rule.
The order matters
Rules run top to bottom. The first rule whose conditions all match runs its action and stops the chain. This means catch-all rules belong at the bottom and specific rules belong at the top.
Settings → Ingestion → Ingestion rules to reorder. The list re-evaluates the next 100 unprocessed orders against the new order so you can see if anything changed.
Conditions vs. actions
A condition is a question you can ask about an incoming order. An action is what to do if the answer is yes.
subject
amount
part-number (PN)
vehicle
tag
shipping_status
has_attachment
add tag
send to review queue
advance status
discard / match-and-skip
notify (email, sidebar)
chain → multiple actions
The "would-have-matched" preview
Every rule editor has a live panel that runs your draft rule against the last 30 days of your orders before you save. It tells you exactly which historical orders would have triggered the action. Use it to spot rules that are too aggressive (catching everything) or too narrow (catching nothing).
lrp run --rule=N --since=2024-01-01 from the CLI.
Common patterns
Three rules cover 80% of the use cases we see during onboarding:
# 1. tag a vendor's lifetime line as lifetime
when vendor matches fcpeuro.com
then tag → lifetime
# 2. auto-link parts to an active project
when PN matches any vehicle.06_m3
and vendor in (FCP Euro, Pelican, ECS)
then link → "oil change e46 m3 feb 2026"
# 3. require human review for big mystery orders
when amount > $500
and PN is empty
then send to review queue