Customer CRUD Operations
Create, read, update, and delete customer relationships between Sellers and Buyers
POST
/customersCreate Customer Relationship
Create a new customer relationship between an seller (seller) and Buyer (buyer)
Request Body
Request
{
"sellerId": "Seller_123",
"buyerId": "Buyer_456",
"status": "Active",
"customerType": "New",
"isFollower": true,
"followStatus": "Following",
"notificationPreference": "All",
"notes": "Interested in fitness consultations",
"tags": ["fitness", "beginner"],
"isFavorite": false
}Response
Response (200 OK)
{
"data": {
"id": "cus_123456",
"referenceId": "CUS_123456",
"sellerId": "Seller_123",
"buyerId": "Buyer_456",
"status": "Active",
"customerType": "New",
"isFollower": true,
"createdAt": "2025-10-08T10:00:00Z"
},
"message": "Customer relationship created successfully",
"success": true
}GET
/customers/{id}Get Customer by ID
Get customer relationship details by customer ID
Response
Response (200 OK)
{
"data": {
"id": "cus_123456",
"referenceId": "CUS_123456",
"sellerId": "Seller_123",
"buyerId": "Buyer_456",
"status": "Active",
"customerType": "Regular",
"isFollower": true,
"totalBookings": 5,
"totalSpent": 500.00,
"lifetimeValue": 500.00,
"lastInteraction": "2025-10-07T15:30:00Z"
},
"message": "Customer retrieved successfully",
"success": true
}PUT
/customers/{id}Update Customer Relationship
Update an existing customer relationship
Request Body
Request
{
"status": "Active",
"customerType": "VIP",
"isFollower": true,
"isFavorite": true,
"notes": "Upgraded to VIP status",
"tags": ["fitness", "vip", "regular"]
}Response
Response (200 OK)
{
"data": {
"id": "cus_123456",
"customerType": "VIP",
"isFavorite": true,
"updatedAt": "2025-10-08T10:00:00Z"
},
"message": "Customer updated successfully",
"success": true
}DELETE
/customers/{id}Delete Customer Relationship
Delete a customer relationship
Response
Response (200 OK)
{
"data": {
"id": "cus_123456",
"deleted": true
},
"message": "Customer relationship deleted successfully",
"success": true
}GET
/customersList All Customers
List all customers with pagination and filtering
Query Parameters
Query Parameters
page=1&limit=20&status=Active&customerType=VIPResponse
Response (200 OK)
{
"data": {
"customers": [
{
"id": "cus_123456",
"referenceId": "CUS_123456",
"buyerName": "John Doe",
"customerType": "VIP",
"totalBookings": 5,
"totalSpent": 500.00,
"lastInteraction": "2025-10-07T15:30:00Z"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 1
}
},
"message": "Customers retrieved successfully",
"success": true
}