Entity-Role Model: Overview
Overview
This document outlines the significant changes made to the TradeVest API structure,
specifically the migration from the previous customers.yaml to the new architecture
using entities.yaml and roles.yaml.
This restructuring provides better separation of concerns, improves modularity, and enhances maintainability.
Core Architectural Changes
1. API Division into Separate Domains
The previous monolithic customers.yaml has been divided into two specialized API domains:
entities.yaml: Manages entity data (natural persons, legal entities, joint persons, beneficial owners)
roles.yaml: Manages role assignments (customers, proxies)
This separation aligns with dorelease-test-driven design principles, providing clearer boundaries between different business concepts.
2. Entity-Role Relationship Model
The new architecture follows a more flexible entity-role relationship model:
Entities represent real-world actors (people or organizations)
Roles represent functions that these entities perform in the system
Entity Management (entities.yaml)
New Entity Types
1. Joint Persons
New endpoints for managing joint persons:
POST /entities/joint-persons: Create joint personGET /entities/joint-persons: List joint personsGET /entities/joint-persons/{jointPersonId}: Get specific joint personPATCH /entities/joint-persons/{jointPersonId}: Update joint person
New schemas:
JointPersonData: Core data structureJointPerson: Complete joint person objectJointPersonUpdate: Structure for updates
2. Legal Entities
New endpoints for managing legal entities:
POST /entities/legal-entities: Create legal entityGET /entities/legal-entities: List legal entitiesGET /entities/legal-entities/{legalEntityId}: Get specific legal entityPATCH /entities/legal-entities/{legalEntityId}: Update legal entityGET /entities/vendor/legal-entities: Search for legal entitiesPOST /entities/vendor/legal-entities: Prepare legal entity dataGET /entities/vendor/legal-entities/{searchId}: Get search results
3. Natural Persons
Path prefix changed to
/entities/natural-personsRoles have been removed from natural persons GET endpoint (Natural persons can now be queried with their roles using the unified
/entitiesendpoint with appropriate filters)Enhanced data model for better identity management
New endpoints for managing natural persons:
POST /entities/natural-persons: Create natural personGET /entities/natural-persons: List natural personsGET /entities/natural-persons/{naturalPersonId}: Get specific natural personPATCH /entities/natural-persons/{naturalPersonId}: Update natural personPOST /entities/natural-persons/{naturalPersonId}/identification: Create natural person identificationGET /entities/natural-persons/search/nace-sectors: Search for NACE sectorsPOST /entities/identification-verifications: Create identification verificationGET /entities/identification-verifications: List identification verificationsGET /entities/identification-verifications/{identificationVerificationId}: Get specific identification verification
Entity Status Enums
The system now includes specialized status enums for different entity types:
JointPersonStatusEnum
CREATEDREVIEWREJECTEDINACTIVEPENDINGACTIVESUSPENDEDARCHIVEDRECEIVEDINVALIDSUSPENDED_COMPLIANCE
LegalEntityStatusEnum
CREATEDREVIEWREJECTEDINACTIVEPENDINGACTIVESUSPENDEDARCHIVEDRECEIVEDINVALIDSUSPENDED_COMPLIANCE
New Entity Relationship Management
Beneficial Owners
Enhanced endpoints for managing entities that are beneficial owners of legal entities:
POST /entities/{legalEntityId}/beneficial-ownersGET /entities/{legalEntityId}/beneficial-ownersGET /entities/beneficial-owners/{beneficialOwnerId}PATCH /entities/beneficial-owners/{beneficialOwnerId}
Key Changes in Beneficial Owner Model
The beneficial owner management has undergone significant structural changes similar to those in the proxy role:
Entity-centric approach: Beneficial owners are now associated with legal entities directly rather than with customers
In the previous model, beneficial owners were created via
/customers/natural-persons/{customerId}/beneficial-ownersIn the new model, they are created via
/entities/{legalEntityId}/beneficial-owners
Path parameter changes:
Previous:
customerIdin paths referred to the customer the beneficial owner was assigned toNew:
legalEntityIddirectly refers to the legal entity that has beneficial owners
Relationship model improvements:
More accurate representation of real-world relationship (beneficial owners belong to legal entities, not to customer roles)
Clear separation between entity data and role assignments
More direct path to manage beneficial ownership without the intermediate customer role
Standardized endpoint structure:
Consistent with the global API architecture shift
Follow the same pattern as other entity relationships
Simplified URL structure for better API navigation
These changes align with the broader architectural goal of properly separating entities from roles, resulting in a more intuitive and accurate data model that better reflects real-world business relationships.
Legal Representatives
Enhanced endpoints:
POST /entities/{legalEntityId}/legal-representativesGET /entities/{legalEntityId}/legal-representativesGET /entities/legal-representatives/{legalRepresentativeId}PATCH /entities/legal-representatives/{legalRepresentativeId}DELETE /entities/legal-representatives/{legalRepresentativeId}
Entity Search and Verification
Legal entity search endpoints (also listed in the "Legal Entities" section above):
Provide functionality to search, prepare and retrieve legal entity data from external sources
Used for KYC/AML verification and pre-population of legal entity data
Enhanced identification verification:
Moved to
/entities/identification-verificationsImproved data model and processing flow
Reference Model Changes
Entities will now only contain identifiers of related entities rather than nested objects:
For example, a joint person will contain natural person IDs (
firstNaturalPersonId,secondNaturalPersonId) instead of full natural person objectsSimilarly, legal entities will reference beneficial owners and legal representatives by ID
This approach reduces payload size and improves consistency in the API
To retrieve related entity details, use the appropriate entity endpoints with the referenced IDs
Role Management (roles.yaml)
Customer Role
New endpoints:
POST /roles/customers: Assign customer role to an entityGET /roles/customers: List customer rolesGET /roles/customers/{customerId}: Get specific customer rolePATCH /roles/customers/{customerId}: Update customer role
Proxy Role
New endpoints:
POST /roles/proxies: Assign proxy roleGET /roles/proxies: List proxiesGET /roles/proxies/{proxyId}: Get specific proxyPATCH /roles/proxies/{proxyId}: Update proxy
Key Changes in Proxy Model
The proxy role has undergone significant structural changes:
Entity-centric approach: Proxies are now associated with entities rather than customers
In the previous model, proxy was created via
/natural-persons/{naturalPersonId}/proxyand linked to customersIn the new model, proxies are created directly via
/roles/proxiesand linked to any entity type
ProxyData model changes:
Added
entityIdfield to replace the previouscustomerIdAdded
entityTypefield to specify the type of entity (natural person, legal entity, joint person)This allows proxies to be associated with any entity type, not just customers
Search and filtering:
New query parameter
entityIdfor filtering proxies by entity
Improved relationship model:
Clear separation between the natural person who acts as a proxy and the entity they represent
More flexible model that supports various business relationships
These changes align with the overall architecture shift toward clearly separating entities from roles, providing greater flexibility in modeling business relationships and processes.
Customer Labels
Endpoints moved to roles API:
GET /roles/customer-labels: List customer labelsPATCH /roles/customer-labels/{labelName}: Update labelDELETE /roles/customer-labels/{labelName}: Delete labelPATCH /roles/customer-labels/{labelName}/customers: Add label to customersPOST /roles/customer-labels/{labelName}/customers: Remove label from customers
Onboarding and Offboarding Process Changes
The onboarding process has been restructured to align with the entity-role architecture, with specific focuses for each type of onboarding:
Entity Onboarding (entities.yaml)
New model:
EntityOnboardingDatafocused on entity-centric onboardingNew endpoints:
POST /entities/onboardings: Start entity onboardingGET /entities/onboardings: List entity onboardingsGET /entities/onboardings/{onboardingId}: Get entity onboarding details
Entity Onboarding Purpose:
Primarily used for onboarding new beneficial owners for an already active legal entity customer
Requires an active legal entity customer to onboard a new beneficial owner associated with it
Does not handle complete customer onboarding flows
Role Onboarding (roles.yaml)
New model:
RoleOnboardingDatafocused on role-centric onboardingNew endpoints:
POST /roles/onboardings: Start role onboardingGET /roles/onboardings: List role onboardingsGET /roles/onboardings/{onboardingId}: Get role onboarding details
Role Onboarding Types:
Customer Onboarding
Comprehensive onboarding process that handles:
Onboarding of the customer role
Onboarding of all proxies associated with the customer
Onboarding of all beneficial owners associated with the customer (for legal entity customers)
Used for onboarding new customers to the system
Primary method for complete entity onboarding in the system
Proxy Onboarding
Specifically for onboarding new proxies for existing, already active customers
Only handles the proxy role and not the entire customer profile
Used when an active customer needs a new proxy added
Onboarding Process Flow Change
The new onboarding architecture reflects a more focused approach:
Customer role onboarding handles the comprehensive onboarding of customers and their related entities
Entity onboarding is specialized for beneficial owner onboarding for existing customers
Proxy onboarding is specialized for adding new proxies to existing customers
This change ensures each onboarding process has a clear, specific purpose while maintaining the separation between entities and roles.
Offboarding Process
Offboarding endpoints will be added soon to both entity and role APIs
Will support offboarding operations similar to the onboarding process
Will replace any previous offboarding functionality
Entity Offboarding (entities.yaml)
New model:
EntityOffboardingDatafocused on entity-centric offboardingNew endpoints:
POST /entities/offboardings: Start entity offboardingGET /entities/offboardings: List entity offboardingsGET /entities/offboardings/{offboardingId}: Get entity offboarding details
Entity Offboarding Purpose:
Primarily used for offboarding beneficial owners from an active legal entity customer
Supports inactivation of a beneficial owner while maintaining the legal entity customer
Does not handle complete customer offboarding flows
Role Offboarding (roles.yaml)
New model:
RoleOffboardingDatafocused on role-centric offboardingNew endpoints:
POST /roles/offboardings: Start role offboardingGET /roles/offboardings: List role offboardingsGET /roles/offboardings/{offboardingId}: Get role offboarding details
Role Offboarding Types:
Customer Offboarding
Comprehensive offboarding process that handles:
Offboarding of the customer role
Offboarding of all proxies associated with the customer
Offboarding of all beneficial owners associated with the customer (for legal entity customers)
Used for completely inactivating customers from the system
Primary method for complete entity offboarding
Proxy Offboarding
Specifically for offboarding proxies from existing, active customers
Only handles the proxy role and not the entire customer profile
Used when an active customer needs a proxy inactivated
Offboarding Process Flow Change
The new offboarding architecture reflects a more focused approach aligned with the entity-role separation:
Customer role offboarding handles the comprehensive offboarding of customers and their related entities
Entity offboarding is specialized for beneficial owner inactivation from existing customers
Proxy offboarding is specialized for inactivating proxies from existing customers
This change ensures each offboarding process has a clear, specific purpose while maintaining the separation between entities and roles, mirroring the structure established for onboarding processes.
Webhook Notifications
The following webhook endpoints are currently available to support the entity-role architecture:
Entity-Related Webhooks
/natural-person-notification: For natural person events/joint-person-notification: For joint person events (new)/identification-verification-notification: For verification events/beneficial-owner-notification: For beneficial owner events/legal-entity-notification: For legal entity events (new)/legal-representative-notification: For legal representative events (new)
Role-Related Webhooks
/customer-notification: For customer role events/proxy-notification: For proxy role events/labels-update-notification: For customer label updates
Process Webhooks
/onboarding-notification: For onboarding process updates/offboarding-notification: For offboarding process updates
Get Entities Endpoint
A new endpoint /entities has been added to provide a unified view of all entities in the system, regardless of their type.
This replaces the previous role-based organization of entities.
Key features:
Returns consolidated entity information
No longer includes roles (roles are now queried separately)
Provides better filtering and pagination options
Supports searching across entity types
Document Management Changes
1. Improved Document API Structure
The document management API has been restructured to follow a similar separation pattern as the main entity-role architecture:
Path Prefix Changes:
Previous API paths using
/documents/are now available under/v2/documents/Legacy endpoints are preserved with
-oldsuffix in their operation IDs for backward compatibility
New Document Resource Types:
Added dedicated
DocumentResourceTypeEnumwith values:NATURAL_PERSONLEGAL_ENTITYPARTNER_USERCUSTOMERPROXY
Standardized Document Status Enum:
Added dedicated
DocumentStatusEnumwith values:RECEIVEDINVALIDCREATEDPENDINGAPPROVEDREJECTEDARCHIVED
2. Resource-Type Specific Document Types
The document API now supports entity-specific document types, allowing better categorization:
Natural Person Documents:
General-purpose documents:
GENERAL,COMMUNICATION,MARKETING,TRAINING, etc.Identity verification:
IDENTIFICATION_CERTIFICATEResidence proof:
PROOF_OF_RESIDENCESpecial cases:
BIRTH_CERTIFICATE,KYCOther documents:
OTHER
Legal Entity Documents:
Generic documents:
KYCRegistry information:
CURRENT_REGISTRY_EXTRACT,CHRONOLOGICAL_REGISTRY_EXTRACTOwnership documents:
SHAREHOLDER_LIST,TRANSPARENCY_REGISTER_EXTRACTOrganizational documents:
PARTNERSHIP_AGREEMENT,STATUTE,BUSINESS_REGISTRATIONTax documents:
NON_ASSESSMENT_CERTIFICATE
Customer-specific Documents:
All customer types support:
GENERAL,CONTRACTS,ONBOARDING,COMMUNICATION,MARKETING,TRAINING,OTHERNatural person customers: additional
KYCdocument types
Proxy-specific Documents:
Guardian:
PROOF_OF_SINGLE_CUSTODY,PROOF_OF_CUSTODYLiquidator:
INSOLVENCY_ORDERGeneral proxy with death validity:
INHERITANCE_LEGITIMATION
3. Changelog Integration
The document management system is now fully integrated with the changelog API:
Added document-related changelog types:
CUSTOMER_DOCUMENTPROXY_DOCUMENTNATURAL_PERSON_DOCUMENTLEGAL_ENTITY_DOCUMENTDOCUMENT(generic type)
These changes align the document management system with the overall entity-role architecture, providing more precise document categorization based on the associated entity type and improved tracking of document-related events throughout the system.
Benefits of the New Architecture
Better Separation of Concerns:
Entity management and role management are clearly separated
Each API has a focused responsibility
Improved Modularity:
Easier to add new entity types
Easier to add new role types
Better component isolation
Enhanced Process Flows:
Clearer distinction between entity creation and role assignment
More intuitive API for complex operations
Better Search and Filtering:
New parameters and options for entity filtering
Enhanced query capabilities
Future Extensibility:
Architecture designed to scale with new entity types
Can accommodate new role types without structural changes
Migration Considerations
When migrating from the old API to the new structure:
Update client code to use the appropriate entity or role endpoint
Adjust to the new onboarding and offboarding processes
Update webhook handlers to support the new notification endpoints
Review entity status handling to accommodate the new, more specific status enums
Update role management logic to work with the separated role APIs
Conclusion
The migration from customers.yaml to entities.yaml and roles.yaml represents a significant architectural improvement
that brings greater flexibility, clarity, and maintainability to the API.
The clearer separation of entities from roles enables more powerful business processes
while simplifying the overall system architecture.
Last updated

