Prerequisites
Before you begin, make sure the following requirements are met:
- You have completed the Midaz setup guide and all services are running.
- At least one Organization, Ledger, and Account already exist (as created in the Midaz Getting Started guide).
- The CRM service is running on port 4003 (started automatically with
make up).
In the examples below, replace the placeholder UUIDs with the actual IDs from your environment.
CRM components
The CRM (Customer Relationship Management) component lets you register the people and companies behind your ledger accounts. It manages two core entities:
- Holders: Individuals (
NATURAL_PERSON) or companies (LEGAL_PERSON) that own accounts. - Aliases: The link between a holder and a specific ledger account, with optional banking details.
Step 1 — Create a holder
A Holder represents a person or company in your system. You can create holders for individuals (
NATURAL_PERSON) or companies (LEGAL_PERSON).
Send a POST request with the holder’s type, name, document, contact information, and address. For the full request and response schema, see Create a holder.
Individual holder example
Individual holder example
Company holder example
Company holder example
To register a company instead of an individual, set the type to
LEGAL_PERSON:Step 2 — Link a holder to an account
Once the holder exists, link it to a ledger account by creating an Alias. An alias connects a holder to a specific account inside a ledger, with optional banking details. For the full request and response schema, see Create an alias account.
Example request
Example request
Step 3 — Query and update your data
Once holders and aliases are created, you can retrieve, list, and update them.
| Operation | Endpoint | API reference |
|---|---|---|
| Retrieve a holder | GET /v1/holders/<holder-id> | Retrieve a holder |
| List all holders | GET /v1/holders?limit=10&page=1 | List holders |
| List aliases for a holder | GET /v1/aliases?holder_id=<holder-id> | List alias accounts |
| Retrieve a specific alias | GET /v1/holders/<holder-id>/aliases/<alias-id> | Retrieve an alias account |
| Update a holder | PATCH /v1/holders/<holder-id> | Update a holder |
Update holder example
Update holder example
Only the fields included in the request body are updated. All other fields remain unchanged.
Step 4 — Clean up
To remove resources, delete aliases first, then holders.
| Operation | Endpoint | API reference |
|---|---|---|
| Delete an alias | DELETE /v1/holders/<holder-id>/aliases/<alias-id> | Delete an alias account |
| Delete a holder | DELETE /v1/holders/<holder-id> | Delete a holder |
Example requests
Example requests
Delete an alias:Delete a holder:
Summary
In this guide, you:
- Created a Holder to register an individual or company in CRM.
- Created an Alias to link the holder to a ledger account.
- Queried and updated CRM data.
- Removed aliases and holders when no longer needed.

