Get All Customers
Retrieve a list of all customers with optional filtering and pagination.GET
Endpoint: /customers
Query Parameters
Page number for pagination
Number of customers per page
Search term to filter customers by name or email
Field to sort by (e.g., firstName, lastName, email)
Sort order: “asc” or “desc”
Response
Indicates if the request was successful
Array of customer objects
Total number of customers
Current page number
Number of items per page
Search Customers
Search for customers in real-time (autocomplete functionality).GET
Endpoint: /customers/search
Query Parameters
Search query string
Response
Indicates if the request was successful
Array of matching customer objects
Get Customer by ID
Retrieve a specific customer with their purchase history.GET
Endpoint: /customers/{customerId}
Path Parameters
Unique identifier of the customer
Response
Indicates if the request was successful
Customer object with purchase history
Create Customer
Create a new customer.POST
Endpoint: /customers
Request Body
Customer’s first name
Customer’s last name
Customer’s email address
Customer’s phone number
Customer’s physical address
Response
Indicates if the customer was created successfully
Created customer object
Success message
Update Customer
Update an existing customer’s information.PUT
Endpoint: /customers/{customerId}
Path Parameters
Unique identifier of the customer
Request Body
Updated first name
Updated last name
Updated email address
Updated phone number
Updated address
Response
Indicates if the customer was updated successfully
Updated customer object
Delete Customer
Delete a customer from the system.DELETE
Endpoint: /customers/{customerId}
Path Parameters
Unique identifier of the customer to delete
Response
Indicates if the customer was deleted successfully
Success message