Sales API Documentation

Postman Documentation

For detailed information and usage examples, refer to the Sales API Postman Documentation.

API Endpoints

Total Revenue

  • Endpoint: GET /api/sales/total-revenue
  • Description: Calculate and return the total revenue generated by all sales transactions.

Quantity by Product

  • Endpoint: GET /api/sales/quantity-by-product
  • Description: Find and return the total quantity sold for each product.

Top Products

  • Endpoint: GET /api/sales/top-products
  • Description: Retrieve the top 5 products with the highest total revenue, along with their total revenue values.

Average Price

  • Endpoint: GET /api/sales/average-price
  • Description: Calculate and return the average price of products sold.

Revenue by Month

  • Endpoint: GET /api/sales/revenue-by-month
  • Description: Group the sales data by month and year and calculate the total revenue for each month-year combination.

Highest Quantity Sold

  • Endpoint: GET /api/sales/highest-quantity-sold
  • Description: Find and return the product that had the highest quantity sold on a single day.

Department Salary Expense

  • Endpoint: GET /api/sales/department-salary-expense
  • Description: Calculate and return the total salary expense for each department.