This section provides an overview of the Quick Start Guide for integrating Hive Forensics AI's Fraud Buster API.
Overview
Welcome to the Fraud Buster API
section. This guide provides all the information you need to integrate Hive Forensics AI’s Fraud Buster API, which helps detect and prevent online transaction fraud. It supports modern frameworks, including React, and is designed for seamless integration into both frontend and backend applications.
Content
- Introduction: Overview of the Fraud Buster API.
- API Setup: Step-by-step guide to configure your API environment.
- API Usage: Examples of how to use the Fraud Buster API in Node.js and React.
- Response Handling: How to interpret API responses.
- FAQ: Frequently Asked Questions.
Getting Started
Step 1: Introduction
Fraud Buster API evaluates the risk of online transactions and helps prevent fraudulent activities. It analyzes transaction details and returns a risk score based on various fraud indicators.
Step 2: API Setup
-
Install Required Tools:
- Node.js for JavaScript and React development.
- A code editor (e.g., VSCode).
-
Obtain Your API Key:
Get your API key from the Hive Forensics AI portal. You'll need this key to authenticate API requests. -
Create Configuration File:
Set up environment variables in your project to securely store your API key and endpoint URL.
For React: Create a .env
file in the root directory:
REACT_APP_FRAUD_BUSTER_URL=http://localhost:8000/api/transaction
REACT_APP_API_KEY=your-api-key-here
Step 3: Configuration
-
Environment Variables:
- Use
REACT_APP_
prefixed variables for React apps. - Use
process.env
for Node.js backends.
- Use
-
Set Up API Client:
Import and configure the Fraud Buster client:
React Example:
import FraudBusterClient from 'fraud-buster-client';
const fraudClient = new FraudBusterClient({
apiKey: process.env.REACT_APP_API_KEY,
});
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": "2701 SW 40 Ave Miami Florida 33195",
"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
}
Example in React
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: "959 SW 32 Ave Miami Florida 33323",
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 result = await fraudClient.evaluateTransaction(transactionData);
console.log("Fraud Check Result:", result);
} catch (error) {
console.error("Error:", error.message);
}
};
runTest();
}, []);
return <h1>Fraud Buster Test</h1>;
};
export default App;
Response Handling
A typical response looks like this:
{
"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.
Next Steps
- Test the integration using the React example provided.
- Ensure environment variables are correctly set up.
- Deploy and monitor results for fraud detection in real-world use cases.