Skip to main content

Customers API

Endpoints untuk mengelola customer data dan loyalty program.

GET /customers

List all customers.
GET /api/v1/customers?page=1&limit=20&search=john
Authorization: Bearer {token}
X-Merchant-ID: merchant_abc

POST /customers

Create new customer.
POST /api/v1/customers
Authorization: Bearer {token}

{
  "name": "John Doe",
  "email": "[email protected]",
  "phone": "+6281234567890",
  "address": "Jakarta"
}

GET /customers/:id/loyalty

Get customer loyalty points.
GET /api/v1/customers/cust_123/loyalty
Authorization: Bearer {token}
Response:
{
  "data": {
    "customer_id": "cust_123",
    "points": 1500,
    "tier": "gold",
    "lifetime_value": 5000000
  }
}