Conditions Reference
2 min read
Conditions are the filters that determine whether a rule’s actions fire. Each condition is a comparison against a field — typically a customer attribute, order property, or event-specific value. Conditions combine with AND logic; all must be true for the rule to act. This page lists every condition field available, the comparison operators each supports, and example expressions.
Anatomy of a Condition #
A condition has three parts:
- Field — what to compare. E.g.
trust_score,order.total,customer.segment - Operator — how to compare. E.g.
>,=,in,contains - Value — what to compare against. E.g.
30,"vip",["risk", "critical"]
Example: trust_score < 30 — true when the customer’s score is below 30.
Customer Fields #
| Field | Type | Operators |
|---|---|---|
trust_score |
integer 0–100 | =, ≠, <, ≤, >, ≥ |
segment |
enum (vip / trusted / normal / caution / risk / critical) | =, ≠, in, not in |
is_allowlisted |
boolean | = |
is_blocked |
boolean | = |
total_orders |
integer | =, ≠, <, ≤, >, ≥ |
total_order_value |
decimal | =, ≠, <, ≤, >, ≥ |
total_refunds |
integer | =, ≠, <, ≤, >, ≥ |
total_refund_value |
decimal | =, ≠, <, ≤, >, ≥ |
return_rate |
decimal 0–100 | =, ≠, <, ≤, >, ≥ |
full_refunds |
integer | =, ≠, <, ≤, >, ≥ |
cancelled_orders |
integer | =, ≠, <, ≤, >, ≥ |
total_disputes |
integer | =, ≠, <, ≤, >, ≥ |
disputes_won |
integer | =, ≠, <, ≤, >, ≥ |
disputes_lost |
integer | =, ≠, <, ≤, >, ≥ |
total_coupons_used |
integer | =, ≠, <, ≤, >, ≥ |
first_order_coupons |
integer | =, ≠, <, ≤, >, ≥ |
coupon_then_refund |
integer | =, ≠, <, ≤, >, ≥ |
linked_accounts_count |
integer | =, ≠, <, ≤, >, ≥ |
account_age_days |
integer | =, ≠, <, ≤, >, ≥ |
days_since_last_order |
integer | =, ≠, <, ≤, >, ≥ |
Order Fields #
Available in order-trigger contexts.
| Field | Type | Operators |
|---|---|---|
order.total |
decimal | =, ≠, <, ≤, >, ≥ |
order.subtotal |
decimal | =, ≠, <, ≤, >, ≥ |
order.shipping_total |
decimal | =, ≠, <, ≤, >, ≥ |
order.tax_total |
decimal | =, ≠, <, ≤, >, ≥ |
order.coupon_total |
decimal | =, ≠, <, ≤, >, ≥ |
order.item_count |
integer | =, ≠, <, ≤, >, ≥ |
order.payment_method |
string (stripe / paypal / etc.) | =, in, not in |
order.shipping_country |
string (ISO-2) | =, in, not in |
order.billing_country |
string | =, in, not in |
order.country_mismatch |
boolean | = |
order.has_coupon |
boolean | = |
order.status |
enum | =, in, not in |
Dispute Fields #
Available in chargeback-trigger contexts.
| Field | Type | Operators |
|---|---|---|
dispute.brand |
enum (visa / mastercard / amex / discover / other) | =, in, not in |
dispute.amount |
decimal | =, ≠, <, ≤, >, ≥ |
dispute.reason |
string | =, contains, starts with |
dispute.status |
enum (open / under_review / won / lost / warning) | =, in, not in |
dispute.source |
enum (auto / manual) | = |
Fingerprint Fields #
Available in card-testing-trigger contexts.
| Field | Type | Operators |
|---|---|---|
fingerprint.decline_count_60s |
integer | =, ≠, <, ≤, >, ≥ |
fingerprint.decline_count_10m |
integer | =, ≠, <, ≤, >, ≥ |
fingerprint.is_allowlisted |
boolean | = |
fingerprint.country |
string (ISO-2) | =, in, not in |
Operators in Detail #
Comparison Operators #
=, ≠, <, ≤, >, ≥ — standard. Work on numeric and string fields.
Set Membership #
in, not in — value is a list. Example: dispute.brand in [visa, mastercard].
String Operators #
contains — substring match. starts with — prefix match. ends with — suffix match. Case-insensitive by default.
Boolean #
Just =. Example: is_blocked = false.
Multi-Condition Logic #
Conditions combine with AND only — all must be true for the rule to act. There’s no OR or grouped boolean logic at the rule level.
To express OR logic, create multiple rules with the same actions. Example: “block if score < 30 OR if disputes ≥ 2” becomes two rules, each with one condition, both with the same Block action.
Example Condition Sets #
| Intent | Conditions |
|---|---|
| “Critical customer placing high-value order” | segment = critical AND order.total > 500 |
| “Risk customer using international shipping” | segment = risk AND order.country_mismatch = true |
| “Customer at chargeback threshold” | total_disputes >= 2 AND disputes_lost >= 1 |
| “New customer with first-order coupon abuse” | total_orders < 5 AND first_order_coupons >= 2 |
| “Recently-card-tested fingerprint completing order” | customer.has_recent_card_testing_signal = true |
| “VIP placing unusually large order” | segment = vip AND order.total > 3 * customer.avg_order_value |
The Save-Time Validator and Conditions #
When you save a rule with conditions, the validator checks:
- Each field is valid for the rule’s trigger context
- Each operator is valid for the field’s type
- The combined conditions are satisfiable (no contradictions like
trust_score > 80 AND trust_score < 20) - The rule has at least one condition (or is explicitly marked “no conditions — fire on every trigger event”)
Invalid rules fail to save with a specific error message.
Performance #
Conditions evaluate against in-memory data — the trigger context plus the customer record (already fetched for the trigger event). Each condition is sub-millisecond. Even rules with 10+ conditions evaluate in under 10ms.
The engine is bound by trigger volume, not condition complexity.