The CRM plugin helps you manage real-world person data across your platform, enabling better segmentation, validation, and personalization across your ecosystem.


Enabling CRM


After installing CRM, open the .env file with any text editor and update the following variables before getting started:

# DATA SECURITY
LCRYPTO_HASH_SECRET_KEY=my-hash-secret-key
LCRYPTO_ENCRYPT_SECRET_KEY=my-encrypt-secret-key
  • LCRYPTO_HASH_SECRET_KEY: This is your hashing key. It checks data integrity and confirms that requests come from a trusted source.
  • LCRYPTO_ENCRYPT_SECRET_KEY: This is your encryption key. It protects sensitive data by encrypting it and decrypts it when needed.

You’ll need to generate these keys yourself and paste them into the .env file. You can use the following command to generate the keys:

  • Each key must be unique, so you will have to run the command twice, once for each key, to generate separate, secure values.

Generate a hashing key

openssl rand -hex 32

Generate an encryption key

openssl rand -hex 32

❗️

Important

Keep your keys safe: Once generated, store your keys securely. We recommend using a Secret Manager to protect them from exposure.


Typical usage


Here’s how you can get started:

Step 1 – Create the Holder

Start by creating a holder, which represents an individual or organization in the system.

⚠️

Heads up

While many fields are marked as optional at the API contract level, some plugins (like CRM or KYC integrations) may require them. If you're unsure, check the plugin's specific requirements before proceeding.


Also note:

  • The API doesn’t validate the accuracy of the data.
  • Supplying incorrect values (like mismatched ledgerId or accountId) may result in integration failures, especially with external providers or the Ledger component.

Take extra care to provide valid identifiers and real data when needed.


Managing Holders

You can also perform actions such as:


Step 2 – Connect the holder to Midaz using an Alias Account

Once the holder is created, use the Create an Alias Account endpoint to set up an Alias Account (a CRM-level account that represents the Midaz Account) and link the Holder to it in a single step. This link is key to:

  • Tracking transactions tied to the holder
  • Enabling fees, notifications, and other account-level features
  • Powering downstream flows like billing and identity verification

Without this connection, most CRM-driven features won’t work as expected.


Managing Alias Accounts

You can also perform actions such as:



What happens next?


With holders properly created and linked, you can now:

  • Enrich CRM data with additional plugins (e.g., KYC, scoring, segmentation)
  • Trigger workflows that depend on identity or organizational attributes
  • Validate or filter transactions based on person-level data

The CRM plugin lays the foundation; what you build on top is up to you.