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

# Listar pedidos

> Returns orders for the authenticated organization, newest first. Cursor-paginated.



## OpenAPI

````yaml /api-reference/openapi.json get /v1/orders
openapi: 3.1.0
info:
  title: Caudal Public API
  version: 1.0.0
  description: >-
    REST API for HORECA distributors to integrate their ERP with Caudal.
    Authenticate with an API key issued from the Caudal dashboard
    (WorkOS-backed). Pass it as 'Authorization: Bearer <key>'. Base URL:
    https://api.caudalflow.com
servers:
  - url: https://api.caudalflow.com
security:
  - bearerAuth: []
tags:
  - name: Pedidos
    description: Leer y crear pedidos.
  - name: Cuentas
    description: Leer y crear las cuentas de los clientes.
  - name: Productos
    description: Leer el catálogo.
paths:
  /v1/orders:
    get:
      tags:
        - Pedidos
      summary: Listar pedidos
      description: >-
        Returns orders for the authenticated organization, newest first.
        Cursor-paginated.
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - name: status
          in: query
          required: false
          schema:
            type: string
            enum:
              - reviewed
              - confirmed
              - delivered
              - cancelled
      responses:
        '200':
          description: One page of results.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Order'
                  meta:
                    $ref: '#/components/schemas/PageMeta'
        '400':
          $ref: '#/components/responses/Error'
          description: The request is malformed (code invalid_request).
        '401':
          $ref: '#/components/responses/Error'
          description: The API key is missing, invalid or not linked to an organization.
        '403':
          $ref: '#/components/responses/Error'
          description: The API key lacks the scope this route requires.
        '429':
          $ref: '#/components/responses/Error'
          description: >-
            The organization exceeded its rate limit. Retry after the delay in
            Retry-After.
      security:
        - bearerAuth:
            - orders:read
components:
  parameters:
    Limit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    Cursor:
      name: cursor
      in: query
      required: false
      schema:
        type: string
      description: Opaque cursor from a previous response's meta.next_cursor.
  schemas:
    Order:
      type: object
      properties:
        id:
          type: string
        status:
          type: string
          enum:
            - pending
            - reviewed
            - confirmed
            - delivered
            - cancelled
        channel:
          type: string
          enum:
            - voice
            - whatsapp
            - api
            - manual
        account:
          anyOf:
            - type: object
              properties:
                id:
                  type: string
                name:
                  type: string
              required:
                - id
                - name
            - type: 'null'
        items:
          type: array
          items:
            $ref: '#/components/schemas/OrderItem'
        notes:
          anyOf:
            - type: string
            - type: 'null'
        delivery_address:
          anyOf:
            - $ref: '#/components/schemas/DeliveryAddress'
            - type: 'null'
        captured_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        reviewed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
        confirmed_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
      required:
        - id
        - status
        - channel
        - account
        - items
        - notes
        - delivery_address
        - captured_at
        - reviewed_at
        - confirmed_at
    PageMeta:
      type: object
      properties:
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
        has_more:
          type: boolean
      required:
        - next_cursor
        - has_more
    OrderItem:
      type: object
      properties:
        product_id:
          anyOf:
            - type: string
            - type: 'null'
        product_name:
          type: string
        quantity:
          type: number
        unit:
          anyOf:
            - type: string
            - type: 'null'
        notes:
          anyOf:
            - type: string
            - type: 'null'
        unit_raw:
          anyOf:
            - type: string
            - type: 'null'
        product_unit:
          anyOf:
            - type: string
            - type: 'null'
        base_unit_qty_micro_at_capture:
          anyOf:
            - type: number
            - type: 'null'
        notes_source:
          anyOf:
            - type: string
              enum:
                - customer
                - previous_order
                - reviewer
            - type: 'null'
        sku:
          anyOf:
            - type: string
            - type: 'null'
        unit_price:
          anyOf:
            - type: number
            - type: 'null'
        price_source:
          anyOf:
            - type: string
              enum:
                - explicit
                - account
                - catalog
            - type: 'null'
        resolution:
          anyOf:
            - type: string
              enum:
                - product
                - discarded
            - type: 'null'
        discard_reason:
          anyOf:
            - type: string
            - type: 'null'
      required:
        - product_id
        - product_name
        - quantity
        - unit
        - notes
        - unit_raw
        - product_unit
        - base_unit_qty_micro_at_capture
        - notes_source
        - sku
        - unit_price
        - price_source
        - resolution
        - discard_reason
    DeliveryAddress:
      type: object
      properties:
        label:
          anyOf:
            - type: string
            - type: 'null'
        address:
          type: string
      required:
        - label
        - address
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - missing_api_key
                - invalid_api_key
                - insufficient_scope
                - rate_limited
                - not_found
                - invalid_request
                - idempotency_key_conflict
                - internal_error
                - erased_customer
                - order_items_unresolved
            message:
              type: string
          required:
            - code
            - message
      required:
        - error
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key issued from the Caudal dashboard. Scopes are enforced per route:
        orders:read, orders:write, accounts:read, accounts:write, products:read.

````