Skip to main content

Customers API

The Customers endpoint allows you to create, read, update, and delete customers in your WooCommerce store.

The Customer Object

Customer Properties

integer
required
Unique identifier for the customer. Read-only.
string
The date the customer was created, in ISO8601 format. Read-only.
string
The date the customer was last modified, in ISO8601 format. Read-only.
string
required
The email address for the customer.
string
Customer first name.
string
Customer last name.
string
Customer role. Read-only.
string
Customer login name. Cannot be changed after creation.
string
Customer password. Write-only (never returned in responses).
object
Billing address.
object
Shipping address.
boolean
Whether the customer has made a purchase. Read-only.
string
Avatar URL. Read-only.

List All Customers

Retrieve a list of all customers in your store.

Query Parameters

integer
default:"1"
Current page of the collection.
integer
default:"10"
Maximum number of items to return (max 100).
Limit results to those matching a string (searches username, email, first name, last name).
string
Limit result set to customers with a specific email.
string
default:"all"
Limit result set to customers with specific role. Options: all, administrator, editor, author, contributor, subscriber, customer, shop_manager
string
default:"name"
Sort customers by attribute. Options: id, include, name, registered_date
string
default:"asc"
Order sort direction. Options: asc, desc

Example Response

Retrieve a Customer

Get details of a single customer by ID.

Create a Customer

Create a new customer in your store.

Required Fields

string
required
Customer email address (must be unique)

Important Fields

string
Customer login name. Auto-generated from email if not provided. Cannot be changed after creation.
string
Customer password. Auto-generated if not provided.
string
Customer first name
string
Customer last name
object
Billing address object (see Customer Object above)
object
Shipping address object (see Customer Object above)

Update a Customer

Update an existing customer.
The username field cannot be updated after a customer is created.

Delete a Customer

Delete a customer permanently.

Parameters

boolean
default:"false"
Required to be true as customers do not support trashing.
integer
User ID to reassign posts to. Required when deleting a customer with posts.
Deleting a customer is permanent and cannot be undone. Consider deactivating the user account instead if you need to preserve data.

Batch Update Customers

Create, update, and delete multiple customers in a single request.

Common Use Cases

Find Customer by Email

Search Customers

Update Customer Address

Get Customer Orders

To retrieve a customer’s orders, use the Orders endpoint with the customer parameter:

Reset Customer Password

Customer Downloads

Manage downloadable product permissions for customers.

List Customer Downloads

Response:

Error Handling

Invalid Customer ID

Email Already Exists

Invalid Email Format

Username Already Exists

Security Considerations

Protecting Customer Data

Customer data includes personal information. Ensure you:
  • Use HTTPS for all API requests
  • Store API credentials securely
  • Limit API key permissions to necessary operations
  • Comply with GDPR and other privacy regulations
  • Never log or display customer passwords

GDPR Compliance

When working with customer data:
  1. Data Access: Customers have the right to access their data
  2. Data Portability: Allow customers to export their data
  3. Right to Erasure: Implement customer data deletion
  4. Consent: Ensure proper consent for data processing

Password Security

Next Steps

Orders API

View customer orders

Products API

Manage store products