> ## 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 Orders

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

## Get all Orders

Returns paginated orders for the authenticated affiliate. Requires scope `orders:read`.

### HTTP Request

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

### Query Parameters

| Parameter         | Type           | Description                          |
| ----------------- | -------------- | ------------------------------------ |
| `page`            | integer        | Page number (default 1)              |
| `limit`           | integer        | Items per page (default 10, max 100) |
| `organizationId`  | string         | Filter by brand UUID                 |
| `organizationIds` | string         | Comma-separated brand UUIDs          |
| `mdasc`           | boolean/string | Filter by additional identifier      |
| `from`            | date           | Start date (use with `to`)           |
| `to`              | date           | End date (use with `from`)           |

### Response

```json theme={null}
{
  "data": [],
  "meta": {
    "total": 0,
    "page": 1,
    "limit": 10,
    "totalPages": 0
  }
}
```

### Example

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


## OpenAPI

````yaml GET /affiliate/orders
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/orders:
    get:
      description: Returns all orders from the system that the user has access to
      parameters:
        - name: limit
          in: query
          description: The maximum number of results to return
          schema:
            type: integer
            format: int32
        - name: page
          in: query
          description: The page number to return
          schema:
            type: integer
            format: int32
        - name: organizationId
          in: query
          description: The organization id to return orders from
          schema:
            type: string
        - name: organizationIds
          in: query
          description: The organization ids to return orders from
          schema:
            type: array
            items:
              type: string
        - name: mdasc
          in: query
          description: >-
            This parameter is used to filter orders by additional identifier.
            Return all orders has this identifier if set to true.
          schema:
            type: boolean
        - name: from
          in: query
          description: The start date of the period to return orders from
          schema:
            type: string
            format: date
        - name: to
          in: query
          description: The end date of the period to return orders from
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Order response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/AffiliateOrder'
                  meta:
                    $ref: '#/components/schemas/Meta'
          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: Unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
components:
  schemas:
    AffiliateOrder:
      required: []
      type: object
      properties:
        data:
          type: object
          properties:
            id:
              description: The id of the order in the affiliate network
              type: string
            orderId:
              description: The id of the order in the merchant's system
              type: string
            status:
              description: The status of the order
              type: string
              enum:
                - pending
                - approved
                - rejected
                - repproved
            value:
              description: The value of the order
              type: number
            createdAt:
              description: The date and time the order was created
              type: string
            commission:
              description: The commission of the order
              type: number
            commissionStatus:
              description: The commission status of the order
              type: string
              enum:
                - pending
                - approved
                - rejected
                - repproved
            'items  ':
              description: The items of the order
              type: array
              items:
                type: object
                properties:
                  id:
                    description: The id of the item
                    type: string
                  name:
                    description: The name of the item
                    type: string
                  quantity:
                    description: The quantity of the item
                    type: number
                  price:
                    description: The price of the item
                    type: number
                  categories:
                    description: The commission of the item
                    type: number
            organizationId:
              description: The id of the brand that the order belongs to
              type: string
            mdasc:
              description: >-
                This field returns the mdasc, which is a custom identifier used
                to track the order for your custom purposes
              type: string
        meta:
          $ref: '#/components/schemas/Meta'
    Meta:
      type: object
      properties:
        total:
          type: integer
        page:
          type: integer
        limit:
          type: integer
        totalPages:
          type: integer
    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
  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

````