Skip to content

Risk & fraud

Fraud scoring, sanctions (OFAC) screening, device/IP fingerprinting and identity verification (KYC) behind one risk API.

1. Overview

Base path: https://api.infrai.cc/v1/risk
Auth header: Authorization: Bearer $INFRAI_API_KEY
bash
# Call any /v1/risk capability over raw HTTP — no SDK to install.
# curl:
curl https://api.infrai.cc/v1/risk/... \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json"

2. Methods (3)

2.1risk.score

POST /v1/risk/score

Score a user/account event (login, payment, signup) for fraud and abuse risk, returning a normalized 0..1 score plus an accept / review / reject disposition. Billable work-action, ML high-margin (service_markup).

Parameters

NameTypeRequiredDescription
subject_idstringOptionalUser / account id under evaluation.
event_typestringOptionalThe event being scored / reported.
default: "login"e.g. login
ipstringOptionalOriginating IP address.
format: ipv4
emailstringOptionalEmail address associated with the subject.
format: email
device_fingerprintstringOptionalDevice fingerprint / visitor id.
amountnumberOptionalTransaction amount.
≥ 0
currencystringOptionalISO currency code for the amount.
3–3 chars
propertiesRecord<string, unknown>OptionalArbitrary signal properties.
vendor"maxmind" | "sift" | "shumei" | "tongdun"OptionalExplicit vendor pin.
idempotency_keystringOptionalClient-supplied key to make the call idempotent.

Returns

RiskScore { score, decision, reasons: string[] }
NameTypeDescription
vendorstringVendor that handled or will handle this request
scorenumbernormalized risk score, higher = riskier
0–1
disposition"accept" | "review" | "reject"Risk assessment disposition (allow, challenge, deny)
score_idstringUnique identifier for this risk score
reasonsstring[]List of reasons contributing to the risk score

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/risk/score \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

2.2risk.device.fingerprint

POST /v1/risk/device/fingerprint

Resolve a stable device fingerprint / visitor id from a client-collected token plus IP and user-agent signals, for bot and incognito detection. Served by a vendor (sift / castle).

Parameters

NameTypeRequiredDescription
request_tokenstringOptionalClient-collected token / visitor id.
ipstringOptionalOriginating IP address.
user_agentstringOptionalClient user-agent string.
propertiesRecord<string, unknown>OptionalArbitrary signal properties.

Returns

Device { device_id, signals: object }
NameTypeDescription
okbooleanWhether the fingerprint was processed
fingerprint_hashstring | nullHash of the device fingerprint
risk_scorenumber | nullRisk score for this device (0-1)

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/risk/device/fingerprint \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

2.3risk.event.report

POST /v1/risk/event/report

Report a risk-relevant event or label (chargeback, fraud, abuse) back to the vendor as feedback to improve future scoring.

Parameters

NameTypeRequiredDescription
subject_idstringOptionalUser / account id under evaluation.
event_typestring
Required
The event being scored / reported.
e.g. chargeback
label"fraud" | "not_fraud"OptionalOutcome label — fraud, legit or chargeback.
reasonstringOptionalFree-text reason for the report.
propertiesRecord<string, unknown>OptionalArbitrary signal properties.

Returns

{ ok: boolean }
NameTypeDescription
okbooleanWhether the event was recorded
event_idstring | nullUnique identifier for the recorded event

Example

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
curl -X POST https://api.infrai.cc/v1/risk/event/report \
  -H "Authorization: Bearer $INFRAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"event_type": "sample"}'
Advanced: pin a vendor

By default infrai routes each call to the best available provider — you do not pick a vendor. As an escape hatch, this capability accepts an optional vendor parameter to pin one specific provider. Every live vendor for this capability is available in real time from the discovery endpoint for the capability id — see the discovery API.

GET /v1/discovery/{capability}

risk.score

3. All capabilities

Every routed capability in this module — the complete public REST contract. The methods above are the guided walkthrough; this index is the full reference.

risk.device.fingerprintPOST /v1/risk/device/fingerprint

Resolve a stable device fingerprint / visitor id from a client-collected token plus IP and user-agent signals, for bot and incognito detection. Served by a vendor (sift).

Parameters (4)
NameTypeRequiredDescription
request_tokenstringOptionalclient-collected token / visitor id
ipstringOptionalIP address from which the session was created
user_agentstringOptionalUser-Agent string of the client
propertiesobjectOptionalAdditional properties for risk assessment
risk.event.reportPOST /v1/risk/event/report

Report a risk-relevant event or label (chargeback, fraud, abuse) back to the vendor as feedback to improve future scoring.

Parameters (5)
NameTypeRequiredDescription
subject_idstringOptionalIdentifier of the subject being risk-scored
event_typestringRequiredType of risk event (e.g. login, payment, registration)
e.g. chargeback
label"fraud" | "not_fraud"OptionalRisk label (e.g. low, medium, high)
reasonstringOptionalReason for the current state or action
propertiesobjectOptionalAdditional properties for risk assessment
risk.scorePOST /v1/risk/score

Score a user/account event (login, payment, signup) for fraud and abuse risk, returning a normalized 0..1 score plus an accept / review / reject disposition. Billable work-action, ML high-margin (service_markup).

Parameters (10)
NameTypeRequiredDescription
subject_idstringOptionaluser/account id under evaluation
event_typestringOptionalType of risk event (e.g. login, payment, registration)
default: "login"e.g. login
ipstringOptionalIP address from which the session was created
format: ipv4
emailstringOptionalEmail address
format: email
device_fingerprintstringOptionalDevice fingerprint hash for identity tracking
amountnumberOptionalMonetary amount in the specified currency
≥ 0
currencystringOptionalISO 4217 currency code (e.g. USD, CNY)
3–3 chars
propertiesobjectOptionalAdditional properties for risk assessment
vendor"maxmind" | "sift" | "shumei" | "tongdun"OptionalVendor that handled or will handle this request
idempotency_keystringOptionalClient-provided idempotency key; prevents duplicate execution on retry

4. End-to-end example

A production-style walkthrough of this module: configure once, then run the flow. It exercises most of the module's APIs.

One-time prep (each example is assumed to be complete):

bash
# No SDK to install — every call is a plain HTTPS request.
# Get a project key by signing in at https://infrai.cc/login (Google/GitHub gives
# you $2 free credit; email sign-in starts at $0). On 402 INSUFFICIENT_CREDIT, add
# funds at https://infrai.cc/billing (or POST /v1/account/topup and open the
# returned checkout_url).
export INFRAI_API_KEY="ifr_..."
bash
# 1) Auth: every call is a raw HTTPS request to the Infrai gateway carrying
#    only your project key. No SDK, no install.
#    Get your key: sign in with Google/GitHub at https://infrai.cc/login for a
#    project key + $2 free credit (email sign-in starts at $0). On 402
#    INSUFFICIENT_CREDIT, add funds at https://infrai.cc/billing (or POST
#    /v1/account/topup and open the returned checkout_url).
export INFRAI_API_KEY="ifr_..."   # from https://infrai.cc/login

5. Developer guides

Move from endpoint details to complete workflows, production patterns and troubleshooting guides verified against the live API.

Risk & fraud developer guides