Skip to content
OnCharge.io
View as Markdown
Developer docs

Risk engine

Every OnCharge checkout is screened before the card is submitted. The checkout page collects signals, OnCharge scores the attempt from 0 (low risk) to 100 (high risk), and your store's risk policy decides whether the payment goes ahead, needs an extra step, or is blocked. You do not need to integrate anything for screening to run; this page explains what happens and how to tune it.

Signals#

SignalWhat it looks at
Bot checkAn invisible browser challenge score on the checkout page.
IP intelligenceVPN, Tor, proxy and data-centre (hosting) networks; IP country.
Email checkInvalid and disposable email addresses.
Phone checkInvalid numbers and VoIP lines.
Automation flagsHeadless browsers and automation tools.
TimingCheckouts completed faster than a person could.
VelocityAttempts from the same IP or email in the last 5 minutes, hour and day.
Network reputationPayment, refund and chargeback history of the same email or phone across OnCharge merchants (identifiers are stored only as keyed hashes).

Decisions#

DecisionWhat happens
allowThe payment goes ahead.
step_upThe shopper completes extra steps first, such as an SMS code, accepting terms, a signature or 3-D Secure.
reviewTreated as a step-up; an SMS code is required if your policy says so.
denyThe payment is blocked with a generic message.

With the default thresholds, a score of 30 or less is allowed, 31 to 59 is review, 60 to 79 is a step-up with an SMS code (or review if require_otp_on_review is off), and 80 or more is denied. Some signals decide directly, whatever the score: by default a headless browser is denied, and VPN or Tor traffic, data-centre networks and disposable emails get a step-up.

Monitor vs. enforce. In monitor mode (the default) every decision is recorded but payments are never blocked by the score; use it to see what the engine would do. Switch to enforce when you are happy with the results.

Shared blocklist#

When a shopper is banned (for example after a chargeback), their email and phone are blocked across OnCharge. A session created for a banned shopper fails with 403 global_ban, and the message is safe to show the shopper. Identifiers are stored only as keyed hashes; the shopper is never told which store or reason caused the ban.

Your store's policy#

Read and change the policy with the API (GET and PUT /api/v1/risk/policies):

Default policy
{
  "mode": "monitor",
  "thresholds": { "score_allow": 30, "score_review": 60, "score_deny": 80 },
  "step_up_rules": {
    "require_otp_on_review": true,
    "require_signature": true,
    "require_terms": true,
    "force_3ds_above": 70
  },
  "blocks": {
    "vpn_tor": "step_up",
    "datacenter_asn": "step_up",
    "disposable_email": "step_up",
    "voip_phone": "allow",
    "high_risk_countries": [],
    "headless_browser": "deny"
  },
  "velocity_limits": { "ip_5m": 5, "ip_1h": 15, "ip_24h": 50, "email_5m": 3, "email_1h": 10, "email_24h": 30 }
}
  • Each section you send to PUT replaces that section; sections you leave out stay as they are.
  • Thresholds must satisfy score_allow < score_review < score_deny.
  • blocks values are allow, step_up or deny; high_risk_countries takes ISO country codes.

Before changing the policy, replay a past decision under the new policy with POST /api/v1/risk/simulate. Nothing is saved.

Decisions and feedback#

The session's risk_decision (accept, review or reject) and risk_score are also on GET /api/v1/checkout/sessions/{id}.