Transactions

Verify a Transaction

POST

POST Transactions

/transactions endpoint allows you to operate on the Transaction entity.

In order to pass the payload of a transaction to Flagright and verify the transaction, you will need to call this endpoint with the transaction payload. Not all fields are mandatory, you will only need to pass in the fields that you have and are relevant for your compliance setup.

Payload

Here are some of the most used payload fields explained (you can find the full payload schema below with 1 line descriptions):

  • type: Type of transaction (Ex: WITHDRAWAL, DEPOSIT, TRANSFER etc).
  • transactionId - Unique Identifier for the transaction. Flagright API will generate a transactionId if this field is left empty
  • timestamp - UNIX timestamp in milliseconds of when the transaction took place
  • transactionState - The state of the transaction, set to CREATED by default. More details here
  • originUserId - Unique identifier (if any) of the user who is sending the money. This user must be created within the Flagright system before using the create a consumer user or create a business user endpoint
  • destinationUserId - Unique identifier (if any) of the user who is receiving the money. This user must be created within the Flagright system before using the create a consumer user or create a business user endpoint
  • originAmountDetails - Details of the amount being sent from the origin
  • destinationAmountDetails - Details of the amount being received at the destination
  • originPaymentDetails - Payment details (if any) used at the origin (ex: CARD, IBAN, WALLET etc). You can click on the dropdown next to the field in the schema below to view all supported payment types.
  • destinationPaymentDetails - Payment details (if any) used at the destination (ex: CARD, IBAN, WALLET etc). You can click on the dropdown next to the field in the schema below to view all supported payment types.

Query parameters

validateOriginUserIdenumOptional
Boolean string whether Flagright should validate if provided originUserId exist. True by default
Allowed values: truefalse
validateDestinationUserIdenumOptional
Boolean string whether Flagright should validate if provided destinationUserId exist. True by default
Allowed values: truefalse

Request

This endpoint expects an object.
type
enumRequired
transactionId
stringRequired
Unique transaction identifier
timestamp
doubleRequired
Timestamp of when transaction took place
originUserId
stringOptional
UserId for where the transaction originates from
destinationUserId
stringOptional
UserId for transaction's destination. In other words, where the value is being transferred to.
transactionState
enumOptional
Model for transaction states. E.g. Processing, Refunded, Successful etc.
originAmountDetails
objectOptional
Model for transaction amount details
destinationAmountDetails
objectOptional
Model for transaction amount details
originPaymentDetails
unionOptional
Payment details of the origin. It can be a bank account number, wallet ID, card fingerprint etc.
destinationPaymentDetails
unionOptional
Payment details of the destination. It can be a bank account number, wallet ID, card fingerprint etc.
relatedTransactionIds
list of stringsOptional
IDs of transactions related to this transaction. Ex: refund, split bills
productType
stringOptional
Type of produce being used by the consumer (ex wallets, payments etc)
promotionCodeUsed
booleanOptional
Whether a promotion code was used or not the transaction
reference
stringOptional
Reference field for the transaction indicating the purpose of the transaction etc.
originDeviceData
objectOptional
Model for device data
destinationDeviceData
objectOptional
Model for device data
tags
list of objectsOptional
Additional information that can be added via tags

Response

This endpoint returns an object
executedRules
list of objects
Unique transaction identifier
hitRules
list of objects
Unique transaction identifier
status
enum
Model for rule action if a rule is hit. This is returned in the API response and can be configured on Console by operational accounts like a Compliance Analyst
Allowed values: ALLOWFLAGBLOCKSUSPEND
transactionId
string
Transaction ID that the results pertain to
message
stringOptional
riskScoreDetails
objectOptional

Errors

POST
1curl -X POST https://sandbox.api.flagright.com/transactions \
2 -H "x-api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "type": "DEPOSIT",
6 "transactionId": "7b80a539eea6e78acbd6d458e5971482",
7 "timestamp": 1641654664000,
8 "originUserId": "8650a2611d0771cba03310f74bf6",
9 "destinationUserId": "9350a2611e0771cba03310f74bf6",
10 "originAmountDetails": {
11 "transactionAmount": 800,
12 "transactionCurrency": "EUR",
13 "country": "DE"
14 },
15 "destinationAmountDetails": {
16 "transactionAmount": 68351.34,
17 "transactionCurrency": "INR",
18 "country": "IN"
19 },
20 "promotionCodeUsed": true,
21 "reference": "loan repayment",
22 "originDeviceData": {
23 "batteryLevel": 95,
24 "deviceLatitude": 13.0033,
25 "deviceLongitude": 76.1004,
26 "ipAddress": "10.23.191.2",
27 "deviceIdentifier": "3c49f915d04485e34caba",
28 "vpnUsed": false,
29 "operatingSystem": "Android 11.2",
30 "deviceMaker": "ASUS",
31 "deviceModel": "Zenphone M2 Pro Max",
32 "deviceYear": "2018",
33 "appVersion": "1.1.0"
34 },
35 "destinationDeviceData": {
36 "batteryLevel": 95,
37 "deviceLatitude": 13.0033,
38 "deviceLongitude": 76.1004,
39 "ipAddress": "10.23.191.2",
40 "deviceIdentifier": "3c49f915d04485e34caba",
41 "vpnUsed": false,
42 "operatingSystem": "Android 11.2",
43 "deviceMaker": "ASUS",
44 "deviceModel": "Zenphone M2 Pro Max",
45 "deviceYear": "2018",
46 "appVersion": "1.1.0"
47 },
48 "tags": [
49 {
50 "key": "customKey",
51 "value": "customValue"
52 }
53 ]
54}'
1{
2 "executedRules": [
3 {
4 "ruleInstanceId": "ruleInstanceId",
5 "ruleName": "Proof of funds for high value transactions",
6 "ruleDescription": "If a user makes a remittance transaction >= 1800 in EUR - ask for proof of funds",
7 "ruleAction": "BLOCK",
8 "ruleHit": true,
9 "ruleId": "R-1a",
10 "vars": [
11 {
12 "value": {}
13 }
14 ],
15 "labels": [
16 "UNEXPECTED_BEHAVIOR"
17 ],
18 "nature": "AML",
19 "isShadow": true
20 }
21 ],
22 "hitRules": [
23 {
24 "ruleInstanceId": "ruleInstanceId",
25 "ruleName": "Proof of funds for high value transactions",
26 "ruleDescription": "If a user makes a remittance transaction >= 1800 in EUR - ask for proof of funds",
27 "ruleAction": "BLOCK",
28 "ruleId": "R-1a",
29 "labels": [
30 "UNEXPECTED_BEHAVIOR"
31 ],
32 "nature": "AML",
33 "isShadow": true
34 }
35 ],
36 "status": "ALLOW",
37 "transactionId": "7b80a539eea6e78acbd6d458e5971482",
38 "message": "message",
39 "riskScoreDetails": {
40 "trsScore": 1.1,
41 "trsRiskLevel": "VERY_HIGH"
42 }
43}