MeraFraud scores the fraud risk of a transaction in real time and returns a decision: approve, review, or block. This page has everything a developer needs to hook it up.
Sign up at merafraud.com/dashboard/signup.html with your store name and email. You'll get an API key immediately (starts with sk_live_...). Keep it secret — treat it like a password.
Call this endpoint right before you accept a payment (e.g. when the customer clicks "Place Order"):
POST https://merafraud-apimerafraud-api-v2.onrender.com/api/predict
Headers:
Content-Type: application/json
X-API-Key: <your API key>
Body:
{
"transaction_amount": 129.90,
"amount_ratio_to_avg": 1.4,
"account_age_days": 180,
"customer_ltv": 240,
"time_since_last_tx_min": 600,
"num_tx_last_24h": 1,
"hour_of_day": 15,
"num_items_in_cart": 2,
"num_failed_payments_7d": 0,
"login_attempts_before_purchase": 1,
"billing_shipping_mismatch": 0,
"ip_billing_country_mismatch": 0,
"new_device": 0,
"new_payment_method": 0,
"free_email_domain": 0,
"express_shipping": 0
}
All 16 fields above are required — they're the signals the ML model was trained on. If your platform doesn't track one yet, send a reasonable default; accuracy improves as you fill in more real data over time.
{
"risk_score": 0.07,
"risk_level": "approve",
"reasons": ["No strong anomaly detected; score reflects overall pattern"],
"thresholds": { "block": 0.75, "review": 0.35 },
"tenant": "Your Store",
"scored_at": 1753776000.0
}
approve → let the order go through. review → let it through but flag it for a human to double-check. block → don't process the payment.
None of these are required, but each one you add turns on an extra fraud-detection signal:
| Field | What it unlocks |
|---|---|
customer_id | Tracks repeat-cancellation behavior per customer over time |
customer_name | Shows a name (not just an ID) when you look up a customer's history in Settings |
customer_ip | Detects proxy/VPN/datacenter IPs and IP-vs-billing-country mismatches |
customer_phone | Flags malformed/fake-looking phone numbers |
card_bin | First 6–8 digits of the card only (never the full number) — flags card-country vs. billing-country mismatches |
billing_country | ISO 2-letter code (e.g. "TR", "DE") — required for the BIN and postal checks to work |
postal_code | Flags postal codes that don't exist in the claimed country |
billing_city | Flags a postal code that doesn't match the claimed city |
Optional but recommended: when an order is cancelled, fulfilled, or placed, report it so future scores for that same customer get smarter.
POST /api/orders/outcome
{
"customer_id": "customer@example.com",
"outcome": "fulfilled",
"order_id": "1234",
"customer_name": "Jane Doe",
"billing_country": "TR",
"billing_city": "Istanbul"
}
outcome is one of placed, cancelled, fulfilled.
Add the MeraFraud trust badge to your checkout page footer — a small, honest signal that reduces cart-abandonment hesitation.
<img src="merafraud-trust-badge.svg" alt="Protected by MeraFraud" width="240" height="64">
Every endpoint — scoring, custom rules, the fraud network, account management — in machine-readable form for your IDE, Postman, or codegen tool.