Flavours API
ReportProduct

Product Orders List

GET
/api/v2/reports/products/{productId}/orders

Paginated list of orders containing the given product within a date range + branch window, with each order's refund status (Completed/Refunded/Partially Refunded).

AuthorizationBearer <token>

You can retrieve your token by logging in.

In: header

Path Parameters

productId*string

Header Parameters

X-API-Version*string

API contract version to target. See the Changelog for what changed in each version.

Default"2.0.0"
Value in"2.3.0" | "2.2.0" | "2.1.0" | "2.0.0"

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X GET "https://api.flavours.sa/dev/api/v2/reports/products/consectetur/orders" \  -H "X-API-Version: 2.3.0"
{
  "meta": {
    "code": 200,
    "status": "success",
    "message": "Product orders list retrieved successfully."
  },
  "data": {
    "current_page": 1,
    "data": [
      {
        "order_id": "a7b2c7dd-f227-471b-b95a-2872bd673da1",
        "order_number": "DOC-ORDERS-1",
        "order_created_at": 1787446704084,
        "branch_id": "7c538fd7-9547-4b16-959d-f01052e04c6f",
        "branch_name_en": "Pacocha LLC",
        "branch_name_ar": "Pacocha LLC",
        "cashier_id": null,
        "cashier_name": null,
        "product_quantity": 3,
        "order_total": "30",
        "order_status": "COMPLETED"
      }
    ],
    "first_page_url": "http://localhost:8000/api/v2/reports/products/4914b85b-0c56-4794-a30f-710a64b8f780/orders?page=1",
    "from": 1,
    "last_page": 1,
    "last_page_url": "http://localhost:8000/api/v2/reports/products/4914b85b-0c56-4794-a30f-710a64b8f780/orders?page=1",
    "links": [
      {
        "url": null,
        "label": "&laquo; Previous",
        "page": null,
        "active": false
      },
      {
        "url": "http://localhost:8000/api/v2/reports/products/4914b85b-0c56-4794-a30f-710a64b8f780/orders?page=1",
        "label": "1",
        "page": 1,
        "active": true
      },
      {
        "url": null,
        "label": "Next &raquo;",
        "page": null,
        "active": false
      }
    ],
    "next_page_url": null,
    "path": "http://localhost:8000/api/v2/reports/products/4914b85b-0c56-4794-a30f-710a64b8f780/orders",
    "per_page": 20,
    "prev_page_url": null,
    "to": 1,
    "total": 1
  }
}
{
  "meta": {
    "code": 401,
    "status": "error",
    "message": "Unauthenticated."
  },
  "data": null
}
{
  "meta": {
    "code": 403,
    "status": "error",
    "message": "Unauthorized."
  },
  "data": null
}
{
  "meta": {
    "code": 404,
    "status": "error",
    "message": "Resource not found."
  },
  "data": null
}
{
  "meta": {
    "code": 500,
    "status": "error",
    "message": "Internal server error."
  },
  "data": null
}