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

# Get all Products

> Returns all products from the system that the user has access to

## Get all Products

Retrieve a comprehensive list of products available across all affiliate brands. This endpoint provides detailed product information including pricing, availability, images, and specifications.

### HTTP Request

```http theme={null}
GET https://api-beta.lomadee.com.br/affiliate/products
```

### Query Parameters

<ParamField query="page" type="integer">
  Page number for pagination. Starts at 1. **Default:** 1 **Example:** 2
</ParamField>

<ParamField query="limit" type="integer">
  Number of products per page. Minimum 1, maximum 100. Values outside this range return `400`. **Default:** 5 **Example:** 25
  **Example:** 25
</ParamField>

<ParamField query="isAvailable" type="boolean">
  Filter products by availability status. **Example:** true
</ParamField>

<ParamField query="search" type="string">
  Search term to filter products by name or description. **Example:**
  "smartphone"
</ParamField>

<ParamField query="price" type="string">
  Price range filter in cents. Format: `from:to` **Format:** `{minPrice}:   {maxPrice}` (in cents) **Example:** "7400:8000" (R$ 74,00 to R$ 80,00)
</ParamField>

<ParamField query="organizationIds" type="string">
  Filter products by specific brand organization IDs. Multiple IDs separated by
  commas. **Format:** UUID separated by commas **Example:**
  "e36f5bbb-3e5f-42e2-be4c-6c32dac101c2,12345678-1234-1234-1234-123456789012"
</ParamField>

### Example Requests

#### Basic Request

```bash theme={null}
curl -X GET "https://api-beta.lomadee.com.br/affiliate/products" \
  -H "x-api-key: your-api-key"
```

#### With Pagination

```bash theme={null}
curl -X GET "https://api-beta.lomadee.com.br/affiliate/products?page=1&limit=20" \
  -H "x-api-key: your-api-key"
```

#### With Search and Price Filter

```bash theme={null}
curl -X GET "https://api-beta.lomadee.com.br/affiliate/products?search=ar%20condicionado&price=5000:6000" \
  -H "x-api-key: your-api-key"
```

#### Filter by Specific Brands

```bash theme={null}
curl -X GET "https://api-beta.lomadee.com.br/affiliate/products?organizationIds=e36f5bbb-3e5f-42e2-be4c-6c32dac101c2" \
  -H "x-api-key: your-api-key"
```

### Response Format

<ResponseField name="data" type="array">
  Array of product objects
</ResponseField>

<ResponseField name="count" type="integer">
  Total number of products matching the filters. Use `page` and `limit` query
  parameters to paginate; the response does not echo current page metadata.
</ResponseField>

### Product Object Structure

<ResponseField name="organizationId" type="string">
  Brand organization UUID
</ResponseField>

<ResponseField name="id" type="string">
  Product identifier
</ResponseField>

<ResponseField name="available" type="boolean">
  Product availability status
</ResponseField>

<ResponseField name="createdAt" type="string">
  Product creation timestamp (ISO 8601)
</ResponseField>

<ResponseField name="updatedAt" type="string">
  Last update timestamp (ISO 8601)
</ResponseField>

<ResponseField name="name" type="string">
  Product name/title
</ResponseField>

<ResponseField name="description" type="string">
  Product description (HTML format)
</ResponseField>

<ResponseField name="url" type="string">
  Product page URL
</ResponseField>

<ResponseField name="images" type="array">
  Product images

  <Expandable title="properties">
    <ResponseField name="url" type="string">
      Image URL
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="options" type="array">
  Product variants/options

  <Expandable title="properties">
    <ResponseField name="id" type="string">
      Option identifier
    </ResponseField>

    <ResponseField name="ean" type="string">
      European Article Number
    </ResponseField>

    <ResponseField name="name" type="string">
      Option name
    </ResponseField>

    <ResponseField name="available" type="boolean">
      Option availability
    </ResponseField>

    <ResponseField name="seller" type="string">
      Seller identifier
    </ResponseField>

    <ResponseField name="images" type="array">
      Option-specific images
    </ResponseField>

    <ResponseField name="categories" type="array">
      Product categories
    </ResponseField>

    <ResponseField name="brands" type="array">
      Product brands
    </ResponseField>

    <ResponseField name="pricing" type="array">
      Pricing information

      <Expandable title="properties">
        <ResponseField name="listPrice" type="integer">
          Original price in cents
        </ResponseField>

        <ResponseField name="price" type="integer">
          Current price in cents
        </ResponseField>

        <ResponseField name="metadata" type="array">
          Additional pricing data
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="stocks" type="array">
      Stock information

      <Expandable title="properties">
        <ResponseField name="value" type="integer">
          Available quantity
        </ResponseField>

        <ResponseField name="metadata" type="array">
          Additional stock data
        </ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="metadata" type="array">
      Additional option data
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="metadata" type="array">
  Additional product data
