---
title: Sentry Search
description: Calculate a transaction's risk score using Airpay's inhouse Sentry risk management system.
---

Sentry is an inhouse built risk management system that is used to calculate each transaction's risk score. As the transaction starts processing, we must pass request id, request type, service type, device id, request time, request status, merchant details, customer details and service details in request. If the request has valid details, we will get a score along with a weightage: low, medium, or high of the transaction.

```
Node Url: https://kraken.airpay.co.in/airpay/ms/sentry/api/node_search
```

```
Python Url:https://kraken.airpay.co.in/airpay/ms/sentry/api/python_search
```

## Header

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| content-type  required | String | application/json | `application/json` |
| affiliate  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| checksum  required | Text | string = string = param + secret_key;<br>sha256(<concate all values+SECRET KEY>); | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |
| processor-key  required | Text | Will be provided by airpay | `91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps` |

## Request Body

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| request_id  required | Number | Request ID(length 1-8) | `12345678` |
| request_type  required | String | The request_type can be either 'transaction' or 'register'.(length 1-15) | `transaction` |
| service_type  required | String | The service_type is based on the request_type. For example, if the request_type is 'transaction,' then the service_type can be 'pg' or 'nb.' 'pg' stands for payment gateway, and 'nb' stands for net banking."(length 1-10) | `pg` |
| device_id  optional | String | Device ID(length 1-8) |
| request_time  required | Date | Request Time is the API hitting time | `2022-10-31 19:10:47` |
| request_status  required | String | Request Status can be either "fail," "success," "initiated," or "pending," etc. | `INITIATED` |
| merchant_id  required | Number | Merchant ID | `78543` |
| merchant_state  required | String | Merchant State(length 1-20) | `Kerala` |
| merchant_city  required | String | Merchant City(length 1-20) | `Kochi` |
| activation_date  required | Date | activation_date is merchant activation date (YYYY-MM-DD HH:MM:SS) | `2015-01-21 11:15:49` |
| merchant_type  required | String | Merchant Type is type of the merchant eg:AQ,AC,DT (length 1-10) | `AQ` |
| company_name  optional | String | Company Name (length 1-20) |
| owner_name  required | String | Owner Name (length 1-20) | `John` |
| zone  required | String | Zone is based on the state, it may North,South,West,East (length 1-4) | `South` |
| name  required | String | Name (length 4-50) | `Prayag P` |
| phone  required | Number | Phone Number (length 10-15) | `9XXXXXX686` |
| email  required | String | Email Address (length 6-50) | `xyz@airpay.co.in` |
| city  required | String | City Name (length 2-50) | `Thrissur` |
| state  required | String | State Name (length 2-50) | `Kerala` |
| customer_ip  required | Number | Customer Ip | `100.123.00.00` |
| domain  required | url | Domain url (length 1-50) | `http:\\/\\/localhost_test` |
| ip  required | Number | Customer Ip | `100.123.00.00` |
| amount  required | Number | Amount (length 10-20) | `10.16` |
| card_f6  required | Number | The first 6 digits of a card where the transaction occurred(length 1-6) | `612345` |
| card_e4  required | Number | The last 4 digits of a card where the transaction occurred(length 1-4) | `9876` |
| currency_code  required | String | Currency in number (eg:356(IND),784(AED),834(TZS)...etc)(length 1-3) | `inr` |

## Success 200

| Parameter | Type Value | Description | Value Like |
| --- | --- | --- | --- |
| status  required | Numeric | 400- fail,200-success(length 1-3) | `200` |
| message  required | Text | success, fail | `success` |
| data  required | Text | { "request_id": "12345678", "score": 0, "weightage": "Low" } | `[]` |

## Request Example (Node)

```
curl --location --request POST 'https://kraken.airpay.co.in/airpay/ms/sentry/api/node_search' \
--header 'affiliate: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'content_type: application/json' \
--header 'processor-key: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--header 'checksum: 91f5evhk72f56432ec678sdfes685h42sd2t21k430912508233b7r37562g2hps' \
--data-raw {
"request_id":"12345678",
"request_type":"transaction",
"service_type":"pg",
"device_id":"",
"request_time":"2022-10-31 19:10:47",
"request_status":"INITIATED",
"merchant_details":{
    "merchant_id":"78543",
    "merchant_state":"Kerala",
    "merchant_city":"Kochi",
    "activation_date":"2015-01-21 11:15:49",
    "merchant_type":"AQ",
    "company_name":"",
    "owner_name":"John",
    "zone":"South"
},
"customer_details":{
    "name":"Prayag P",
    "phone":"9XXXXXX686",
    "email":"xyz@airpay.co.in",
    "city":"Thrissur",
    "state":"Kerala",
    "customer_ip":"100.123.00.00"
},
"service_details":{
    "domain":"http:\\/\\/localhost_test",
    "ip":"100.123.00.00",
    "amount":"10.16",
    "card_f6":"612345",
    "card_e4":"9876",
    "currency_code":"inr"
}
}
```

### Success Response

```
{
    "status": 200,
    "message": "success",
    "data": {
        "request_id": "12345678",
        "score": 0,
        "weightage": "Low"
    }
}
```

### Error Response

```
{
     "status" : "400",
     "message": "Failed",
     "data":""
}
```