Overview
Stolen cards and mule bank accounts usually look normal until you compare them with the rest of the session. A card issued in one country, used from an IP in another country, with a billing address in a third, is a common pattern in card testing and account takeover. A bank account that does not exist, or that belongs to a country you never pay out to, is a common pattern in payout fraud. Greip gives you two fast pre-payment checks:- BIN / IIN Lookup returns the card scheme, card type, prepaid and commercial flags, issuing bank, and issuing country from the first digits of a card.
- IBAN Validation checks the IBAN structure and checksum and returns the IBAN country, SEPA and EU flags, and bank details when available.
Where to call Greip in the payment flow
Run these checks on your server, after the customer submits payment details and before you call your payment processor or release a payout. Typical card flow:- Read the first 6 to 8 digits of the card (the BIN) from your card form or your processor’s tokenization response. You do not need to send the full card number.
- Call BIN Lookup and IP Lookup (with
params=security) in parallel. - Compare
data.country.alpha2from BIN Lookup withdata.geo.country_codefrom IP Lookup, and with the billing country you collected. - Map the result to allow, challenge, or block, then call your processor.
- Normalize the IBAN the customer entered (spaces are accepted).
- Call IBAN Validation and IP Lookup in parallel.
- Stop if
data.is_validisfalse. Otherwise comparedata.country.iso3166with the IP country and the customer’s declared country. - Map the result to allow, challenge, or block before you create the mandate or send money.
Request shape
All requests use Bearer auth in theAuthorization header. API v2 does not accept the key in query parameters. See Authentication.
BIN Lookup
IBAN Validation
IP Lookup (for the country comparison)
BIN fields to use before payment
Example BIN response (trimmed):
IBAN fields to use before payment
Example IBAN response (trimmed):
The country mismatch check
Compare the payment instrument’s country with the IP country:- Card:
data.country.alpha2(BIN Lookup) vsdata.geo.country_code(IP Lookup) - IBAN:
data.country.iso3166(IBAN Validation) vsdata.geo.country_code(IP Lookup)
When
data.security.relay is true (for example Apple Private Relay), the IP location reflects the relay egress. Treat a country mismatch on relay traffic as a weaker signal.When to allow, challenge, or block
Treat these as starting points for your own policy, not hard-coded declines:
Combine signals in this order: block first (invalid, blacklisted, Tor, bot, unsupported rail), then challenge (mismatch, VPN or hosting, prepaid on risky orders), then allow.
Example: recommendation-driven decision for one card checkout
This walkthrough is a single card checkout. You already called BIN / IIN Lookup for the card prefix, IP Lookup withparams=security for the shopper IP, and Payment Fraud Detection (POST /score/payments) for the transaction. The BIN issuing country and the IP country differ; the scoring response’s recommendation is what you act on. The amounts and identities below are illustrative only.
Payment Fraud Detection is available on the Premium plan and above. On a plan that does not include this feature, the API returns
success: false with code 117 (feature_not_available).The JSON above is illustrative and shows a subset of the response: the reference success sample on Payment Fraud Detection also includes
velocity and custom_rules_applied, which are omitted here for length. It does not represent a real customer, card, IP address, or API key. In your own tests, use the sample BIN 456789 from the BIN Lookup reference and an IP from the reserved example range 203.0.113.0/24 (for example 203.0.113.44).data.score is a risk-score from 0 to 100 indicating how risky this transaction is (67.2 means it is 67.2% risky to pass this transaction). Map data.recommendation to your checkout step as follows:
accept: Continue to your payment processor and your normal authorization checks.review: Hold the order, readdata.rulesand your BIN and IP lookup results, then decide whether to authorize.reject: Do not authorize the payment.
recommendation is the API’s own suggested action for the transaction (accept, review, or reject). It is derived from the risk assessment together with risk_level; you do not need to invent score cut-offs or map score bands to actions yourself.
The lookup endpoints return lookup data only; they have no recommendation field. Use data.country.alpha2 from BIN / IIN Lookup, data.country.iso3166 from IBAN Validation on bank-account flows, and data.geo.country_code from IP Lookup with params=security. Differing countries are evidence you weigh in your own policy, not a Greip rule id; when you score the transaction, the documented request fields customer_ip, customer_country, billing_country, and shipping_country on Payment Fraud Detection carry the same facts the lookups returned, and you should read data.rules for what the model flagged on that request (the rules in the sample above are the model’s own flags and need not name the country pair).
Read recommendation from the Payment Scoring response, and use the BIN, IBAN, and IP country fields as the evidence behind it.
Example: card BIN vs IP country
Example: IBAN vs IP country
action to your payment flow:
- allow: continue to authorization, mandate creation, or payout.
- challenge: run 3-D Secure for cards, or a payee verification or confirmation step for bank accounts. Hold the payment for review when
reviewis set or the step-up fails. - block: show a generic message, ask for a different payment method, and log the masked instrument and signals for your analysts. Never log full card numbers or full IBANs.
Related guides
- VPN/Proxy at checkout: IP security signals and the challenge versus block policy used above.
- Payment Fraud: full transaction scoring with Payment Fraud Detection.
- Chargeback Fraud: post-authorization patterns and BIN country checks.
- Blacklists: block card BINs or card countries you never want to accept.