Fraud Buster API - Quick Start Guide
Quick Start Guide for Hive Forensics AI's Fraud Buster API
Overview
Welcome to the Fraud Buster API section. This guide provides step-by-step instructions to integrate Hive Forensics AI’s Fraud Buster API into your applications. It helps detect and prevent online transaction fraud with ease, supporting both React and Node.js environments through the fraud-buster-client package.
Content
- Introduction: Overview of the Fraud Buster API.
- API Setup: Steps to configure your API environment.
- API Usage: Examples using the fraud-buster-client package in React and Node.js.
- Response Handling: How to interpret API responses.
- FAQ: Frequently Asked Questions.
Getting Started
Step 1: Introduction
The Fraud Buster API evaluates online transactions and detects fraudulent activities based on various indicators. It returns a risk score that helps you make informed decisions to prevent fraud.
Step 2: API Setup
-
Install Required Tools:
- Node.js for JavaScript and React development.
- A code editor (e.g., VSCode).
-
Install the Package:
Add the fraud-buster-client package using npm:npm install fraud-buster-client
-
Obtain Your API Key:
Get your API key from the Hive Forensics AI Portal. This key is required for authentication. -
Environment Variables:
Create a.env
file in your project root:React Example:
REACT_APP_FRAUD_BUSTER_URL=http://localhost:8000/api/transaction REACT_APP_API_KEY=your-api-key-here
Node.js Example:
FRAUD_BUSTER_URL=http://localhost:8000/api/transaction API_KEY=your-api-key-here
Step 3: Configuration
-
React Configuration:
import FraudBusterClient from 'fraud-buster-client'; const fraudClient = new FraudBusterClient({ apiKey: process.env.REACT_APP_API_KEY, });
-
Node.js Configuration:
const FraudBusterClient = require('fraud-buster-client'); const fraudClient = new FraudBusterClient({ apiKey: process.env.API_KEY, apiUrl: process.env.FRAUD_BUSTER_URL, });
Step 4: API Usage
Endpoint
POST /api/transaction
Headers:
{
"Content-Type": "application/json",
"x-api-key": "YOUR_API_KEY"
}
Request Payload Example:
{
"product": "Rolex Watch",
"amount": 9500,
"location": "Florida",
"time": "2024-03-04T10:30:00Z",
"customerProfile": "Tech Enthusiast",
"onlinePurchase": true,
"paymentMethod": "Amex",
"shippingAddress": "PO BOX 8877 Los Angeles CA 90210",
"billingAddress": "5155 SW 44 Ave Miami Florida 33155",
"customerEmail": "sam@protonmail.com",
"customerName": "Steven Smith",
"isVPN": false,
"clientBrowser": "Chrome",
"deviceType": "Desktop",
"ipAddress": "352.168.1.186",
"deviceFingerprint": "abcd1234efgh5678",
"transactionFrequency": 2,
"accountAge": 365,
"emailDomain": "protonmail.com",
"addressMismatch": true,
"twoFactorAuth": false,
"referralSource": "Google Search",
"proxyOrVPN": true,
"orderQuantity": 1,
"strictness": 50
}
React Example
import React, { useEffect } from 'react';
import FraudBusterClient from 'fraud-buster-client';
const App = () => {
useEffect(() => {
const runTest = async () => {
try {
const fraudClient = new FraudBusterClient({
apiKey: process.env.REACT_APP_API_KEY,
});
const transactionData = {
product: "Rolex Watch",
amount: 9500,
location: "Florida",
time: "2024-03-04T10:30:00Z",
customerProfile: "Tech Enthusiast",
onlinePurchase: true,
paymentMethod: "Amex",
shippingAddress: "PO BOX 8877 Los Angeles CA 90210",
billingAddress: "7755 SW 76 Ave Miami Florida 33115",
customerEmail: "sam@protonmail.com",
customerName: "Steven Smith",
isVPN: false,
clientBrowser: "Chrome",
deviceType: "Desktop",
ipAddress: "352.168.1.186",
deviceFingerprint: "abcd1234efgh5678",
transactionFrequency: 2,
accountAge: 365,
emailDomain: "protonmail.com",
addressMismatch: true,
twoFactorAuth: false,
referralSource: "Google Search",
proxyOrVPN: true,
orderQuantity: 1,
strictness: 50
};
const response = await fraudClient.evaluateTransaction(transactionData);
console.log("Fraud Assessment Result:", response);
} catch (error) {
console.error("Error:", error.message);
}
};
runTest();
}, []);
return <h1>Fraud Buster Test</h1>;
};
export default App;
Response Handling
Response Example:
{
"transactionId": "821c09c1-fdaa-4199-b3ea-c4b715f8a150",
"ConfidenceLevel": "Medium",
"Result": "Failed"
}
Risk Level Definitions:
Risk Level | Description |
---|---|
0 | Critical Risk - Immediate Failure |
1 | High Risk - Manual Verification Required |
2 | Failed |
3 | Monitor Closely - Review Logs |
4 | Low Risk - Auto Approved |
5 | Safe Zone - Pass |
6 | Caution - Review Recommended |
7 | Additional Verification Needed (Fallback) |
FAQ
For detailed information and troubleshooting, visit our FAQ section.