For a complete credit anti-fraud service docking process, you need to first complete the front-end SDK integration to obtain device information; then report back-end risk events to obtain complete risk control decisions and services.
This document is the specific docking API specification for back-end risk event reporting, including API addresses, authentication parameters, request parameters, response parameters, etc.
API Format
Base URL
- Singapore:https://sg-credit.apitd.net/credit/fraud/v1
- Indonesia:https://id-credit.apitd.net/credit/fraud/v1
- Pakistan:https://pk.apitd.net/credit/fraud/v1
API
URL | HTTP Method | request Content Type | response Content Type | Charset |
---|---|---|---|---|
api-base-url?partner_code=xxx&partner_key=xxx | POST | application/json | json | UTF-8 |
Authentication
Name | Type | Mandatory | Description | Notes |
---|---|---|---|---|
partner_code | String | Yes | Partner code | Provided by TrustDecision |
partner_key | String | Yes | Partner key | Provided by TrustDecision |
Request
- A complete event request parameter is usually composed of two parts of the parameter.
- Basic Parameter(s)
- Event Parameter(s)
Basic Parameter(s)
Parameter | Type | Description | Required/Optional | Notes |
---|---|---|---|---|
event_time | String | The specific time of the event occurs | Required | Comply with the ISO 8601 standard; Format: yyyy-mm-ddthh: mm: ss.sssz, for example, 2021-10-12T14: 20: 50.521+07: 00 |
event_type | String | Event type | Required | Enumeration value: 1. Register; 2. Login; 3. Identity verification; 4. Loan 5. Disburse |
scenario | String | Event scenario | Enumeration value: 1. cashloan 2. bnpl 3. creditcard 4. p2p default If nothing is uploaded, it is default. | |
terminal | Terminal | Terminal information | Strongly recommended | See "Terminal" for details |
ext | Object | Extended Information | Conditionally required | Extension information agreed with TD |
ext_response_types | String | Information that needs additional returns | Recommended | For example, device_info means returning device details. If this field is not passed, the device information is not returned. |
order_id | String | Customer side order id | Recommended | custom content |
Event Parameter(s)
Request Example
{
"event_time":"2021-10-12T14:20:50.521+07:00",
"event_type":"loan",
"terminal":{
"black_box":"aGPH165*****83672ropYaFxT7",
"ip":"210.20.10.33"
},
"scenario":"default",
"profile":{
"name":"Pierre Laurent",
"id":{
"id_country":"GB",
"id_type":"passport",
"id_number":"G402****",
"valid_date":"2028-01-01"
},
"phone":{
"country_code":86,
"phone_number":"18700001111"
},
"email":"xxxx",
"birthdate":"1998-01-01",
"birthplace":{
"country":"GB",
"region":"The Greater London",
"city":"London",
"district":"Knightsbridge",
"detail":"87-135 Brompton Rd"
},
"sex":"male",
"address":{
"country":"GB",
"region":"The Geater London",
"city":"London",
"district":"Knightsbridge",
"detail":" 87-135 Brompton Rd",
"zip_code":"SW3 1QE"
},
"marital_status":"single",
"education":"master",
"company_name":"xxx",
"company_phone":{
"country_code":86,
"phone_number":"18700001111"
},
"company_address":{
"country":"GB",
"region":"The Geater London",
"city":"London",
"district":"Knightsbridge",
"detail":" 87-135 Brompton Rd",
"zip_code":"SW3 1QE"
}
},
"contact":[
{
"name":"Pierre Laurent",
"phone":{
"country_code":86,
"phone_number":"18700001111"
},
"relationship":"spouse"
},
{
"name":"San Zhang",
"phone":{
"country_code":86,
"phone_number":"18700001112"
},
"relationship":"friend"
}
],
"card":{
"card_number":"xxxx",
"bank_name":"xxx"
},
"identity_ext":{
"face_image_type":"url",
"face_image":[
"url1",
"url2"
],
"face_video_type":"url",
"face_video":"https://xxx...",
"id_image_type":"url",
"id_image":"https://xxx..."
},
"ext":{
"ext_response_types":"device_info"
}
}
Response Parameter(s)
Parameter | Type | Description | Required/Optional | Notes |
---|---|---|---|---|
code | Integer | API status code | Required | The status code returned by AFD, please see the API status code section below for details. |
message | String | status information | Conditionally required | In the API exception state, the specific exception reason will be output. |
sequence_id | String | Unique ID of Response | Required | Unique identifier used to track each request record |
order_id | String | Customer side order id | Recommended | custom content, the same as request Parameter. Only displayed when the parameters are entered |
device_info | DeviceInfo | Device information | Conditionally required | Returned when ext_response_types contains device_info |
score | Integer | Risk score | Required | TG decision risk score, the higher the score, the higher the risk |
result | String | Decision result | Required | Enumeration values: 1. decline 2. review 3. accept |
reasons | Array | List of decision reasons | Required | When a risk is detected, display a list of causes of the risk |
id | String | Decision Reason ID | Required | Unique code for the decision reason |
reason | String | Decision Reason | Required | Explanation of the decision reasons |
API Status Code
Code | Description |
---|---|
200 | Success |
301 | Service not purchased |
302 | Traffic blocked |
303 | Traffic insufficient |
304 | Service expired |
305 | Daily maximum volume reached |
11000 | {Field name} input parameter error |
11001 | Wrong format |
11002 | Input parameter parsing failed |
11302 | scenario input parameter error |
11400 | The corresponding workflow cannot be found |
11401 | Workflow execution error |
11500 | System error |
11501 | All nodes of the workflow failed to execute |
Response Example
{
"code":200,
"device_info":{
"device_id":"A1VHK6r9-T3E2-U77L-786n-6kn6ZJhQt5ee",
"device_os":"Android",
"device_detail":{
"android_id":"591b4eb2a65e88f5",
"api_version":"31",
"app_version":"4.1.5.6",
"available_memory":1509920768,
"available_storage":31501324288,
"baseband_version":"MOLY.LR12A.R3.MP.V98.1.P22",
"battery_level":100,
"brand":"Redmi",
"bssid":"80:8d:b7:be:ef:16",
"carrier":"China Unicom,-",
"cell_ip":"11.77.85.128",
"charge_state":"full",
"country_iso":"cn",
"cpu_hardware":"AArch64 Processor rev 2 (aarch64)",
"cpu_type":"MT6771V/C",
"current_time":1687772256849,
"device_name":"lancelot",
"device_svn":"07",
"dns_address":"192.168.8.55",
"fp_version":"4.1.5.6",
"gps_location":{
"address":"No. 450, Cangqian Town, Yuhang District, Hangzhou City, Zhejiang Province",
"city":"Hangzhou City",
"province":"Zhejiang Province",
"township":"Cangqian Town"
},
"hardware":"mt6768",
"host":"m1-xm-ota-bd274.bj.idc.xiaomi.com",
"installed_packages":"[{"package":"com.miui.screenrecorder","name":"-"},{"package":"com.miui.fm","name":"-"},{"package":"com.mi.liveassistant","name":"-"},{"package":"com.xiaomi.vipaccount","name":"-"},{"package":"com.qiyi.video","name":"-"},{"package":"cn.tongdun.android.demo4156","name":"-"},{"package":"cn.tongdun.android.demo4159","name":"-"},{"package":"com.miui.thirdappassistant","name":"-"},{"package":"com.android.soundrecorder","name":"-"},{"package":"cn.wps.moffice_eng","name":"-"}]",
"ip":"123.157.153.130",
"ipv6":"fe80::5c5f:4e9c:b980:17c4",
"language":"zh",
"latitude":30.281102,
"longitude":120.012233,
"mcc":"460,",
"mnc":"01,",
"model":"M2004J19C",
"network_type":"wifi",
"package_name":"cn.tongdun.android.demo4156",
"product":"lancelot",
"proxy_info":"",
"running_packages":"cn.tongdun.android.demo4156",
"screen_brightness":256,
"screen_resolution":"1080x2340",
"sign_md5":"03ce925f76ceb40e1c2ed8bfe3fcdd0c480a7ba8689ff814c601edfbf79e339e",
"sim_operator":"China Unicom,-",
"ssid":"IT-YUNZM123",
"startup_time":"2023-06-21 10:14:59",
"system_version":"12",
"time_zone":"UTC+08:00",
"total_memory":3881115648,
"total_storage":50979336192,
"up_time":458557139,
"vpn_ip":"",
"wifi_ip":"10.57.201.50"
},
"ip_location":{
"country":"China",
"region":"Zhejiang",
"city":"Hangzhou",
"country_id":"CN",
"continent":"Asia"
},
"device_risk_label":[
"abnormal_network_connection"
],
"device_risk_tools":{
"installed_risk_tools_type":[
"quick_macro"
],
"running_risk_tools_type":[
"quick_macro"
]
}
},
"reasons":[
{
"id":"fbd5ff***98b86298f",
"reason":"xxx"
},
{
"id":"29b4a58aa***38dd5654ce6467",
"reason":"xxx"
}
],
"result":"accept",
"score":0,
"sequence_id":"1693278374751000X3D9A00381169466"
}