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