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

# Get return inventory by line item ID

Fetches return inventory record(s) tied to a specific return-request line item ID. Use this when you have the line-item reference from a return request and need the inventory state.

## Inventory photos

The response includes a `returnRequestLineItemImages[]` array of photos attached to the line item. **The endpoint returns S3 keys, not URLs** — to display or fetch a photo, build a URL by concatenating the environment-specific hostname with the key.

### Entry shape

Each entry exposes four resized variants of the same photo, so you can pick the right one for your UI:

| Field               | Typical use                                                      |
| ------------------- | ---------------------------------------------------------------- |
| `s3SmallFileKey`    | Thumbnails in list views                                         |
| `s3MediumFileKey`   | Preview in detail views                                          |
| `s3LargeFileKey`    | Full-screen preview                                              |
| `s3OriginalFileKey` | Original upload (largest; only when you need the unscaled image) |

### URL construction

Hostname per environment:

| Environment   | Photo hostname                   |
| ------------- | -------------------------------- |
| Sandbox (UAT) | `rr-dev-files.returnshelper.com` |
| Production    | `file.returnhelpercentre.com`    |

Formula:

```
URL = "https://" + <photo hostname> + "/" + <key>
```

Production example:

```
s3MediumFileKey = "img/returns/202606/27_1000040536_lmpiohbx.5n3_medium.jpg"
                  ↓ concatenate
URL             = "https://file.returnhelpercentre.com/img/returns/202606/27_1000040536_lmpiohbx.5n3_medium.jpg"
```

The key already contains the full S3 path. Constructed URLs are publicly fetchable, require no authentication header, and do not expire. URLs and content are safe to cache client-side.

<Warning>
  **Treat the path as opaque.** Return Helper has historically used multiple path prefixes (e.g. `img/returns/...` and `images/returns/...`); only the **hostname** is guaranteed stable. Never parse, validate, or pattern-match the path or filename.
</Warning>

Empty state: `returnRequestLineItemImages: null` for this endpoint (compared to `[]` on [Get Return Inventory](/api-reference/returninventory/get-return-inventory-details)). Treat both as "no photos".

<Note>
  This endpoint reflects the current state at query time. For real-time notifications when warehouse staff add, replace, or remove photos, subscribe to the [`changeLineItemImage`](/webhooks#image-updated) webhook rather than polling.
</Note>

## Related

* [Get Return Inventory](/api-reference/returninventory/get-return-inventory-details) — same response shape, queryable by inventory ID.
* [Image Updated webhook](/webhooks#image-updated) — real-time photo change notifications.
* [VAS Updated webhook](/webhooks#vas-update) — real-time VAS result photo notifications.


## OpenAPI

````yaml get /api/ReturnInventory/GetReturnInventoryByLineItemId
openapi: 3.1.0
info:
  title: Return Helper API
  description: API documentation for Return Helper — covering User and Public endpoints.
  version: 1.0.0
servers:
  - url: https://api.returnshelper.com/uat/user
    description: Sandbox — User API
  - url: https://api.returnshelper.com/uat/public
    description: Sandbox — Public API
  - url: https://api.returnhelpercentre.com/v1/user
    description: Production — User API
  - url: https://api.returnhelpercentre.com/v1/public
    description: Production — Public API
  - url: https://api.returnhelperchina.com/user
    description: Production — User API (China)
security:
  - ApiKey: []
    ApiToken: []
paths:
  /api/ReturnInventory/GetReturnInventoryByLineItemId:
    get:
      tags:
        - ReturnInventory
      summary: Get return inventory by line item ID
      operationId: ReturnUserApi_GetReturnInventoryByLineItemId
      parameters:
        - name: lineItemId
          in: query
          required: false
          schema:
            type: integer
            format: int64
          description: Return request line item identifier
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserReturnInventoryResponse'
        '401':
          description: >-
            Authentication failed. Returned when the `x-rr-apikey` or
            `x-rr-apitoken` header is missing or invalid. The body uses the
            standard `ApiResponse` envelope with `meta.error.message` describing
            the auth failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiResponse'
      security:
        - ApiKey: []
          ApiToken: []
      servers:
        - url: https://api.returnshelper.com/uat/user
          description: Sandbox — User API
components:
  schemas:
    UserReturnInventoryResponse:
      type: object
      properties:
        returnInventoryId:
          type: integer
          format: int64
          description: Return inventory identifier
    ApiResponse:
      type: object
      description: >-
        Universal response envelope. Successful responses include the business
        payload as additional top-level fields alongside `correlationId` and
        `meta`. Failed responses (auth errors, validation errors) only populate
        `correlationId` and `meta`, with `meta.errorCode` and `meta.error`
        describing the failure.
      properties:
        correlationId:
          type:
            - string
            - 'null'
          description: >-
            Unique correlation ID for tracing the request through Return Helper
            systems.
        meta:
          $ref: '#/components/schemas/ApiResponseMeta'
    ApiResponseMeta:
      type: object
      description: >-
        Application-level metadata for every API response. Inspect `status` and
        `errorCode` to detect soft-error responses (validation failures arrive
        as HTTP 200 with `meta.status: 400`).
      properties:
        status:
          type: integer
          description: >-
            Application-level status code. For successful operations this
            mirrors the HTTP status (e.g. 200). For validation failures it
            reports the logical status (e.g. 400) even though the wire HTTP
            status is 200.
        data:
          type: object
          additionalProperties:
            type: string
          description: Reserved free-form metadata key/value pairs. Usually empty.
        errorCode:
          type:
            - string
            - 'null'
          description: >-
            Machine-readable error code (e.g. `VALIDATION_FAILED`). Non-null
            only when the operation failed.
        error:
          type: object
          additionalProperties: true
          description: >-
            Field-level or message-level error detail keyed by request property
            name. Empty object on success.
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: x-rr-apikey
      description: Your API key
    ApiToken:
      type: apiKey
      in: header
      name: x-rr-apitoken
      description: Your API token — keep this private

````