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
string
Comma-separated list of fields to include.
number
default:"15"
Maximum number of customers to return.
number
default:"0"
Number of customers to skip.
string
Search query for customer name or email.
string
Filter by exact email address.
boolean
Filter by whether customer has an account.
string[]
Filter by customer group IDs.
object
Filter by creation date range.
Request
Response
Customer[]
Array of customer objects.
number
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
string
required
The customer’s email address.
string
The customer’s first name.
string
The customer’s last name.
string
The customer’s phone number.
string
The customer’s company name.
object
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
string
required
The customer’s ID.
Request
Response
Update Customer
Update customer information.Path Parameters
string
required
The customer’s ID.
Request Body
string
Update the email address.
string
Update the first name.
string
Update the last name.
string
Update the phone number.
string
Update the company name.
object
Update custom metadata.
Request
Response
Delete Customer
Delete a customer (soft delete).Path Parameters
string
required
The customer’s ID.
Request
Response
Customer Addresses
Create Address
Add a new address to a customer.Request Body
string
First name for the address.
string
Last name for the address.
string
Company name.
string
required
Address line 1.
string
Address line 2.
string
required
City name.
string
State/province.
string
required
Postal/ZIP code.
string
required
Two-letter ISO country code (e.g., “us”).
string
Phone number.
object
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
string[]
required
Array of customer IDs to add to the group.
Remove from Group
Remove a customer from a customer group.Request Body
string[]
required
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