v1.0.0 Stable

API Documentation

Welcome to the FraudGuardian Developers Hub. Our API allows you to integrate real-time fraud detection into your checkout flow using WebSockets.

Authentication

To use the API, you must first register your business on the Portal. You will be issued a unique api_key starting with sk_live_.

api_key: "sk_live_8392a9bc..."

Integration (Client Side)

Include the Socket.IO client library in your HTML page.

<script src="https://cdn.socket.io/4.0.0/socket.io.min.js"></script> <script> const socket = io('http://your-server-url.com'); function pay() { socket.emit('scan_transaction', { api_key: "sk_live_YOUR_KEY", amount: 4500, real_price: 4500, card_number: "424242424242", type: 0 // 0=Card, 1=Crypto }); } </script>

Handling Responses

Listen for the final_result event to know if you should proceed with the payment.

socket.on('final_result', (data) => { if (data.status === "SAFE") { // Proceed to Bank Gateway console.log("Approved"); } else { // Block User alert("Declined: " + data.msg); } });