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

# Get Shipments

> Get information about all Happy Returns shipments created within a given timeframe.
The response is a paginated list of shipments, with up to 200 shipments per page.

If no date range is provided, the response will return data from the last 24 hours.
### Required API key scope
- Happy Returns Shipments (Read)




## OpenAPI

````yaml get /happy-returns/shipments
openapi: 3.1.0
info:
  title: Happy Returns Shipment API
  version: v1
  description: API used for getting Happy Returns shipment and item details.
servers:
  - url: https://api.loopreturns.com/api/v1
security: []
tags:
  - name: Happy Returns Shipment
  - name: Happy Returns Shipment Items
paths:
  /happy-returns/shipments:
    get:
      tags:
        - Happy Returns Shipment
      summary: Get Shipments
      description: >
        Get information about all Happy Returns shipments created within a given
        timeframe.

        The response is a paginated list of shipments, with up to 200 shipments
        per page.


        If no date range is provided, the response will return data from the
        last 24 hours.

        ### Required API key scope

        - Happy Returns Shipments (Read)
      operationId: getShipments
      parameters:
        - name: from
          example: '2024-01-01T00:00:00.000Z'
          in: query
          description: >-
            The start date and time for the shipment list, using the ISO 8601
            date format.
          schema:
            type: string
            format: date-time
            examples:
              - '2024-01-01T00:00:00.000Z'
        - name: to
          example: '2024-03-31T23:59:59.000Z'
          in: query
          description: >-
            The end date and time for the shipment list, using the ISO 8601 date
            format.
          schema:
            type: string
            format: date-time
            examples:
              - '2024-03-31T23:59:59.000Z'
        - name: page
          in: query
          description: The page number of paginated results to return.
          schema:
            type: integer
            minimum: 1
            examples:
              - 1
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                properties:
                  current_page:
                    type: integer
                    examples:
                      - 1
                    description: The identifier associated with the current page.
                  data:
                    type: array
                    description: The data for each entry in the shipment list.
                    items:
                      $ref: '#/components/schemas/Shipment'
                  first_page_url:
                    type: string
                    examples:
                      - >-
                        https://api.loopreturns.com/api/v1/happy-returns/shipments/list?from=2022-01-01&to=2023-03-01&page=1
                    description: The link to the first page of paginated results.
                  from:
                    type: integer
                    examples:
                      - 1
                    description: The number of the first shipment on the page.
                  last_page:
                    type: integer
                    examples:
                      - 1
                    description: The identifier associated with the last page.
                  last_page_url:
                    type: string
                    examples:
                      - >-
                        https://api.loopreturns.com/api/v1/happy-returns/shipments/list?from=2022-01-01&to=2023-03-01&page=1
                    description: The link to the last page of paginated results.
                  next_page_url:
                    type: string
                    description: The link to the next page of paginated results.
                  path:
                    type: string
                    examples:
                      - >-
                        https://api.loopreturns.com/api/v1/happy-returns/shipments/list
                    description: The endpoint's path.
                  per_page:
                    type: integer
                    examples:
                      - 200
                    description: The number of shipments per page.
                  prev_page_url:
                    type: string
                    description: The link to the previous page of paginated results.
                  to:
                    type: integer
                    examples:
                      - 1
                    description: The number of the last shipment on the page.
                  total:
                    type: integer
                    examples:
                      - 1
                    description: The total number of shipments returned.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableContent'
      security:
        - api_key: []
components:
  schemas:
    Shipment:
      type: object
      properties:
        loop_shipment_id:
          type: integer
          examples:
            - 12345
          description: >-
            The unique identifier associated with the shipment, assigned by
            Loop.
        happy_returns_shipment_id:
          type: string
          examples:
            - '123456'
          description: >-
            The unique identifier associated with the shipment, assigned by
            Happy Returns.
        line_item_count:
          type: integer
          examples:
            - 2
          description: The number of line items included in the shipment.
        return_count:
          type: integer
          examples:
            - 1
          description: The number of Loop returns represented in the shipment.
        created_at:
          type: string
          format: date-time
          examples:
            - '2024-03-19T12:34:56+00:00'
          description: >-
            The date and time at which the shipment was created, using the ISO
            8601 date format.
        updated_at:
          type: string
          format: date-time
          examples:
            - '2024-03-20T12:34:56+00:00'
          description: >-
            The date and time at which the shipment was last updated, using the
            ISO 8601 date format.
    UnauthorizedResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              examples:
                - '401'
            http_code:
              type: string
              examples:
                - GEN-UNAUTHORIZED
            message:
              type: string
              examples:
                - Unauthorized.
    NotFoundResponse:
      type: object
      properties:
        message:
          type: string
          examples:
            - Not Found
    UnprocessableResponse:
      type: object
      properties:
        message:
          type: string
          examples:
            - The from field must be a valid ATOM date.
        errors:
          type: object
          examples:
            - from:
                - The from field must be a valid ATOM date.
  responses:
    Unauthorized:
      description: Unauthorized
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnauthorizedResponse'
    NotFound:
      description: Not Found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/NotFoundResponse'
    UnprocessableContent:
      description: Unprocessable Content
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/UnprocessableResponse'
  securitySchemes:
    api_key:
      type: apiKey
      name: X-Authorization
      in: header

````