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

# Get Orders Analytics Table v2

> Fetches a list of orders with analytics data for a specific facility.



## OpenAPI

````yaml /openapi.json get /api/v2/orders/analytics/table/{facility_id}
openapi: 3.0.0
info:
  title: Authentication API
  description: API for user authentication and token generation
  version: 1.0.0
servers:
  - url: https://api.retailreadyai.com
    description: Production server
  - url: https://stg.retailreadyai.com
    description: Staging server
security: []
paths:
  /api/v2/orders/analytics/table/{facility_id}:
    get:
      tags:
        - Orders
      summary: Get Orders Analytics Table v2
      description: Fetches a list of orders with analytics data for a specific facility.
      parameters:
        - name: facility_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
          description: ID of the facility to fetch orders for
        - name: page
          in: query
          schema:
            type: integer
          description: >-
            If page or page_size are not provided, page will default to 1 and
            page_size will default to 10.
        - name: page_size
          in: query
          schema:
            type: integer
          description: >-
            Maximum page_size is 10. If page or page_size are not provided, page
            will default to 1 and page_size will default to 10.
        - name: order_id
          in: query
          schema:
            type: string
            description: Filter results by specific order ID
        - name: created_at_from
          in: query
          schema:
            type: string
            format: date
        - name: created_at_to
          in: query
          schema:
            type: string
            format: date
        - name: ship_window_from
          in: query
          schema:
            type: string
            format: date
        - name: ship_window_to
          in: query
          schema:
            type: string
            format: date
        - name: packed_at_from
          in: query
          schema:
            type: string
            format: date
        - name: packed_at_to
          in: query
          schema:
            type: string
            format: date
        - name: retailers
          in: query
          schema:
            type: string
        - name: brands
          in: query
          schema:
            type: string
        - name: asn
          in: query
          schema:
            type: string
        - name: picksheet_code
          in: query
          schema:
            type: string
        - name: po_number
          in: query
          schema:
            type: string
        - name: search
          in: query
          schema:
            type: string
      responses:
        '200':
          description: Successful retrieval of orders analytics table for facility.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Orders analytics table retrieved successfully
                  data:
                    type: array
                    items:
                      type: object
                      properties:
                        order_id:
                          type: string
                          format: uuid
                          example: 6f8d7e6a-5b4c-3d2e-1f0g-9h8i7j6k5l4m
                        total_cartons:
                          type: integer
                          example: 5
                        total_labels:
                          type: integer
                          example: 5
                        unique_labels:
                          type: integer
                          example: 5
                        order_number:
                          type: string
                          example: '83652219'
                        total_pallets:
                          type: integer
                          example: 2
                        unique_sku_count:
                          type: integer
                          example: 3
                        order_status:
                          type: string
                          example: Shipped
                        total_units:
                          type: integer
                          example: 250
                        total_vas_actions:
                          type: integer
                          example: 2
                        asn_sent_at:
                          type: string
                          format: date-time
                        brand:
                          type: string
                          example: EcoGear
                        retailer:
                          type: string
                          example: REI
                        line_items:
                          type: array
                          items:
                            type: object
                            properties:
                              ordered_quantity:
                                type: integer
                                example: 300
                              shipped_quantity:
                                type: integer
                                example: 300
                              sku:
                                type: string
                                example: fba-sku
                              upc:
                                type: string
                                example: fba-sku
              example:
                data:
                  - order_id: 6f8d7e6a-5b4c-3d2e-1f0g-9h8i7j6k5l4m
                    asn_sent_at: Mon, 15 Apr 2025 09:22:18 GMT
                    brand: EcoGear
                    line_items:
                      - ordered_quantity: 150
                        shipped_quantity: 150
                        sku: ecogear-001
                        upc: '012345678905'
                      - ordered_quantity: 100
                        shipped_quantity: 100
                        sku: ecogear-002
                        upc: '012345678912'
                    order_number: '83652219'
                    order_status: Shipped
                    retailer: REI
                    total_cartons: 5
                    total_labels: 5
                    total_pallets: 2
                    total_units: 250
                    total_vas_actions: 2
                    unique_labels: 5
                    unique_sku_count: 3
                  - order_id: 7g9h8i7j-6k5l-4m3n-2o1p-0q9r8s7t6u5v
                    asn_sent_at: Sun, 14 Apr 2025 14:55:32 GMT
                    brand: OutdoorPro
                    line_items:
                      - ordered_quantity: 480
                        shipped_quantity: 480
                        sku: outpro-tent-2p
                        upc: '088765432101'
                    order_number: '76291483'
                    order_status: Shipped
                    retailer: Bass Pro Shops
                    total_cartons: 8
                    total_labels: 10
                    total_pallets: 3
                    total_units: 480
                    total_vas_actions: 4
                    unique_labels: 10
                    unique_sku_count: 6
                  - order_id: 8h0i9j8k-7l6m-5n4o-3p2q-1r0s9t8u7v6w
                    asn_sent_at: Fri, 12 Apr 2025 08:17:45 GMT
                    brand: TrekTech
                    line_items:
                      - ordered_quantity: 720
                        shipped_quantity: 720
                        sku: trektech-pack-40l
                        upc: '099887766554'
                    order_number: '92748315'
                    order_status: Packed
                    retailer: Dick's Sporting Goods
                    total_cartons: 12
                    total_labels: 12
                    total_pallets: 4
                    total_units: 720
                    total_vas_actions: 0
                    unique_labels: 12
                    unique_sku_count: 4
                message: Orders analytics table retrieved successfully
        '400':
          description: Bad request - invalid facility ID or parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
              example:
                message: Invalid facility ID format
                error:
                  code: INVALID_REQUEST
        '401':
          description: Authentication failed
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
              example:
                message: Authentication failed
                error:
                  code: UNAUTHORIZED
        '404':
          description: Facility not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
              example:
                message: Facility not found
                error:
                  code: NOT_FOUND
        '500':
          description: Internal server error.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: object
                    properties:
                      code:
                        type: string
              example:
                message: Failed to retrieve orders analytics
                error:
                  code: INTERNAL_SERVER_ERROR
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````