> ## Documentation Index
> Fetch the complete documentation index at: https://developer.lulacommerce.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Store Orders

> Retrieve all orders for a specific store with flexible filtering options including date ranges, status, and pagination.

This endpoint provides comprehensive access to all orders for a specific store with powerful filtering capabilities. Perfect for store management, reporting, and operational oversight.

<Info>
  This endpoint supports advanced filtering and pagination to efficiently handle large volumes of order data while providing flexible search capabilities.
</Info>

### Query Parameters

<ParamField query="store_id" type="string" required>
  The unique identifier of the store whose orders you want to retrieve
</ParamField>

<ParamField query="status" type="string" optional>
  Filter orders by status (e.g., "pending", "accepted", "in\_progress", "completed", "canceled")
</ParamField>

<ParamField query="partner" type="string" optional>
  Filter by delivery platform (e.g., "DoorDash", "UberEats", "GrubHub", "LulaDirect")
</ParamField>

<ParamField query="date_from" type="string" optional>
  Start date for filtering orders (ISO 8601 format: YYYY-MM-DDTHH:mm:ssZ)
</ParamField>

<ParamField query="date_to" type="string" optional>
  End date for filtering orders (ISO 8601 format: YYYY-MM-DDTHH:mm:ssZ)
</ParamField>

<ParamField query="page" type="integer" optional default="1">
  Page number for pagination
</ParamField>

<ParamField query="limit" type="integer" optional default="50">
  Number of orders per page (max 100)
</ParamField>

<ParamField query="sort_by" type="string" optional default="createdAt">
  Field to sort by ("createdAt", "price", "status", "partner")
</ParamField>

<ParamField query="sort_order" type="string" optional default="desc">
  Sort direction ("asc" or "desc")
</ParamField>

### Response

<ResponseField name="orders" type="array">
  Array of order objects matching the filter criteria

  <Expandable title="Order Object">
    <ResponseField name="id" type="string">
      Unique order identifier
    </ResponseField>

    <ResponseField name="original_subtotal" type="string">
      Order subtotal before taxes and fees
    </ResponseField>

    <ResponseField name="tax_amount" type="string">
      Tax amount applied to the order
    </ResponseField>

    <ResponseField name="discount" type="string">
      Discount amount (null if no discount applied)
    </ResponseField>

    <ResponseField name="original_price" type="string">
      Original total price
    </ResponseField>

    <ResponseField name="price" type="string">
      Current order price
    </ResponseField>

    <ResponseField name="final_price" type="string">
      Final price after all modifications
    </ResponseField>

    <ResponseField name="createdAt" type="string">
      Order creation timestamp
    </ResponseField>

    <ResponseField name="partner" type="string">
      Delivery service platform name
    </ResponseField>

    <ResponseField name="status" type="string">
      Current order status
    </ResponseField>

    <ResponseField name="special_instructions" type="string">
      Customer-provided special instructions
    </ResponseField>

    <ResponseField name="customer" type="object">
      Customer information including name and contact details
    </ResponseField>

    <ResponseField name="fulfillments" type="array">
      Fulfillment tracking information
    </ResponseField>

    <ResponseField name="orderItems" type="array">
      Summary of items in the order
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="pagination" type="object">
  Pagination information for the response

  <Expandable title="Pagination Details">
    <ResponseField name="current_page" type="integer">
      Current page number
    </ResponseField>

    <ResponseField name="total_pages" type="integer">
      Total number of pages available
    </ResponseField>

    <ResponseField name="total_orders" type="integer">
      Total number of orders matching the criteria
    </ResponseField>

    <ResponseField name="orders_per_page" type="integer">
      Number of orders in this page
    </ResponseField>

    <ResponseField name="has_next_page" type="boolean">
      Whether there are more pages available
    </ResponseField>

    <ResponseField name="has_previous_page" type="boolean">
      Whether there are previous pages available
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="summary" type="object">
  Summary statistics for the filtered orders

  <Expandable title="Summary Statistics">
    <ResponseField name="total_revenue" type="string">
      Total revenue from filtered orders
    </ResponseField>

    <ResponseField name="average_order_value" type="string">
      Average order value
    </ResponseField>

    <ResponseField name="status_breakdown" type="object">
      Count of orders by status
    </ResponseField>

    <ResponseField name="partner_breakdown" type="object">
      Count of orders by delivery platform
    </ResponseField>
  </Expandable>
