Skip to main content

Fraud

Analyze a transaction for fraud​

POST /fraud/analyze

Send object with transaction parameters to the fraud endpoint

Parameters​

NameInTypeRequiredDescription
x-api-keyheaderstringfalseAPI Authentication Key
bodybodyFraudAnalysisRequestfalseTransaction 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​

StatusMeaningDescriptionSchema
200OKFraud analysis results objectFraudAnalysisResponse
500Internal Server ErrorAn error messageErrorResponse

Code samples​

"""
Python Code Snippet
"""
import requests

input_body = {
"sessionToken": "string",
"productToken": "string",
"email": "user@example.com",
"phoneNumber": "string",
"phoneCountry": "string",
"ipAddress": "string",
"billingCountry": "string",
"billingZip": "string"
}

headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-api-key': 'string'
}

r = requests.post('https://data.autohost.ai/v1/fraud/analyze', json=input_body, 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);

Schemas​

FraudAnalysisRequest​

{
"sessionToken": "string",
"productToken": "string",
"email": "user@example.com",
"phoneNumber": "string",
"phoneCountry": "string",
"ipAddress": "string",
"billingCountry": "string",
"billingZip": "string"
}

Properties​

NameTypeRequiredRestrictionsDescription
sessionTokenstringfalsenonenone
productTokenstringfalsenonenone
emailstring(email)falsenonenone
phoneNumberstringfalsenonenone
phoneCountrystringfalsenonenone
ipAddressstringfalsenonenone
billingCountrystringfalsenonenone
billingZipstringfalsenonenone

FraudAnalysisResponse​

{
"score": 0,
"status": "pass",
"cacheKey": "string"
}

Properties​

NameTypeRequiredRestrictionsDescription
scorenumberfalsenonenone
statusstringfalsenonenone
cacheKeystringfalsenonenone

Enumerated Values​

PropertyValue
statuspass
statusreview
statusdecline

ErrorResponse​

{
"error": "string"
}

Properties​

NameTypeRequiredRestrictionsDescription
errorstringfalsenonenone