Create decision
Creates a new fraud decision to evaluate a transaction.
Endpoint: POST /v1/risk
POST /v1/risk
Headers
Content-Type: application/json
x-api-key: <YOUR_API_KEY>
Request Body
{
"transaction_info": {
"type": "create_decision",
"reference_code": "123456789"
},
"card": {
"number": "{{token_id : detokenize}}",
"expiration_date": "{{token_id : detokenize}}"
},
"order_info": {
"amount_details": {
"total_amount": "1000",
"currency": "USD"
}
},
"bill_to": {
"first_name": "John",
"last_name": "Doe",
"country": "US",
"address_1": "1001 FALCON AVE",
"address_2": "Unit 2",
"city": "Miami",
"state": "FL",
"phone_number": "50762987635",
"email": "accept@gmsectec.com",
"postal_code": "33166"
},
"device_info": {
"fingerprint_session_id": "1713211198904",
"ip_address": "190.123.237.237",
"http_browser_color_depth": "24",
"http_browser_java_enabled": false,
"http_browser_js_enabled": true,
"http_browser_screen_height": "1050",
"http_browser_screen_width": "1680",
"http_browser_time_offset": "240",
"user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36",
"cookies_accepted": true,
"http_browser_language": "en-US"
},
"merchant_defined_info": [
{
"key": "1",
"value": "1"
},
{
"key": "2",
"value": "test number 2"
},
{
"key": "3",
"value": "test number 3"
},
{
"key": "4",
"value": "test number 4"
},
{
"key": "5",
"value": "test number 5"
}
]
}
Parameters
transaction_info.type
string
Yes
Must be "create_decision"
transaction_info.reference_code
string
Yes
Unique transaction reference code
card.number
string
Yes
Card number (can be permanent token, temporal token, or valid card number string)
card.expiration_date
string
Yes
Expiration date (can be tokenized or in MM/YY format)
order_info.amount_details.total_amount
string
Yes
Total transaction amount
order_info.amount_details.currency
string
Yes
ISO currency code (e.g., USD, EUR)
bill_to
object
Yes
Customer billing information
device_info
object
Yes
User device information
merchant_defined_info
array
Optional
Additional merchant-defined information
Card Information Formats
The card.number
field accepts three different formats:
Permanent Token:
"{{token_id : detokenize}}"
- For permanent tokensTemporal Token:
"{{temp_token_id : transaction}}"
- For one-time use tokensCard Number:
"4111111111111111"
- Plain card number string
The card.expiration_date
field accepts:
Permanent Token:
"{{token_id : detokenize}}"
- For permanent tokensTemporal Token:
"{{temp_token_id : transaction}}"
- For one-time use tokensPlain Format:
"12/25"
- MM/YY format
Response
The API returns a standardized response structure with the following attributes:
status: string - The status is a string result that only has three possible values: "success", "fail" or "error"
message: string - The message value represents a short description about the status received
data: object - The data variable represents the information expected from the request made. This contains the payment information and the decision of the transaction
Response Messages
success
"Transaction accepted"
Transaction was approved
success
"Transaction in review"
Transaction requires manual review
success
"Transaction rejected"
Transaction was declined
Response Example
{
"status": "success",
"message": "Transaction accepted",
"data": {
"transaction_info": {
"type": "create_decision_response",
"reference_code": "123456789",
"request_id": "0001750957860619700081",
"decision_id": "7509578607956359904807",
"status": "Accepted",
"created_at": "2025-06-26T17:11:01Z"
},
"payment_information": {
"scheme": "VISA DEBIT",
"bin": "462294",
"accountType": "Visa Classic",
"issuer": "INTL HDQTRS-CENTER OWNED",
"binCountry": "US"
},
"risk_info": {
"score": "93",
"model_used": "default",
"info_codes": {
"address": [
"COR-BA"
],
"phone": [
"UNV-PH"
],
"globalVelocity": [
"VEL-ADDR",
"VEL-NAME",
"VELI-CC",
"VELL-CC",
"VELS-CC",
"VELV-CC"
],
"suspicious": [
"MUL-EM"
],
"identityChange": [
"ID-M-HPOS",
"ID-X-NEG",
"MORPH-C"
],
"internet": [
"INTL-IPCO",
"MM-IPBCO"
]
},
"profile": {
"earlyDecision": "ACCEPT"
},
"providers": {
"fingerprint": {
"profile_duration": "5",
"test_risk_rating": "neutral"
}
},
"case_priority": "1"
}
}
}
Transaction Status Values
The data.transaction_info.status
field indicates the final decision:
Accepted
Transaction accepted
Rejected
Transaction rejected
Review
Transaction requires manual review
Usage Examples
cURL - Create Decision
curl --location 'https://api.firstoken.co/v1/risk' \
--header 'Content-Type: application/json' \
--header 'x-api-key: <YOUR_API_KEY>' \
--data-raw '{
"transaction_info": {
"type": "create_decision",
"reference_code": "123456789"
},
```json
{
"transaction_info": {
"type": "create_decision",
"reference_code": "123456789"
},
"card": {
"number": "4111111111111111",
"expiration_date": "12/25"
},
"order_info": {
"amount_details": {
"total_amount": "1000",
"currency": "USD"
}
},
"bill_to": {
"first_name": "John",
"last_name": "Doe",
"country": "US",
"address_1": "1001 FALCON AVE",
"city": "Miami",
"state": "FL",
"phone_number": "50762987635",
"email": "accept@gmsectec.com",
"postal_code": "33166"
}
}
Last updated
Was this helpful?