Skip to content

Customers

{
"id": "uuid",
"email": "john@example.com",
"first_name": "John",
"last_name": "Doe",
"phone": "+12125551234",
"role": "customer",
"is_active": true,
"created_at": "2024-01-01T00:00:00Z"
}
Terminal window
POST /api/v1/auth/register
{
"email": "john@example.com",
"password": "securepassword123",
"first_name": "John",
"last_name": "Doe"
}

Returns access token and refresh token.

Terminal window
POST /api/v1/auth/login
{
"email": "john@example.com",
"password": "securepassword123"
}

Returns access token (24h) and refresh token (7d).

Customers can have multiple addresses:

Terminal window
# List addresses
GET /api/v1/customers/:id/addresses
# Add address
POST /api/v1/customers/:id/addresses
{
"first_name": "John",
"last_name": "Doe",
"address1": "123 Main St",
"city": "New York",
"state": "NY",
"country": "US",
"zip": "10001",
"phone": "+12125551234",
"is_default_shipping": true
}
Terminal window
# Request reset
POST /api/v1/auth/password-reset
{ "email": "john@example.com" }
# Confirm reset
POST /api/v1/auth/password-reset/confirm
{ "token": "jwt_token", "new_password": "newpassword123" }

Reset links are sent via email with a 1-hour JWT token.

Customers imported from WooCommerce have is_imported = true and no local password. They must reset their password before logging in.

RoleDescription
customerDefault role, can place orders
adminFull access to admin API

Promote via SQL: UPDATE customers SET role = 'admin' WHERE email = 'admin@example.com';