π§© User β Add Additional Data (Risk/KYC) API #
Gateway Path: /User/add-additional-data
Service: Authentication & Authorization
Method: POST
Auth: Bearer token in Authorization
header
1) π Overview & Purpose #
Persists risk & KYC-related attributes for a user in a structured JSON payload.
All values in additionalData.data
must be sourced from the KYC verification process (i.e., retrieved by calling the KYC-related endpoints in your flow) and then submitted here in one consolidated call.
π Source of truth: βKYC verification processβ endpoints (questionnaires, address capture, device/location capture, BTrust callback, etc.). This endpoint does not compute values; it only stores them.
2) π Endpoint Definition #
HTTP: POST /User/add-additional-data
Headers #
-
Authorization: Bearer <token>
β valid access token -
Content-Type: application/json
Request Body (structure) #
Fields #
-
id (integer, required, int32) β User identifier, range
1..2147483647
. -
additionalData (object, required)
-
type (string, required) β Fixed contract marker, e.g.
"EnrollAdditionalData"
. -
data (object, required) β KYC/risk attributes:
-
userId (integer, required) β Mirrors
id
. -
BTrustAppCallBackId (string) β From BTrust callback step.
-
isCorrespondenceAddressSame (boolean, required) β Whether correspondence = residence.
-
sourceOfFundId (string, required) β Code from the SoF selection.
-
residenceAddressZipCode (string) β Residence ZIP/postal code.
-
correspondenceAddress (object, required if
isCorrespondenceAddressSame=false
)-
addressType (string) β e.g.,
"C"
(correspondence). -
addressLine, city, stateProvinceCounty, zipCode, countryId (strings).
-
-
secondaryLanguage (string) β Language code; from profile/KYC.
-
taxResidences (string, required) β Country code(s), e.g.,
"BG"
. -
gender (string) β
"M"
,"F"
, or policy-defined values. -
accountPurposeCode (string, required) β Purpose of account.
-
mainActivityCode (string, required) β Customer main activity.
-
financingMethodCode (string, required) β Funding method.
-
enrollIP (string, required) β IP captured at enrollment.
-
enrollLatitude, enrollLongitude (number) β Geo coordinates captured during KYC.
-
enrollChannel (string, required) β
"M"
(mobile),"W"
(web), etc.
-
-
β Important: some field above must be fetched from KYC flow endpoints prior to calling this API.
3) π‘ Responses #
β 3.1 Success β 200 OK #
The additional data was stored successfully.
Body: none (or minimal confirmation, depending on gateway configuration).
β 3.2 Server Error β 500 Internal Server Error #
Unexpected failure.
Body: usually empty (use logs/trace IDs from gateway).
4) π‘ Validation Rules #
-
id: required; integer
1..2147483647
. -
additionalData.type: required; must match contract (
"EnrollAdditionalData"
or as defined by your spec). -
additionalData.data: required; object must include all mandatory KYC fields per policy.
-
Correspondence address: required only if
isCorrespondenceAddressSame=false
. -
Codes & country fields: must use valid enumerations/ISO codes (e.g., ISO-3166 alpha-2 for countries).
-
IP & geo: if collected, provide canonical formats (IPv4/IPv6 string; decimal lat/long).
π§― Apply server-side throttling and audit logging. Do not accept partially-populated data if policy requires a complete KYC dataset.
5) π Data Sourcing β KYC Verification Process (Guidance) #
Field | Typical KYC Source |
---|---|
BTrustAppCallBackId |
Callback result from BTrust identity step- this param is not used for web identification |
sourceOfFundId , accountPurposeCode , mainActivityCode , financingMethodCode |
Appropriateness/Questionnaire endpoints |
taxResidences , gender , secondaryLanguage |
filled by the client |
residenceAddressZipCode , correspondenceAddress.* |
filled by the client |
enrollIP , enrollLatitude , enrollLongitude , enrollChannel |
Device context & geolocation capture during enrollment |
Implement the KYC flow first, cache/collect results, then submit them via this endpoint.
6) π» Examples #
6.1 cURL #
6.2 C# (.NET) #
6.3 JavaScript (fetch) #
7) π Sequence #
-
Client β KYC endpoints: Collect questionnaire, addresses, device/IP, BTrust callback ID, etc.
-
Client β API Gateway:
POST /User/add-additional-data
(Bearer, JSON body) with the consolidated payload. -
Gateway β Auth Service: Validate token.
-
Gateway β User Service: Persist
additionalData
. -
Gateway β Client:
200 OK
(or500
on error).