Customers
Manage your customer database. Customers are automatically created when you create an order with a customer email or phone. Each customer tracks loyalty points, total spent, and purchase history.
Endpoints
GET/customersList customers
GET/customers/:idGet customer
POST/customersCreate customer
PUT/customers/:idUpdate customer
DELETE/customers/:idDeactivate customer
List customers - GET /customers
| Parameter | Description |
|---|---|
| search | Search by name, email, or phone |
| is_active | Filter by status (default: true) |
| page, per_page | Pagination |
Customer response object
{
"id": "7d2e1f09-...",
"name": "Sarah Johnson",
"email": "[email protected]",
"phone": "+1-555-0100",
"address": "123 Main St",
"city": "New York",
"country": "US",
"is_active": true,
"loyalty_points": 1450,
"total_orders": 12,
"total_spent": 1450.75,
"last_purchase_date": "2026-06-01T10:30:00.000Z",
"created_at": "2025-12-01T09:00:00.000Z"
}
Create customer - POST /customers
| Field | Type | Required |
|---|---|---|
| name | String | required |
| String | optional | |
| phone | String | optional |
| address | String | optional |
| city | String | optional |
| country | String | optional |
| notes | String | optional |