Customers
Customer model
Section titled “Customer model”{ "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"}Registration
Section titled “Registration”POST /api/v1/auth/register{ "email": "john@example.com", "password": "securepassword123", "first_name": "John", "last_name": "Doe"}Returns access token and refresh token.
POST /api/v1/auth/login{ "email": "john@example.com", "password": "securepassword123"}Returns access token (24h) and refresh token (7d).
Addresses
Section titled “Addresses”Customers can have multiple addresses:
# List addressesGET /api/v1/customers/:id/addresses
# Add addressPOST /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}Password reset
Section titled “Password reset”# Request resetPOST /api/v1/auth/password-reset{ "email": "john@example.com" }
# Confirm resetPOST /api/v1/auth/password-reset/confirm{ "token": "jwt_token", "new_password": "newpassword123" }Reset links are sent via email with a 1-hour JWT token.
Imported customers
Section titled “Imported customers”Customers imported from WooCommerce have is_imported = true and no local password. They must reset their password before logging in.
Customer roles
Section titled “Customer roles”| Role | Description |
|---|---|
customer | Default role, can place orders |
admin | Full access to admin API |
Promote via SQL: UPDATE customers SET role = 'admin' WHERE email = 'admin@example.com';