Create your first customer
Customers represent the people who use your product. Creating a customer gives you a record that you can use across Agent Wallets, MCP access, payments and events.
If your product uses OAuth, you do not need to create the customer before they connect. When the customer signs in for the first time, their identity can be used to create or associate their customer record automatically.
Learn more in Connect customer accounts.
Use client_reference_id to connect the customer to the corresponding user in your own system. This lets you keep your existing customer model while using Mitu for agent and payment experiences.
Create a customer
Send a request with the customer information you want to store. Set client_reference_id to the identifier you already use for the customer in your own system.
A successful request creates the customer and returns their customer ID, reference, MCP credentials and other customer information.
Save the customer
Keep the customer ID and your own customer reference together so you can identify the same customer across both systems.
Store the id alongside the corresponding customer in your system. For this example, cus_ds9hazr8jd3l belongs to the customer identified as your_user_8841.
The key belongs to the customer and should not be stored as a merchant credential. If you provide the key to the customer, treat it as a sensitive credential and only deliver it through a secure flow.
Handle retries safely
Include an Idempotency-Key when creating a customer. This allows you to retry the request without accidentally creating the customer more than once.
When the same idempotency key is used with the same request, the original successful response is returned. If the same key is reused with different request data, the API returns a 409 response.
The client_reference_id also identifies the customer using the identifier from your own system. Reusing the same reference resolves to the same customer rather than creating another customer.
Continue building
Now that you have created a customer, you can issue an Agent Wallet or learn how existing customer accounts can connect to AI clients.