</ResponseField>

### Example Response

```json theme={null}
{
  "data": [
    {
      "_id": "6851c116cd2fe4fb974f9351",
      "organizationId": "e36f5bbb-3e5f-42e2-be4c-6c32dac101c2",
      "id": "1027452",
      "available": true,
      "createdAt": "2025-06-17T19:25:06.152Z",
      "updatedAt": "2025-08-18T12:26:02.179Z",
      "name": "Ar Condicionado Split Hi Wall Philco Inverter 24000 BTU/h Frio Monofásico PAC24000IFM15 - 220 Volts",
      "description": "<h2>Ar Condicionado Split Hi Wall Philco Inverter...</h2>",
      "url": "https://www.friopecas.com.br/split-philco-hw-24k-220-1-f-in-1027452/p",
      "integration": "vtex",
      "images": [
        {
          "url": "https://friopecas.vteximg.com.br/arquivos/ids/241735/17.png.png?v=638663374020100000"
        }
      ],
      "options": [
        {
          "id": "1027452",
          "ean": "7899963913617",
          "name": "Ar Condicionado Split Hi Wall Philco Inverter 24000 BTU/h Frio Monofásico PAC24000IFM15 - 220 Volts",
          "available": true,
          "seller": "friopecas",
          "images": [
            {
              "url": "https://friopecas.vteximg.com.br/arquivos/ids/241735/17.png.png?v=638663374020100000"
            }
          ],
          "categories": [],
          "brands": [],
          "pricing": [
            {
              "listPrice": 5098,
              "price": 5098,
              "metadata": []
            }
          ],
          "stocks": [
            {
              "value": 99999,
              "metadata": []
            }
          ],
          "metadata": []
        }
      ],
      "metadata": []
    }
  ],
  "count": 1500
}
```

### Error Responses

#### 400 Bad Request

```json theme={null}
{
  "message": "Invalid price range format. Expected format: from:to",
  "error": "BadRequest",
  "statusCode": 400
}
```

#### 401 Unauthorized

```json theme={null}
{
  "message": "API key is required",
  "error": "Unauthorized",
  "statusCode": 401
}
```

#### 500 Internal Server Error

```json theme={null}
{
  "message": "Internal server error",
  "error": "InternalServerError",
  "statusCode": 500
}
```

### Usage Examples

#### JavaScript/Node.js

```javascript theme={null}
const axios = require("axios");

async function getProducts() {
  try {
    const response = await axios.get(
      "https://api-beta.lomadee.com.br/affiliate/products",
      {
        headers: {
          "x-api-key": "your-api-key",
        },
        params: {
          page: 1,
          limit: 20,
          search: "smartphone",
          price: "5000:10000",
        },
      }
    );

    console.log("Products:", response.data.data);
    console.log("Total count:", response.data.count);
  } catch (error) {
    console.error("Error:", error.response.data);
  }
}
```

#### Python

```python theme={null}
import requests

def get_products():
    url = 'https://api-beta.lomadee.com.br/affiliate/products'
    headers = {'x-api-key': 'your-api-key'}
    params = {
        'page': 1,
        'limit': 20,
        'search': 'smartphone',
        'price': '5000:10000'
    }

    response = requests.get(url, headers=headers, params=params)

    if response.status_code == 200:
        data = response.json()
        print('Products:', data['data'])
        print('Total count:', data['count'])
    else:
        print('Error:', response.json())
```

#### PHP

```php theme={null}
<?php
$url = 'https://api-beta.lomadee.com.br/affiliate/products';
$headers = ['x-api-key: your-api-key'];

$params = [
    'page' => 1,
    'limit' => 20,
    'search' => 'smartphone',
    'price' => '5000:10000'
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url . '?' . http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $data = json_decode($response, true);
    echo 'Products: ' . print_r($data['data'], true);
    echo 'Total count: ' . $data['count'];
} else {
    echo 'Error: ' . $response;
}
?>
```

### Best Practices

1. **Pagination**: Always implement pagination for large datasets
2. **Caching**: Cache product data when appropriate (TTL: 60 seconds)
3. **Search Optimization**: Use specific search terms for better results
4. **Price Filtering**: Use price ranges to narrow down products
5. **Error Handling**: Implement proper error handling for all responses
6. **Rate Limiting**: Respect the 60 requests per 60 seconds limit

### Common Use Cases

* **Product Catalog**: Display available products with filtering
* **Price Comparison**: Compare prices across different brands
* **Inventory Management**: Check product availability and stock levels
* **Search Integration**: Implement product search functionality
* **Recommendation Engine**: Build product recommendation systems


