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

# Get items

> Retrieve items with optional filters and pagination.

## Endpoint

`GET /items`

Production URL:

`https://sam.aragon.morabaa.com/api/items`

## Authentication

This endpoint requires app authentication headers:

* `X-App-Id: <APP_ID>`
* `X-App-Secret: <APP_SECRET>`

### Required headers

<ParamField header="X-App-Id" type="string" required>
  App ID credential.
</ParamField>

<ParamField header="X-App-Secret" type="string" required>
  App secret credential.
</ParamField>

<Note>
  Need credentials? Contact [info@morabaa.com](mailto:info@morabaa.com).
</Note>

If either is invalid or missing, the response is `401 Unauthorized`.

Do not send `Content-Type: application/json` for this `GET` request. Only include a `Content-Type` header when the request has a JSON body.

## Request example

```bash theme={null}
curl -G "https://sam.aragon.morabaa.com/api/items" \
  -H "X-App-Id: <APP_ID>" \
  -H "X-App-Secret: <APP_SECRET>" \
  --data-urlencode "name=Paracetamol" \
  --data-urlencode "businessId=9c7f3b9d-0809-4f5e-b8f2-b6e46a4eb3af" \
  --data-urlencode "barcode=123456789" \
  --data-urlencode "groupId=00000000-0000-0000-0000-000000000000" \
  --data-urlencode "minBuyPrice=10" \
  --data-urlencode "maxBuyPrice=100" \
  --data-urlencode "minSellPrice=12" \
  --data-urlencode "maxSellPrice=120" \
  --data-urlencode "buyCurrencyId=1" \
  --data-urlencode "sellCurrencyId=1" \
  --data-urlencode "exchangeCurrency=true" \
  --data-urlencode "query=pain" \
  --data-urlencode "limit=25" \
  --data-urlencode "offset=0"
```

## Query parameters

All query parameters are optional.

<ParamField query="name" type="string">
  Filter by item name.
</ParamField>

<ParamField query="barcode" type="string">
  Filter by barcode.
</ParamField>

<ParamField query="businessId" type="guid">
  Filter by business ID. If omitted, the first business ID from the authenticated app is used.
</ParamField>

<ParamField query="groupId" type="guid">
  Filter by group ID.
</ParamField>

<ParamField query="minBuyPrice" type="decimal">
  Minimum buy price.
</ParamField>

<ParamField query="maxBuyPrice" type="decimal">
  Maximum buy price.
</ParamField>

<ParamField query="minSellPrice" type="decimal">
  Minimum sell price.
</ParamField>

<ParamField query="maxSellPrice" type="decimal">
  Maximum sell price.
</ParamField>

<ParamField query="buyCurrencyId" type="int">
  Buy currency ID.
</ParamField>

<ParamField query="sellCurrencyId" type="int">
  Sell currency ID.
</ParamField>

<ParamField query="exchangeCurrency" type="bool">
  Include exchange currency context when `true`.
</ParamField>

<ParamField query="query" type="string">
  General text search.
</ParamField>

<ParamField query="limit" type="int">
  Page size. Defaults to `25`, clamped to `1..100`.
</ParamField>

<ParamField query="offset" type="int">
  Skip count. Defaults to `0` and never below `0`.
</ParamField>

Notes:

* `businessId` must belong to the authenticated app if it is supplied.
* A successful response returns `200 OK`.

## Response

The response type is an array of items:

<ResponseField name="id" type="guid">
  Item ID.
</ResponseField>

<ResponseField name="businessId" type="guid">
  Business ID associated with the item.
</ResponseField>

<ResponseField name="name" type="string">
  Item name.
</ResponseField>

<ResponseField name="barcodes" type="array">
  Barcodes associated with the item.
</ResponseField>

<ResponseField name="buyPriceObject" type="object">
  Buy price and currency details.
</ResponseField>

<ResponseField name="sellPriceObject" type="object">
  Sell price and currency details.
</ResponseField>

<ResponseField name="quantity" type="decimal">
  Available quantity.
</ResponseField>

<ResponseField name="packages" type="array">
  Package options and package-level prices.
</ResponseField>

<ResponseField name="stores" type="object">
  Store details keyed by store identifier.
</ResponseField>

<ResponseField name="quantityDetails" type="array">
  Quantity movement details.
</ResponseField>

