Skip to main content

Overview

Retrieve a paginated list of all orders for your tenant. Orders are automatically filtered by the tenant specified in the X-Tenant-ID header.

Authorization

  • User must be authenticated with a valid Bearer token
  • User must be a member of the tenant
  • Requires X-Tenant-ID header

Tenant Scoping

Only orders belonging to the specified tenant will be returned. This ensures complete data isolation between tenants.

Response

Returns a paginated list of orders with related data including:
  • Order items
  • User information
  • Delivery address
  • Product details

Example Usage

curl -X GET \
  https://faisalshop.mvp-apps.ae/api/v2/admin/orders \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'X-Tenant-ID: 123'
const response = await axios.get('/api/v2/admin/orders', {
  headers: {
    Authorization: `Bearer ${token}`,
    'X-Tenant-ID': tenantId
  }
});

console.log(response.data);

Response Example

{
  "success": true,
  "data": {
    "current_page": 1,
    "data": [
      {
        "id": 1,
        "user_id": 5,
        "tenant_id": "123",
        "address_id": 2,
        "payment_type": 1,
        "total_amount": "99.99",
        "created_at": "2025-11-16T10:30:00.000000Z",
        "updated_at": "2025-11-16T10:30:00.000000Z",
        "items": [
          {
            "id": 1,
            "order_id": 1,
            "product_id": 10,
            "size": "Large",
            "qty": 2,
            "amount": "49.99",
            "notes": "Extra packaging",
            "product": {
              "id": 10,
              "name_en": "Premium Coffee"
            }
          }
        ],
        "user": {
          "id": 5,
          "name": "John Doe",
          "email": "[email protected]"
        },
        "address": {
          "id": 2,
          "street": "123 Main St",
          "city": "Dubai"
        }
      }
    ],
    "per_page": 20,
    "total": 45
  }
}