Skip to main content

Get Most Ordered Products (v1)

Method & Path

GET /api/v1/workspace/:workspaceId/analytics/storefront/most-ordered

Description

Get the most ordered products for a workspace storefront, sorted by order count.

Authentication

Required: Workspace authentication. User must be authenticated as Workspace Owner or Staff with workspace.read permission.

Headers

Authorization: Bearer <workspace_token>
Content-Type: application/json

Path Parameters

ParameterTypeRequiredDescription
workspaceIdstringYesWorkspace identifier

Response 200 OK

{
"products": [
{
"productId": "507f1f77bcf86cd799439011",
"productName": "Product A",
"orderCount": 45,
"totalQuantity": 120
},
{
"productId": "507f1f77bcf86cd799439012",
"productName": "Product B",
"orderCount": 32,
"totalQuantity": 85
}
]
}

Response Fields

products

Array of product objects (top 10), sorted by orderCount:

  • productId (string): Product identifier
  • productName (string): Product name
  • orderCount (number): Number of orders containing this product
  • totalQuantity (number): Total quantity ordered across all orders

Common Errors

401 Unauthorized: Missing or invalid authentication token

403 Forbidden: User does not have workspace.read permission

404 Not Found: Workspace or storefront not found

500 Internal Server Error: Server error occurred while processing the request

Notes

  • Returns top 10 most ordered products
  • Products are sorted by order count (descending)
  • Only includes products that have been ordered at least once