Risk-Tiered Checkout Friction: Routing Orders to AVS, 3DS, or Review
Many card checkouts run every order through the same checks. One CVV rule, one AVS rule, one fraud score cutoff, and sometimes a 3-D Secure challenge on everything. That is simple to build. It also means your safest repe
Many card checkouts run every order through the same checks. One CVV rule, one AVS rule, one fraud score cutoff, and sometimes a 3-D Secure challenge on everything. That is simple to build. It also means your safest repeat customer gets the same friction as a first-time buyer shipping a gaming laptop to a freight forwarder.
The alternative is to match friction to risk. Low-risk orders pass with checks the buyer never sees. Medium-risk orders get a step-up challenge. Only the clearly suspicious ones get held or declined. The idea gets a brief mention in the broader discussion of eCommerce conversion optimization best practices. This article covers how to actually build it: the data flow, the decision logic, and the ways it tends to break.
The four outcomes
A risk-tiered checkout ends every order in one of four states:
| Outcome | Buyer experience | Cost to you |
|---|---|---|
| Approve | Nothing extra | Fraud exposure if you're wrong |
| Step-up (3DS challenge) | OTP, banking app prompt, or biometric | Some buyers abandon |
| Review | Order held, possibly delayed | Analyst time, slower fulfillment |
| Decline | Payment fails | A lost sale if the buyer was legitimate (a false decline) |
Every outcome has a cost. No single path is "safe." Your goal is to minimize total cost: fraud losses, chargeback fees, and the revenue lost to declines and abandonment.
Cheap signals vs. expensive signals
Sort your checks by who pays the friction cost.
Background signals. The buyer doesn't notice these.
- AVS (Address Verification Service) result returned with the authorization
- CVV/CVC match result
- Device and browser fingerprint
- Velocity, such as cards per device or orders per email in the last 24 hours
- Account age and prior successful orders
- Mismatch between IP geolocation, billing country, and shipping country
- Order shape: basket value, resale-friendly SKUs, expedited shipping
Foreground signals. These add friction.
- 3-D Secure challenge (EMV 3DS)
- Manual review
- Requests for extra documentation
The design principle: spend background signals freely, and spend foreground signals only where background signals leave real uncertainty.
Data flow: where each check actually happens
A common source of bugs is getting the order of operations wrong. AVS and CVV results come back with the authorization response. 3DS happens before authorization. So your decision logic has two phases.
Checkout submit
│
▼
[Phase 1: pre-auth score] ← device, velocity, account, order shape, geo
│
├── score very high ──────────► Decline (no auth attempt)
├── score medium ─────────────► Request 3DS challenge
└── score low ────────────────► Request 3DS frictionless or skip 3DS
│
▼
Authorization (auth-only, no capture)
│ returns: approval code, AVS result, CVV result
▼
[Phase 2: post-auth evaluation] ← combine Phase 1 score + AVS/CVV
│
├── clean ───────► Capture
├── ambiguous ───► Queue for review (keep auth open)
└── bad ─────────► Void authorization
Two details matter here:
- Authorize first, capture later. If you capture immediately, a bad AVS/CVV result means issuing a refund instead of a void. Refunds cost more, and they can confuse the buyer's bank statement.
- The issuer has a say. With 3DS2, you send data to the issuer and it may decide to challenge or go frictionless regardless of your preference. Your code has to handle both responses on every path.
A decision table you can start from
AVS and CVV return codes vary by network and processor, so normalize them into a few categories first.
| Pre-auth risk | AVS | CVV | Action |
|---|---|---|---|
| Low | Full / partial match | Match | Capture |
| Low | Unavailable / not supported | Match | Capture |
| Low | No match | Match | Review if high-value, else capture |
| Any | Any | No match | Void (or step-up and retry) |
| Medium | Any | Match | 3DS challenge before auth |
| Medium | No match | Match | 3DS challenge + review |
| High | Any | Any | Decline pre-auth or review |
Note the second row. "AVS unavailable" is not a failure. AVS support is concentrated in a handful of countries. If you treat "unavailable" as "no match," you will decline a large share of your international customers.
Implementation sketch
Here is a minimal Python version of the two-phase router. Thresholds are placeholders. You tune them against your own data.
from dataclasses import dataclass
from enum import Enum
class Action(Enum):
APPROVE = "approve"
CHALLENGE = "challenge"
REVIEW = "review"
DECLINE = "decline"
class AvsResult(Enum):
MATCH = "match"
PARTIAL = "partial"
NO_MATCH = "no_match"
UNAVAILABLE = "unavailable"
@dataclass
class PreAuthContext:
risk_score: float # 0.0–1.0 from your model or rules
order_value: float
returning_customer: bool
LOW, HIGH = 0.3, 0.8
HIGH_VALUE = 500.0
def pre_auth_route(ctx: PreAuthContext) -> Action:
if ctx.risk_score >= HIGH:
return Action.DECLINE if not ctx.returning_customer else Action.REVIEW
if ctx.risk_score >= LOW:
return Action.CHALLENGE
return Action.APPROVE # still send 3DS data for frictionless if available
def post_auth_route(ctx: PreAuthContext, avs: AvsResult, cvv_match: bool,
authenticated_3ds: bool) -> Action:
if not cvv_match:
return Action.DECLINE # void the auth
if avs == AvsResult.NO_MATCH:
if authenticated_3ds:
return Action.APPROVE
if ctx.order_value >= HIGH_VALUE or ctx.risk_score >= LOW:
return Action.REVIEW
return Action.APPROVE
In production, also persist the inputs and the decision for every order:
log_decision(order_id, phase="post_auth", inputs={
"risk_score": ctx.risk_score, "avs": avs.value,
"cvv": cvv_match, "3ds": authenticated_3ds,
}, action=action.value, rule_version="2024-06-01")
Without this log, you cannot tune thresholds later. You also cannot explain a decision when a customer or a dispute analyst asks.
Worked example: three orders, one router
Order A. Returning customer, $42, same device as the last five orders, AVS full match, CVV match. Pre-auth score 0.08 → no challenge requested. Post-auth: clean → capture. The buyer sees nothing extra.
Order B. New account, $310. The billing country differs from the IP country, and the shipping address is new. Pre-auth score 0.52 → request a 3DS challenge. The buyer approves in their banking app. Auth returns AVS no match, CVV match. Because 3DS authenticated, the router approves. This is the case a single strict AVS rule would have declined.
Order C. New account, $1,450, four different cards tried from the same device in ten minutes. Pre-auth score 0.91 → decline before authorization. You never send the auth, so the attempt doesn't show up against your authorization metrics.
That is three different levels of friction, each matched to the evidence.
Measuring whether it works
You need metrics per tier, not just overall totals:
- Challenge rate and challenge abandonment rate. If abandonment is high, your medium band is too wide.
- Review queue rate and review approval rate. If analysts approve nearly everything, those orders didn't need review.
- Fraud/chargeback rate by tier. Chargebacks in the "approve" tier mean your low threshold is too loose.
- Decline rate, plus an estimate of false declines. Track declined buyers who retry successfully with another card or contact support.
One trap is label delay. Chargebacks can arrive weeks or months after the order. If you tune thresholds on last week's data, the recent "approve" tier will look cleaner than it really is. Evaluate on cohorts old enough for disputes to have matured.
To estimate false declines directly, some teams use a small holdout: a tiny, capped slice of borderline orders that would have been declined goes to review instead. The approval outcomes show how many good buyers your decline rule was catching. Keep the slice small and the dollar cap strict.
Common mistakes and how to catch them
Treating AVS "unavailable" as a failure. Catch it by segmenting decline rate by billing country. A spike outside AVS-supporting regions is the tell.
Challenging everything with 3DS. This is safe but expensive in abandonment. Catch it by checking whether the challenge rate is close to 100% and whether conversion for challenged sessions trails unchallenged ones.
Capturing before evaluating AVS/CVV. You'll see refunds where voids should be. Audit for orders refunded within minutes of capture.
Ignoring issuer overrides. You asked for frictionless, but the issuer challenged anyway (or the reverse). Make sure both 3DS paths are covered by integration tests in your processor's sandbox.
Rules with no version. When fraud spikes, you need to know which rule set was live. Stamp every decision with rule_version.
Non-idempotent retries. A timeout on auth followed by a retry can create duplicate authorizations. Use your processor's idempotency key mechanism on every auth and capture call.
Optimizing one metric in isolation. Lowering the review threshold may cut chargebacks while quietly raising false declines. Always review fraud loss and declined revenue side by side.
Wrapping up
Risk-tiered friction isn't a single model or vendor feature. It's a routing problem with two decision points, pre-auth and post-auth, plus a feedback loop that matures slowly. Get the ordering right, normalize your AVS/CVV codes, log every decision with its inputs, and measure each tier on its own. Then the checkout gets easier for good buyers and harder for bad ones, which is the point.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.