## OpenAPI

````yaml GET /affiliate/products
openapi: 3.1.0
info:
  title: Lomadee Public API
  description: >-
    REST API for affiliate brands, channels, campaigns, orders, products, and
    link shortener. Authenticate with x-api-key. Rate limit: 60 req/60s per key
    and IP.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.lomadee.com.br/
    description: Production — target URL for all integrations
  - url: https://api-beta.lomadee.com.br/
    description: Beta (legacy) — available during transition; will be retired soon
security:
  - x-api-key: []
paths:
  /affiliate/products:
    get:
      description: Returns all products from the system that the user has access to
      parameters:
        - name: page
          in: query
          description: Page number for pagination. Starts at 1.
          schema:
            type: integer
            format: int32
            default: 1
        - name: limit
          in: query
          description: 'Number of products per page. Maximum 100. Default: 5.'
          schema:
            type: integer
            format: int32
            default: 5
            maximum: 100
        - name: search
          in: query
          description: Search term to filter products by name or description.
          schema:
            type: string
        - name: price
          in: query
          description: 'Price range filter in cents. Format: from:to'
          schema:
            type: string
            pattern: ^[0-9]+:[0-9]+$
        - name: organizationIds
          in: query
          description: >-
            Filter products by specific brand organization IDs. Multiple IDs
            separated by commas.
          schema:
            type: string
        - name: isAvailable
          in: query
          description: Filter products by availability status
          schema:
            type: boolean
      responses:
        '200':
          description: Products response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Product'
                  count:
                    type: integer
                    description: Total number of products matching the filters
          headers:
            X-RateLimit-Limit:
              description: Max requests per window
              schema:
                type: integer
            X-RateLimit-Remaining:
              description: Remaining requests in window
              schema:
                type: integer
            X-RateLimit-Reset:
              description: Unix timestamp when window resets
              schema:
                type: integer
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    Product:
      type: object
      properties:
        organizationId:
          type: string
          description: Brand organization UUID
        id:
          type: string
          description: Product identifier
        available:
          type: boolean
          description: Product availability status
        createdAt:
          type: string
          format: date-time
          description: Product creation timestamp (ISO 8601)
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp (ISO 8601)
        name:
          type: string
          description: Product name/title
        description:
          type: string
          description: Product description (HTML format)
        url:
          type: string
          description: Product page URL
        images:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                description: Image URL
          description: Product images
        options:
          type: array
          items:
            $ref: '#/components/schemas/ProductOption'
          description: Product variants/options
        metadata:
          type: array
          description: Additional product data
    Error:
      required:
        - message
        - error
        - statusCode
      type: object
      properties:
        message:
          type: string
          description: Human-readable error message
        error:
          type: string
          description: Error type/category
        statusCode:
          type: integer
          format: int32
          description: HTTP status code
    ProductOption:
      type: object
      properties:
        id:
          type: string
          description: Option identifier
        ean:
          type: string
          description: European Article Number
        name:
          type: string
          description: Option name
        available:
          type: boolean
          description: Option availability
        seller:
          type: string
          description: Seller identifier
        images:
          type: array
          items:
            type: object
            properties:
              url:
                type: string
                description: Image URL
          description: Option-specific images
        categories:
          type: array
          description: Product categories
        brands:
          type: array
          description: Product brands
        pricing:
          type: array
          items:
            $ref: '#/components/schemas/ProductPricing'
          description: Pricing information
        stocks:
          type: array
          items:
            $ref: '#/components/schemas/ProductStock'
          description: Stock information
        metadata:
          type: array
          description: Additional option data
    ProductPricing:
      type: object
      properties:
        listPrice:
          type: integer
          description: Original price in cents
        price:
          type: integer
          description: Current price in cents
        metadata:
          type: array
          description: Additional pricing data
    ProductStock:
      type: object
      properties:
        value:
          type: integer
          description: Available quantity
        metadata:
          type: array
          description: Additional stock data
  responses:
    Unauthorized:
      description: API key missing or invalid
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
    Forbidden:
      description: Valid key without required scope
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
    TooManyRequests:
      description: Rate limit exceeded (60 req/60s per key + IP)
      headers:
        X-RateLimit-Limit:
          description: Max requests per window
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Remaining requests in window
          schema:
            type: integer
        X-RateLimit-Reset:
          description: Unix timestamp when window resets
          schema:
            type: integer
        Retry-After:
          description: Seconds until retry
          schema:
            type: integer
      content:
        application/json:
          schema:
            type: object
            properties:
              success:
                type: boolean
                example: false
              message:
                type: string
              code:
                type: string
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key

````