```json theme={null}
[
  {
    "id": "7f8f6d3b-2b93-4af3-9f65-7ea7d5ab79f1",
    "businessId": "9c7f3b9d-0809-4f5e-b8f2-b6e46a4eb3af",
    "name": "Paracetamol 500mg",
    "quantityWithFill": "100 box",
    "expiresAt": "2027-01-01T00:00:00+00:00",
    "images": {
      "cover": "https://cdn.example.com/item-cover.jpg"
    },
    "scientificName": "Acetaminophen",
    "batchNumber": "BATCH-001",
    "notes": "Store below 25C",
    "barcodes": ["123456789"],
    "buyPriceObject": {
      "price": 10,
      "currencyId": 1
    },
    "sellPriceObject": {
      "price": 12.5,
      "currencyId": 1
    },
    "quantity": 100,
    "packages": [
      {
        "itemId": "7f8f6d3b-2b93-4af3-9f65-7ea7d5ab79f1",
        "packageId": 1,
        "packageName": "Box",
        "price": 12.5,
        "buyPrice": 10,
        "isDefault": true,
        "packageIndex": 0,
        "packageQuantity": 1,
        "numberInParent": 1,
        "wholeSalePrice": 11,
        "privateSalePrice": 12
      }
    ],
    "privateSalePrice": 12,
    "wholeSalePrice": 11,
    "quantityPerStore": {
      "store-1": 60,
      "store-2": 40
    },
    "stores": {
      "store-1": {
        "id": "72a5508c-b9d6-4025-889b-20e6b8f8f2e9",
        "morabaaId": 101,
        "name": "Main Store"
      }
    },
    "quantityDetails": [
      {
        "id": "8c172f75-a1e5-4d6f-9e9f-3e58f2ad0e91",
        "morabaaId": 9001,
        "number": 100,
        "createdAt": "2026-02-18T10:30:00+00:00",
        "details": "Initial stock"
      }
    ]
  }
]
```


## OpenAPI

````yaml openapi.json GET /items
openapi: 3.1.0
info:
  title: MyMorabaa API
  version: 1.0.0
servers:
  - url: https://sam.aragon.morabaa.com/api
security: []
paths:
  /items:
    get:
      summary: Get items
      description: Retrieve items with optional filters and pagination.
      parameters:
        - $ref: '#/components/parameters/XAppId'
        - $ref: '#/components/parameters/XAppSecret'
        - name: name
          in: query
          schema:
            type: string
          description: Filter by item name.
        - name: barcode
          in: query
          schema:
            type: string
          description: Filter by barcode.
        - name: businessId
          in: query
          schema:
            type: string
            format: uuid
          description: >-
            Filter by business ID. If omitted, the first business ID from the
            authenticated app is used.
        - name: groupId
          in: query
          schema:
            type: string
            format: uuid
          description: Filter by group ID.
        - name: minBuyPrice
          in: query
          schema:
            type: number
            format: decimal
          description: Minimum buy price.
        - name: maxBuyPrice
          in: query
          schema:
            type: number
            format: decimal
          description: Maximum buy price.
        - name: minSellPrice
          in: query
          schema:
            type: number
            format: decimal
          description: Minimum sell price.
        - name: maxSellPrice
          in: query
          schema:
            type: number
            format: decimal
          description: Maximum sell price.
        - name: buyCurrencyId
          in: query
          schema:
            type: integer
          description: Buy currency ID.
        - name: sellCurrencyId
          in: query
          schema:
            type: integer
          description: Sell currency ID.
        - name: exchangeCurrency
          in: query
          schema:
            type: boolean
          description: Include exchange currency context when true.
        - name: query
          in: query
          schema:
            type: string
          description: General text search.
        - name: limit
          in: query
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 25
          description: Page size. Defaults to 25, clamped to 1..100.
        - name: offset
          in: query
          schema:
            type: integer
            minimum: 0
            default: 0
          description: Skip count. Defaults to 0 and never below 0.
      responses:
        '200':
          description: Items returned successfully.
        '401':
          description: Missing or invalid app authentication headers.
components:
  parameters:
    XAppId:
      name: X-App-Id
      in: header
      required: true
      schema:
        type: string
      description: App ID credential.
    XAppSecret:
      name: X-App-Secret
      in: header
      required: true
      schema:
        type: string
      description: App secret credential.

````