Skip to content

Get Store Dashboard

Get dashboard statistics for the authenticated store.

Endpoint

GET /v1/products/store/dashboard/

Authentication

Required (Store role)

Response

Success (200 OK)

{
  "percent": 10.5,
  "total_sales": 25,
  "net_profit": 1125.50,
  "all_products": 1250,
  "currency": "AZN"
}

Response Fields

Field Type Description
percent float Store commission percentage
total_sales integer Total number of completed orders (orders with payment_status = "1")
net_profit float Net profit after commission deduction, calculated as: total revenue - (total revenue × percent / 100). All prices are converted to AZN. Rounded to 2 decimal places
all_products integer Total stock quantity across all product variants
currency string Currency code for the profit calculation (always "AZN")

Error Responses

Store Not Found (404)

{
  "error": "Store Not Found"
}

Unauthorized (401)

{
  "error": "Unauthorized"
}

Example Request

curl -X GET "https://api.luxmart.site/v1/products/store/dashboard/" \
  -H "Authorization: Token your_store_token"

Notes

  • all_products represents the sum of stock_quantity across all product variants owned by the store
  • Only counts non-deleted products and variants
  • total_sales counts only completed orders (payment_status = "1") for the authenticated store
  • net_profit is calculated from all completed orders:
  • All order prices are converted to AZN using currency exchange rates
  • Commission is deducted: net_profit = total_revenue - (total_revenue × percent / 100)
  • Result is rounded to 2 decimal places
  • Only non-deleted orders are included in calculations