Getting started overview
Integrating with FraudLabs Pro involves a sequence of steps designed to enable rapid deployment of fraud detection capabilities. The process begins with account creation, which provides access to necessary API credentials. Following this, developers will make a foundational API call to test the integration and verify that their system can successfully submit transaction data for analysis and receive a fraud assessment response. This initial setup is critical for establishing a working connection before implementing more advanced features or integrating with e-commerce platforms.
The table below outlines the essential steps for a quick start:
| Step | Action | Where to go |
|---|---|---|
| 1. Sign Up | Create a FraudLabs Pro account. | FraudLabs Pro pricing page |
| 2. Get API Key | Locate your unique API key in the dashboard. | FraudLabs Pro dashboard (after login) |
| 3. Make First Request | Send a test transaction query to the API. | FraudLabs Pro API Reference |
| 4. Parse Response | Interpret the fraud assessment from the API response. | FraudLabs Pro API Reference documentation |
Create an account and get keys
To begin using FraudLabs Pro, you must first register for an account. FraudLabs Pro offers a Free Plan that includes 500 queries per month, which is suitable for initial testing and small-scale operations. Paid plans start at $29.95 per month for 10,000 queries. Navigate to the FraudLabs Pro pricing page and select the plan that fits your needs to complete the registration process.
Upon successful registration and login, your unique API key will be accessible within your FraudLabs Pro dashboard. This key acts as your credential for authenticating all requests to the FraudLabs Pro API. It is crucial to treat your API key as sensitive information, protecting it from unauthorized access to maintain the security of your fraud detection calls. The API key is typically found in the 'Settings' or 'API Key' section of your dashboard.
Example of an API key format (hypothetical): abcdefghijklmnopqrstuvwxyz0123456789ABCDEF
Your first request
After obtaining your API key, the next step is to make a simple API call to verify the integration. FraudLabs Pro's primary API endpoint for fraud detection is https://api.fraudlabspro.com/v2/order/screen. Requests are sent as HTTP POST requests, typically with parameters in a URL-encoded format or JSON body, depending on the specific endpoint and client library used.
A basic request requires your API key and essential transaction details. For a preliminary test, you might only need a few parameters, such as the customer's IP address and email. The FraudLabs Pro API reference documentation provides a comprehensive list of all supported parameters for detailed fraud screening.
Here’s an example using curl to make a basic fraud screening request:
curl -X POST \
'https://api.fraudlabspro.com/v2/order/screen' \
-d 'key=YOUR_API_KEY' \
-d 'ip=203.0.113.45' \
-d '[email protected]' \
-d 'amount=100.00' \
-d 'currency=USD' \
-d 'quantity=1' \
-d 'user_agent=Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36' \
-d 'accept_language=en-US,en;q=0.9'
Replace YOUR_API_KEY with your actual API key. The response will be in JSON format, containing a fraud assessment. A typical successful response might look like this:
{
"fraudlabspro_score": "100",
"fraudlabspro_status": "REVIEW",
"fraudlabspro_feedback": "",
"fraudlabspro_id": "FLPB1234567890",
"ip_country": "US",
"ip_continent": "North America",
"is_proxy": "N",
"email_blacklist": "N",
"country_match": "Y",
"api_key_usage": "1/500"
}
This response indicates a fraud score, a status (e.g., REVIEW, APPROVE, REJECT), and various data points used in the assessment. Developers should parse this JSON response to integrate the fraud verdict into their application's workflow.
For more robust integrations, consider using one of the available SDKs for languages like PHP, Python, or Node.js. These SDKs handle the underlying HTTP requests and response parsing, simplifying the integration process. Additionally, plugins are available for popular e-commerce platforms such as WooCommerce and Shopify, reducing the need for custom code.
Common next steps
Once you have successfully made your first API call, you can proceed with further integration and configuration to optimize fraud detection for your specific application:
- Integrate with an E-commerce Platform: If you are using platforms like Shopify, Magento, or WooCommerce, utilize the dedicated FraudLabs Pro plugins. These plugins often provide out-of-the-box integration for order screening and fraud management within the platform's administrative interface. This approach can simplify initial setup and ongoing management, as detailed in the FraudLabs Pro developer documentation.
- Implement Webhooks for Asynchronous Processing: For transactions requiring more extensive analysis or for integrating with a larger system, consider setting up webhooks. This allows FraudLabs Pro to send real-time notifications to your application once a fraud assessment is complete, rather than waiting for a synchronous API response. Webhooks are a common pattern for handling asynchronous events in API integrations, as described in the MDN Web Docs on webhooks.
- Configure Rules and Actions: Customize the fraud detection rules within your FraudLabs Pro merchant area. You can define specific rules based on various data points (IP address, email, billing address, transaction amount, etc.) to automatically approve, review, or reject orders. This allows for fine-tuning the balance between fraud prevention and customer experience.
- Enhance Data Submission: Provide more data points in your API requests to improve the accuracy of fraud detection. Including details such as billing and shipping addresses, payment gateway response, and custom fields can provide a more comprehensive risk assessment. The API reference lists all available parameters.
- Review Reporting and Analytics: Regularly review the fraud reports and analytics available in your FraudLabs Pro dashboard. This helps you understand fraud patterns, assess the effectiveness of your rules, and identify areas for improvement in your fraud prevention strategy.
- Error Handling and Retry Mechanisms: Implement robust error handling in your application to manage API rate limits, temporary service unavailability, and invalid requests. Incorporate retry mechanisms with exponential backoff for transient errors to ensure reliable communication with the FraudLabs Pro API.
Troubleshooting the first call
Encountering issues during the initial API call is common. Here are some typical problems and potential solutions:
- Invalid API Key:
- Symptom: API returns an error indicating an invalid or missing key, or a
401 Unauthorizedstatus. - Solution: Double-check that you have copied the API key correctly from your FraudLabs Pro dashboard. Ensure there are no leading or trailing spaces. Verify that the key is actually included in your request parameters.
- Symptom: API returns an error indicating an invalid or missing key, or a
- Incorrect Endpoint or HTTP Method:
- Symptom: API returns a
404 Not Foundor405 Method Not Allowederror. - Solution: Confirm you are using the correct API endpoint (e.g.,
https://api.fraudlabspro.com/v2/order/screen) and that you are sending a POST request, as required by the FraudLabs Pro API documentation.
- Symptom: API returns a
- Missing or Invalid Parameters:
- Symptom: API returns an error message detailing missing required fields or invalid data formats (e.g., non-numeric amount, invalid email format).
- Solution: Review the API reference to ensure all mandatory parameters are included and their values conform to the expected data types and formats. For testing, ensure you at least include
key,ip,email,amount, andcurrency.
- Network Connectivity Issues:
- Symptom: Request times out or connection fails.
- Solution: Verify your server or local environment has outbound internet access. Check for any firewall rules that might be blocking access to
api.fraudlabspro.com.
- Exceeded Free Tier Limit:
- Symptom: API returns an error indicating that your query limit has been reached.
- Solution: Check your dashboard for current usage. If exceeded, wait for the next billing cycle, upgrade your plan, or contact support. The FraudLabs Pro pricing page details query limits.
- CORS Issues (for browser-based requests):
- Symptom: Browser console shows a CORS policy error.
- Solution: FraudLabs Pro's API is generally designed for server-side integration. Direct browser-based API calls without a proxy may encounter Cross-Origin Resource Sharing (CORS) restrictions. It's recommended to make API calls from your backend server.
If these steps do not resolve the issue, consult the official FraudLabs Pro documentation or contact their support for assistance, providing full details of your request and the error response.