Fraud
fraud-analyze
POST /fraud/analyze
Analyze a transaction for fraud
Send object with transaction parameters to the fraud endpoint
Parameters
| Name | In | Type | Required | Description | 
|---|---|---|---|---|
| x-api-key | header | string | false | API Authentication Key | 
| body | body | FraudAnalysisRequest | false | Transaction details object | 
Body parameter
{
  "sessionToken": "string",
  "productToken": "string",
  "email": "user@example.com",
  "phoneNumber": "string",
  "phoneCountry": "string",
  "ipAddress": "string",
  "billingCountry": "string",
  "billingZip": "string"
}
Example responses
200 Response
{
  "score": 0,
  "status": "pass",
  "cacheKey": "string"
}
Responses
| Status | Meaning | Description | Schema | 
|---|---|---|---|
| 200 | OK | Fraud analysis results object | FraudAnalysisResponse | 
| 500 | Internal Server Error | An error message | ErrorResponse | 
Code samples
"""
Python Code Snippet
"""
import requests
headers = {
  'Content-Type': 'application/json',
  'Accept': 'application/json',
  'x-api-key': 'string'
}
r = requests.post('https://data.autohost.ai/v1/fraud/analyze', headers=headers)
print(r.json())
/*
TypeScript Code Snippet
*/
import fetch from 'node-fetch';
const inputBody = {
  "sessionToken": "string",
  "productToken": "string",
  "email": "user@example.com",
  "phoneNumber": "string",
  "phoneCountry": "string",
  "ipAddress": "string",
  "billingCountry": "string",
  "billingZip": "string"
};
const headers = {
  'Content-Type':'application/json',
  'Accept':'application/json',
  'x-api-key':'string'
};
const response = await fetch('https://data.autohost.ai/v1/fraud/analyze', {
  method: 'post',
  body: JSON.stringify(inputBody),
  headers,
});
const responseJson = await response.json();
console.log(responseJson);