</ResponseField>

### Response Example

```json theme={null}
{
  "orders": [
    {
      "id": "35d18f08-6d54-421d-9476-8cef629111bc",
      "original_subtotal": "41.00",
      "tax_amount": "0.02",
      "discount": null,
      "original_price": "41.02",
      "price": "0.20",
      "final_price": "0.20",
      "createdAt": "2023-03-08T12:25:07.433Z",
      "partner": "UberEats",
      "status": "completed",
      "special_instructions": "Packing should be good.",
      "customer": {
        "customer_name": "Lula D.",
        "contact_phone": "+1 312-766-6835"
      },
      "fulfillments": [
        {
          "id": "f60a1ebf-c9fd-4c5a-b25f-db5f59e03851",
          "status": "delivered",
          "date_ready": "2023-04-04T22:10:33.233Z"
        }
      ],
      "orderItems": [
        {
          "id": "7fbe2819-5bc6-4340-8dfe-a5605272a32b",
          "quantity": 1,
          "store_item_name": "Jumbo Ring Pop - 1",
          "store_item_total_price": "1.00"
        }
      ]
    }
  ],
  "pagination": {
    "current_page": 1,
    "total_pages": 5,
    "total_orders": 247,
    "orders_per_page": 50,
    "has_next_page": true,
    "has_previous_page": false
  },
  "summary": {
    "total_revenue": "12,847.50",
    "average_order_value": "52.03",
    "status_breakdown": {
      "completed": 198,
      "in_progress": 15,
      "pending": 8,
      "canceled": 26
    },
    "partner_breakdown": {
      "UberEats": 95,
      "DoorDash": 87,
      "GrubHub": 45,
      "LulaDirect": 20
    }
  }
}
```

<Accordion title="Filter Examples">
  **Get Today's Orders**

  ```
  GET {{micro_service_base_url}}/orders/?store_id=449235c1-3d04-4519-998b-40d2a621e5e0&date_from=2024-01-15T00:00:00Z&date_to=2024-01-15T23:59:59Z
  ```

  **Get Pending Orders from UberEats**

  ```
  GET {{micro_service_base_url}}/orders/?store_id=449235c1-3d04-4519-998b-40d2a621e5e0&status=pending&partner=UberEats
  ```

  **Get Last Week's Completed Orders**

  ```
  GET {{micro_service_base_url}}/orders/?store_id=449235c1-3d04-4519-998b-40d2a621e5e0&status=completed&date_from=2024-01-08T00:00:00Z&date_to=2024-01-14T23:59:59Z
  ```
</Accordion>

<Tip>
  **Performance Optimization**: When querying large date ranges, consider using smaller page sizes (limit parameter) and implement pagination to maintain fast response times.
</Tip>

<Note>
  **Time Zones**: All timestamps are returned in UTC. Convert to your local timezone as needed for display purposes.
</Note>

<Warning>
  **Rate Limiting**: This endpoint is subject to rate limiting. For frequent polling, consider using webhooks or the order count endpoint for basic monitoring.
</Warning>

### Use Cases

<Accordion title="Common Use Cases">
  **Daily Operations Dashboard**

  * Get today's orders with status filtering
  * Monitor pending orders requiring attention
  * Track fulfillment performance

  **Financial Reporting**

  * Calculate daily/weekly/monthly revenue
  * Analyze order value trends
  * Track performance by delivery platform

  **Performance Analytics**

  * Monitor order completion rates
  * Analyze peak order times
  * Track customer satisfaction metrics

  **Inventory Planning**

  * Review historical order patterns
  * Identify popular items and trends
  * Plan inventory based on demand
</Accordion>
