Overview
The Customers API allows administrators to create, update, and manage customer accounts, their addresses, and customer group memberships. Base Path:/admin/customers
Source: packages/medusa/src/api/admin/customers/route.ts
List Customers
Retrieve a list of customers with filtering and pagination.Query Parameters
Comma-separated list of fields to include.
Maximum number of customers to return.
Number of customers to skip.
Search query for customer name or email.
Filter by exact email address.
Filter by whether customer has an account.
Filter by customer group IDs.
Filter by creation date range.
Request
Response
Array of customer objects.
Total number of customers matching the filters.
packages/medusa/src/api/admin/customers/route.ts:15
Create Customer
Create a new customer account.Request Body
The customer’s email address.
The customer’s first name.
The customer’s last name.
The customer’s phone number.
The customer’s company name.
Key-value pairs of custom metadata.
Request
Response
packages/medusa/src/api/admin/customers/route.ts:40
Note: The created_by field is automatically set to the authenticated admin user’s ID (see line 53).
Get Customer
Retrieve a single customer by ID.Path Parameters
The customer’s ID.
Request
Response
Update Customer
Update customer information.Path Parameters
The customer’s ID.
Request Body
Update the email address.
Update the first name.
Update the last name.
Update the phone number.
Update the company name.
Update custom metadata.
Request
Response
Delete Customer
Delete a customer (soft delete).Path Parameters
The customer’s ID.
Request
Response
Customer Addresses
Create Address
Add a new address to a customer.Request Body
First name for the address.
Last name for the address.
Company name.
Address line 1.
Address line 2.
City name.
State/province.
Postal/ZIP code.
Two-letter ISO country code (e.g., “us”).
Phone number.
Custom metadata.
Request
Update Address
Update a customer’s address.Delete Address
Remove an address from a customer.packages/medusa/src/api/admin/customers/[id]/addresses/[address_id]/route.ts
Customer Groups
Add to Group
Add a customer to a customer group.Request Body
Array of customer IDs to add to the group.
Remove from Group
Remove a customer from a customer group.Request Body
Array of customer IDs to remove from the group.
packages/medusa/src/api/admin/customer-groups/[id]/customers/route.ts
Next Steps
Orders
View customer orders
Customer Module
Learn about customer management