
Payment Gateway Fraud Prevention: How to Detect Risky Transactions Before You Approve Them
Introduction
Every online payment passes through a short window between the moment a customer clicks "Pay" and the moment your gateway sends the authorization request. That window lasts a fraction of a second, and it is the most valuable moment in your entire fraud program. Once a stolen card is authorized and the order ships, your options shrink to refunds, disputes, and chargeback fees. Before authorization, you still have every option: approve, add a verification step, or decline.
Payment gateway fraud prevention is the practice of using that window well. Instead of passing every transaction straight to the card networks and hoping the issuer catches problems, you score the transaction yourself using the signals your checkout already collects: the card BIN, the customer IP address, the email, the billing and shipping addresses, the device, and how often the same details have appeared recently. This guide explains how payment gateway fraud detection works, which signals matter most, and how to turn a risk score into clear approve, review, and decline decisions without hurting conversion. The scale of the problem explains why this matters.
According to the Nilson Report, payment card fraud losses worldwide were $33.41 billion in 2024, and the US accounted for 41.87% of global fraud losses while generating only 26.31% of worldwide card volume, largely because online purchases are more susceptible to fraud.
GlobeNewswire: Global Card Fraud Losses at $33 Billion (Nilson Report)
Stop Fraud at the Gateway, Where It Is Cheapest to Stop
Fraud gets more expensive at every step it survives. A fraudulent order that is authorized costs you the goods, the shipping, the payment processing fee, and often a chargeback fee on top. Enough chargebacks can push your merchant account into a monitoring program with the card networks, which brings higher fees and, in the worst case, the loss of your ability to accept cards.
Scoring at the gateway flips that math. A single API call before authorization costs a few milliseconds and a fraction of a cent, and it lets you stop a bad transaction before it creates any of those downstream costs. For platforms that process payments on behalf of many merchants, it also protects your reputation with acquirers, because the fraud never reaches them.
Score Every Transaction Before You Approve It
The core idea of payment gateway fraud detection is simple: every transaction gets a risk score before it is sent for authorization. Greip's Payment Fraud Detection API takes the details of a checkout and returns:
- A score from 0 to 100. Higher means riskier. A score of 10.5 means the transaction is roughly 10.5% risky to pass.
- A risk level. Low, medium, or high, so you do not have to invent your own bands on day one.
- A recommendation. Accept, review, or reject, derived from the risk assessment.
- The rules that fired. Each detected rule has an id and a plain description, so you always know why a transaction was flagged.
- Velocity counts. How many scored payments shared the same IP, email, or phone in the last 24 hours and 7 days.
This is the difference between a gateway that only knows whether a card was approved and one that knows whether the transaction should have been sent for approval at all.
Know Exactly What Your Gateway Is Looking At
Good payment fraud prevention solutions look at the whole transaction, not just the card. The more context you send, the more accurate the score. The Greip payment endpoint accepts a wide range of fields, grouped into a few families:
- Transaction details. Action type (purchase, deposit, or withdrawal), amount, currency, cart items, coupon, and whether the products are digital.
- Customer identity. Customer id, name, email, phone, date of birth, registration date, and whether two-factor authentication is enabled.
- Connection and device. Customer IP address, device id, and user agent.
- Addresses. Billing and shipping country, region, city, zip, and street.
- Payment method. Payment type, cardholder name, card number (at least the first 6 digits), expiry, and the CVV result.
- Merchant context. Website domain, website name, and a merchant id for platforms with many sub-merchants.
You do not need every field to get value, but each extra signal makes it harder for a fraudster to look normal across all of them at once.
Catch Card Testing With Velocity Signals
Card testing is one of the most common attacks on payment gateways. Fraudsters buy lists of stolen card numbers and run small transactions to find out which ones still work. The pattern is volume: many attempts from the same IP address, the same email, or the same customer account in a short time.
The velocity block in the response counts recent scored payments that share the customer IP, email, or phone over the last 24 hours and the last 7 days, scoped to the same merchant. Velocity counts appear when you include a customer id in the payment data. A customer who has paid twice this week looks normal. An IP address that has submitted dozens of payments with different cards in a day does not, and rules for high purchase rates by IP and by customer id will show up in the rules list.
Watch velocity on declines, not just approvals. Card testers generate lots of failed attempts before they find a working card, so a burst of declines from one IP is often the earliest warning you get.
Verify the Card Itself With BIN Data
The first 6 to 8 digits of a card, the BIN or IIN, tell you a lot before any money moves: the card scheme, whether it is debit, credit, prepaid, or commercial, the issuing bank, and the issuing country. Greip's BIN / IIN Lookup endpoint returns these details in a single request, along with structural validation and whether the BIN is on your blocklists.
That data supports practical gateway rules. Prepaid cards are popular for fraud and promo abuse, so you might add friction to prepaid cards on high-value orders. A BIN that fails structural validation is an easy reject. And if you see a run of attempts from the same BIN range, that is a classic sign of a BIN attack. Greip's BIN lookup service covers these use cases in more detail.
Flag Mismatches Between Card, IP, and Billing Country
One of the most reliable checkout signals is a mismatch between where the card was issued, where the customer is connecting from, and where they say they live. A card issued in one country, a billing address in a second, and an IP address in a third is not automatically fraud, since people travel and use VPNs, but it deserves a closer look.
The Greip docs recommend this exact pattern: compare the card issuer country from the BIN lookup with the country of the customer IP address, and treat a mismatch as a potential sign of fraud. The payment endpoint also checks whether the customer IP looks like a VPN, proxy, bot, hosting, or cloud connection, which is a common way fraudsters hide their real location.
A Technical Look at the Payment Fraud Detection Response
Here is the sample success response from the Greip docs for a high-risk transaction:
{
"success": true,
"data": {
"score": 82,
"risk_level": "high",
"recommendation": "review",
"rules": [
{
"id": "PF10003",
"description": "Customer IP Address is probably VPN/Proxy/Bot/Hosting/Cloud."
},
{
"id": "PF10004",
"description": "Customer Email Address is probably invalid or spam."
},
{
"id": "PF10001",
"description": "High purchase rate, according to `customer_ip`."
},
{
"id": "PF10002",
"description": "High purchase rate, according to `customer_id`."
},
{
"id": "PF10013",
"description": "Customer device might not be a real device (according to `customer_useragent`)."
},
{
"id": "PF10014",
"description": "Customer device is registered as a high-risk device (according to `customer_useragent`)."
}
],
"rules_checked": 21,
"rules_detected": 6,
"velocity": {
"ip_24h_count": 4,
"ip_7d_count": 12,
"email_24h_count": 1,
"email_7d_count": 2,
"phone_24h_count": 0,
"phone_7d_count": 3
},
"custom_rules_applied": { "total": 0, "rules": [] }
},
"execution_ms": 5
}Six of 21 rules fired: the IP looks like a VPN or hosting connection, the email looks invalid or spammy, the purchase rate is high for both the IP and the customer, and the device looks suspicious. Any one of these alone might be explainable. Together, they make a strong case for holding the transaction before authorization.
Score Your First Checkout in Minutes
The endpoint is a POST request to https://v2.greipapi.com/score/payments. API v2 accepts your key only in the Authorization header as a Bearer token. Send the transaction fields inside a data object and use test mode while you build:
curl -s -X POST "https://v2.greipapi.com/score/payments" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"mode": "test",
"data": {
"action": "purchase",
"website_domain": "shop.example.com",
"transaction_id": "TX-100245",
"transaction_amount": 249.99,
"transaction_currency": "USD",
"customer_id": "C-88213",
"customer_email": "buyer@example.com",
"customer_ip": "203.0.113.24",
"customer_useragent": "Mozilla/5.0",
"billing_country": "US",
"shipping_country": "US",
"payment_type": "cards",
"card_number": "456789",
"cvv_result": true
}
}'In a Node.js checkout service, run the score right before you call your payment processor and route on the recommendation:
async function scoreCheckout(order) {
const res = await fetch("https://v2.greipapi.com/score/payments", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.GREIP_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
mode: "test",
data: {
action: "purchase",
website_domain: order.siteDomain,
transaction_id: order.id,
transaction_amount: order.total,
transaction_currency: order.currency,
customer_id: order.customerId,
customer_email: order.email,
customer_ip: order.ip,
customer_useragent: order.userAgent,
billing_country: order.billingCountry,
shipping_country: order.shippingCountry,
payment_type: "cards",
card_number: order.cardBin, // first 6 to 8 digits are enough
cvv_result: order.cvvPassed,
},
}),
});
const json = await res.json();
if (!json.success) {
// Decide whether to fail open or closed for your risk tolerance
return { decision: "review", reason: json.description };
}
const { score, risk_level, recommendation, rules } = json.data;
return {
decision: recommendation, // "accept", "review", or "reject"
score,
riskLevel: risk_level,
reasons: rules.map((r) => r.id),
};
}Run payment scoring on your server, never in the browser. Your API key must stay private, and a client-side check can be tampered with by the same people you are trying to stop.
Route Decisions Into Accept, Review, and Reject
A score is only useful when it maps to an action. A simple routing model works for most gateways:
- Accept. Send the transaction for authorization as normal.
- Review. Add friction before authorization, such as 3-D Secure, a one-time code to the customer's phone, or a manual review queue for high-value orders.
- Reject. Decline before authorization and log the rules that fired.
Start with the recommendation from the API, then tune it for your business. A digital goods store with instant delivery may want to review more aggressively than a store that ships physical goods after a delay, because it has no time to catch a mistake.
Cut False Declines Without Opening the Door to Fraud
Blocking fraud is only half the job. Every legitimate customer you decline is lost revenue and often a lost customer for good. Many gateways decline too much because they rely on a few blunt rules, such as blocking every foreign card.
Risk scoring gives you a middle path. Because each decision comes with a score and a list of rules, you can approve a foreign card when everything else looks clean, and challenge a domestic card when the IP, email, and velocity all look wrong. Sending more context, such as whether the customer has two-factor authentication enabled and when they registered, helps the score separate loyal customers from fresh fraud accounts.
The Payment Fraud Detection endpoint is available on Premium plans and above. The BIN / IIN Lookup endpoint is available on Standard plans and above.
Add Your Own Rules and Blocklists
Every business sees its own fraud patterns. Greip lets you maintain blocklists for IP addresses, emails, email domains, customer ids, customer IP addresses, card BINs, and card countries, and to define custom rules in the dashboard. When a custom rule is applied to a payment request, it is listed in the response so your logs show exactly which of your own rules affected the decision.
This is useful for fast reactions. If a fraud ring starts hitting your checkout with cards from one BIN range, you can block that range in minutes and keep the rest of your scoring logic unchanged.
Choose Payment Fraud Prevention Solutions That Fit Your Gateway
When comparing payment fraud prevention solutions, look past the marketing and check a few practical points:
- Pre-authorization speed. Scoring has to fit inside your checkout latency budget.
- Explainability. You need the rules behind each decision for reviews, disputes, and tuning.
- Signal breadth. Card, IP, email, phone, device, and address data in one call beats stitching together several vendors.
- Velocity built in. Card testing detection should not require you to build your own counters.
- Custom rules. Your team should be able to react to a new attack without waiting for a vendor.
- Test mode. You should be able to integrate and test without affecting live data.
Greip's payment fraud analysis service is built around these needs, combining transaction scoring with BIN, IP, email, and phone intelligence.
Check Suspicious Cards by Hand Before You Automate
Before writing rules, look at real data. Greip's free BIN checker shows the issuer, scheme, card type, and country for any BIN. Pull a sample of recent chargebacks, run their BINs through the tool, and compare the issuer countries with the IP countries from your logs. Patterns usually show up quickly: a handful of prepaid ranges, a cluster of issuer and IP country mismatches, or repeat attempts from the same networks. Those findings become your first automated gateway rules.
Frequently Asked Questions
What is payment gateway fraud prevention?
Payment gateway fraud prevention is the practice of scoring each transaction for fraud risk at checkout, before it is sent for authorization, so you can approve, challenge, or decline it before a stolen card turns into a chargeback.
How does payment gateway fraud detection work with Greip?
Send a POST request to https://v2.greipapi.com/score/payments with the transaction details in a data object and your API key in the Authorization header as a Bearer token. Greip returns a score from 0 to 100, a risk level, an accept, review, or reject recommendation, the rules that fired, and velocity counts.
Which signals matter most for detecting risky transactions?
The strongest signals are high purchase velocity from the same IP, email, or customer, VPN, proxy, or hosting connections, invalid or spammy emails, suspicious devices, and mismatches between the card issuer country, the IP country, and the billing country.
How does BIN lookup help prevent payment fraud?
A BIN lookup reveals the card scheme, type, prepaid status, issuing bank, and issuing country from the first digits of the card. You can use it to reject invalid BINs, add friction to risky card types, and compare the issuer country with the customer IP country.
How can I reduce false declines while blocking fraud?
Use the risk score and rules instead of blunt blanket rules. Route medium-risk transactions to a review step such as 3-D Secure or a one-time code rather than declining them, and send as much customer context as possible so loyal customers score lower.
Should payment fraud scoring run in the browser?
No. Always run scoring on your server so your API key stays private and the result cannot be tampered with.
Which Greip plans include payment fraud detection and BIN lookup?
The Payment Fraud Detection endpoint is available on Premium plans and above, and the BIN / IIN Lookup endpoint is available on Standard plans and above. You can also try individual BIN lookups with the free BIN checker.
Conclusion
The best time to stop a fraudulent payment is before you approve it. Payment gateway fraud prevention gives you that chance by scoring every transaction in the short window before authorization, using the card, IP, email, device, address, and velocity data your checkout already has. Route each transaction to accept, review, or reject, use BIN data to verify the card and catch country mismatches, add your own rules and blocklists for fast reactions, and keep every decision explainable. Start by checking a few recent chargebacks in the free BIN checker, then follow the Payment Fraud Detection docs to score your first transaction with Greip.
Get started
Start protecting your business today
Our service is trusted by thousands of businesses worldwide.
- 1,000 requests during trial
- Cancel anytime