Consumer User Events

Create a Consumer User Event

POST

POST Consumer User Events

/events/consumer/user endpoint allows you to operate on the Consumer User Events entity.

User events are created after the initial POST /consumer/users call (which creates a user) and are used to:

  • Update the STATE and KYC Status of the user, using the userStateDetails or kycStatusDetails field
  • Update the user details, using the updatedConsumerUserAttributes field.

If you have neither of the above two use cases, you do not need to use user events.

Payload

Each user event needs three mandatory fields:

  • timestamp- the timestamp of when the event was created or occured in your system
  • userId - The ID of the transaction for which this event is generated.

In order to make individual events retrievable, you also need to pass in a unique eventId to the request body.

Query parameters

allowUserTypeConversionenumOptional
Boolean string whether Flagright should allow a Consumer user event to be applied to a Business user with the same user ID. This will converts a Business user to a Consumer user.
Allowed values: truefalse

Request

This endpoint expects an object.
timestamp
doubleRequired
Timestamp of the event
userId
stringRequired
Transaction ID the event pertains to
eventId
stringOptional
Unique event ID
reason
stringOptional
Reason for the event or a state change
eventDescription
stringOptional
Event description
updatedConsumerUserAttributes
objectOptional
Model for User details

Response

This endpoint returns an object
userId
string
Unique user ID
createdTimestamp
double
Timestamp when userId is created
userDetails
objectOptional
Model for consumer user personal details
userStateDetails
objectOptional
kycStatusDetails
objectOptional
employmentStatus
enumOptional
occupation
stringOptional
legalDocuments
list of objectsOptional
User's legal identity documents - See Document Model for details
contactDetails
objectOptional
Model for business user contact information details
transactionLimits
objectOptional
Model for transaction limits for a given user
riskLevel
enumOptional
Allowed values: VERY_HIGHHIGHMEDIUMLOWVERY_LOW
acquisitionChannel
enumOptional
Model for User acquisition channel
reasonForAccountOpening
list of stringsOptional
sourceOfFunds
list of enumsOptional
userSegment
enumOptional
Allowed values: RETAILPROFESSIONAL
pepStatus
list of objectsOptional
tags
list of objectsOptional
Additional information that can be added via tags
executedRules
list of objectsOptional
Model for list of executed rules
hitRules
list of objectsOptional
Model for list of hit rules
riskScoreDetails
objectOptional

Errors

POST
1curl -X POST https://sandbox.api.flagright.com/events/consumer/user \
2 -H "x-api-key: <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "timestamp": 1.1,
6 "userId": "userId"
7}'
1{
2 "userId": "userId",
3 "createdTimestamp": 1.1,
4 "userDetails": {
5 "name": {
6 "firstName": "Baran",
7 "middleName": "Realblood",
8 "lastName": "Ozkan"
9 },
10 "dateOfBirth": "1991-01-01",
11 "countryOfResidence": "US",
12 "countryOfNationality": "DE",
13 "gender": "M"
14 },
15 "userStateDetails": {
16 "state": "UNACCEPTABLE",
17 "userId": "userId",
18 "reason": "reason"
19 },
20 "kycStatusDetails": {
21 "reason": "reason",
22 "status": "SUCCESSFUL",
23 "userId": "userId"
24 },
25 "employmentStatus": "UNEMPLOYED",
26 "occupation": "occupation",
27 "legalDocuments": [
28 {
29 "documentType": "passport",
30 "documentNumber": "Z9431P",
31 "documentIssuedCountry": "DE",
32 "documentIssuedDate": 1639939034000,
33 "documentExpirationDate": 1839939034000,
34 "tags": [
35 {
36 "key": "customerType",
37 "value": "wallet"
38 }
39 ],
40 "nameOnDocument": {
41 "firstName": "Baran",
42 "middleName": "Realblood",
43 "lastName": "Ozkan"
44 }
45 }
46 ],
47 "contactDetails": {
48 "emailIds": [
49 "emailIds"
50 ],
51 "contactNumbers": [
52 "contactNumbers"
53 ],
54 "faxNumbers": [
55 "faxNumbers"
56 ],
57 "websites": [
58 "websites"
59 ],
60 "addresses": [
61 {
62 "addressLines": [
63 "Klara-Franke Str 20"
64 ],
65 "city": "Berlin",
66 "country": "Germany",
67 "postcode": "10557",
68 "state": "Berlin",
69 "tags": [
70 {
71 "key": "customKey",
72 "value": "customValue"
73 }
74 ]
75 }
76 ]
77 },
78 "transactionLimits": {
79 "maximumDailyTransactionLimit": {
80 "amountValue": 800,
81 "amountCurrency": "GBP"
82 },
83 "maximumWeeklyTransactionLimit": {
84 "amountValue": 800,
85 "amountCurrency": "GBP"
86 },
87 "maximumMonthlyTransactionLimit": {
88 "amountValue": 800,
89 "amountCurrency": "GBP"
90 },
91 "maximumQuarterlyTransactionLimit": {
92 "amountValue": 800,
93 "amountCurrency": "GBP"
94 },
95 "maximumTransactionLimit": {
96 "amountValue": 800,
97 "amountCurrency": "GBP"
98 },
99 "maximumYearlyTransactionLimit": {
100 "amountValue": 800,
101 "amountCurrency": "GBP"
102 }
103 },
104 "riskLevel": "VERY_HIGH",
105 "acquisitionChannel": "ORGANIC",
106 "reasonForAccountOpening": [
107 "reasonForAccountOpening"
108 ],
109 "sourceOfFunds": [
110 "Earnings"
111 ],
112 "userSegment": "RETAIL",
113 "pepStatus": [
114 {
115 "isPepHit": true,
116 "pepCountry": "pepCountry"
117 }
118 ],
119 "tags": [
120 {
121 "key": "customKey",
122 "value": "customValue"
123 }
124 ],
125 "executedRules": [
126 {
127 "ruleInstanceId": "ruleInstanceId",
128 "ruleName": "Proof of funds for high value transactions",
129 "ruleDescription": "If a user makes a remittance transaction >= 1800 in EUR - ask for proof of funds",
130 "ruleAction": "BLOCK",
131 "ruleHit": true,
132 "ruleId": "R-1a",
133 "vars": [
134 {
135 "value": {}
136 }
137 ],
138 "labels": [
139 "UNEXPECTED_BEHAVIOR"
140 ],
141 "nature": "AML",
142 "isShadow": true
143 }
144 ],
145 "hitRules": [
146 {
147 "ruleInstanceId": "ruleInstanceId",
148 "ruleName": "Proof of funds for high value transactions",
149 "ruleDescription": "If a user makes a remittance transaction >= 1800 in EUR - ask for proof of funds",
150 "ruleAction": "BLOCK",
151 "ruleId": "R-1a",
152 "labels": [
153 "UNEXPECTED_BEHAVIOR"
154 ],
155 "nature": "FRAUD",
156 "isShadow": true
157 }
158 ],
159 "riskScoreDetails": {
160 "kycRiskScore": 1.1,
161 "craRiskScore": 1.1,
162 "kycRiskLevel": "VERY_HIGH",
163 "craRiskLevel": "VERY_HIGH"
164 }
165}