Customers API

Manage customer profiles, groups, and purchase history

15 endpoints

Base URL:https://api.nexapay.com/v1
MethodPathDescription
GET/customersList all customers
POST/customersCreate new customer
GET/customers/{customer_id}Get customer details
PUT/customers/{customer_id}Update customer
DELETE/customers/{customer_id}Delete customer
GET/customers/searchSearch customers
GET/customers/phone/{phone}Lookup by phone
GET/customers/email/{email}Lookup by email
GET/customers/{customer_id}/ordersGet customer orders
GET/customers/{customer_id}/transactionsGet transaction history
GET/customers/{customer_id}/favoritesGet favorite items
GET/customer-groupsList customer groups
POST/customer-groupsCreate customer group
POST/customers/{customer_id}/groupsAdd customer to group
DELETE/customers/{customer_id}/groups/{group_id}Remove from group

Detailed Examples

POST/customers

Request Body

{
  "first_name": "Jane",
  "last_name": "Doe",
  "email": "jane.doe@email.com",
  "phone": "+1-555-123-4567",
  "birthday": "1990-05-15",
  "address": {
    "street": "789 Main St",
    "city": "Las Vegas",
    "state": "NV",
    "zip": "89101"
  },
  "preferences": {
    "marketing_emails": true,
    "sms_notifications": true
  },
  "notes": "Prefers oat milk in coffee"
}

Response

{
  "success": true,
  "data": {
    "id": "cust_abc123",
    "first_name": "Jane",
    "last_name": "Doe",
    "email": "jane.doe@email.com",
    "phone": "+1-555-123-4567",
    "loyalty_points": 0,
    "total_visits": 0,
    "total_spent": 0,
    "member_since": "2024-01-15",
    "created_at": "2024-01-15T10:00:00Z"
  }
}