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

# List purchase orders

> Returns a paginated list of purchase orders



## OpenAPI

````yaml /openapi-public.json get /v1/purchase-orders
openapi: 3.0.1
info:
  title: Light API
  version: 1.0.0
servers: []
security:
  - apiKeyAuth: []
  - bearerAuth: []
paths:
  /v1/purchase-orders:
    get:
      tags:
        - v1 - Purchase Orders
      summary: List purchase orders
      description: Returns a paginated list of purchase orders
      operationId: listPurchaseOrders
      parameters:
        - name: sort
          in: query
          schema:
            type: string
            description: >-
              Sort string in the format `field:direction`. To provide multiple
              sort fields, separate them with commas.


              Available directions: `asc`, `desc`. 


              Available fields: `purchaseOrderId`, `erpNumber`, `vendorName`,
              `ownerName`, `ownerId`, `companyEntityId`, `state`, `closedAt`,
              `cancelledAt`, `createdAt`, `totalAmount`.
            example: amount:desc,createdAt:asc
        - name: filter
          in: query
          schema:
            type: string
            description: >-
              Filter string in the format `field:operator:value`. To provide
              multiple filters, separate them with commas.


              Available operators: `eq`, `ne`, `in`, `not_in`, `gt`, `gte`,
              `lt`, `lte`.
               - For `in` and `not_in` operators, provide multiple values separated by the pipe character (`|`). 

              Available fields: `purchaseOrderId`, `vendorId`, `ownerId`,
              `state`, `erpNumber`, `updatedAt`.
            example: state:in:IN_DRAFT|SCHEDULED|PAID,amount:gte:500,vendorId:ne:null
        - name: limit
          in: query
          description: Maximum number of items to return. Default is 50, maximum is 200.
          schema:
            maximum: 200
            type: integer
            format: int32
        - name: offset
          in: query
          description: >-
            Number of items to skip before starting to collect the result set.
            Deprecated, use 'cursor' instead.
          deprecated: true
          schema:
            type: integer
            format: int64
        - name: cursor
          in: query
          description: >-
            The cursor position to start returning results from.

            To opt-in into cursor-based pagination, provide `0` for the initial
            request.

            For subsequent requests, use `nextCursor` and `prevCursor` from the
            previous response to navigate.

            Cursor values are opaque and should not be constructed manually.
          schema:
            type: string
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: >-
                  #/components/schemas/ExternalPaginatedResponseV1ModelExternalBffPurchaseOrderV1Model
components:
  schemas:
    ExternalPaginatedResponseV1ModelExternalBffPurchaseOrderV1Model:
      type: object
      properties:
        records:
          type: array
          description: List of records for the current page
          items:
            $ref: '#/components/schemas/ExternalBffPurchaseOrderV1Model'
        hasMore:
          type: boolean
          description: Boolean flag indicating if there are more records available
        total:
          type: integer
          description: >-
            Total number of records (only for offset pagination). This field is
            not guaranteed to be returned and only available for offset
            pagination, please do not rely on it and migrate to cursor
            pagination.
          format: int64
          nullable: true
          deprecated: true
        nextCursor:
          type: string
          description: Cursor for fetching the next page (only for cursor pagination)
          nullable: true
        prevCursor:
          type: string
          description: Cursor for fetching the previous page (only for cursor pagination)
          nullable: true
    ExternalBffPurchaseOrderV1Model:
      type: object
      properties:
        id:
          type: string
          format: uuid
        companyId:
          type: string
          format: uuid
        createdBy:
          type: string
          format: uuid
          nullable: true
        companyEntityId:
          type: string
          format: uuid
          nullable: true
        purchaseRequestId:
          type: string
          format: uuid
          nullable: true
        state:
          type: string
          description: >-
            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          enum:
            - IN_DRAFT
            - RESET_PENDING
            - APPROVED_ACCOUNTING_ENTRY_PENDING
            - OPEN
            - CLOSE_PENDING
            - CLOSED
            - CANCEL_PENDING
            - CANCELLED
        erpNumber:
          type: string
          nullable: true
        description:
          type: string
          nullable: true
        currency:
          type: string
          nullable: true
          example: USD
        totalAmount:
          type: integer
          format: int64
        totalNetAmount:
          type: integer
          format: int64
        totalTaxAmount:
          type: integer
          format: int64
        totalMatchedAmount:
          type: integer
          format: int64
        ownerId:
          type: string
          format: uuid
          nullable: true
        ownerName:
          type: string
          nullable: true
        vendorId:
          type: string
          format: uuid
          nullable: true
        vendorEmail:
          type: string
          nullable: true
        vendorName:
          type: string
          nullable: true
        vendorAvatarUrl:
          type: string
          nullable: true
        documentKey:
          type: string
          nullable: true
        failureContext:
          $ref: '#/components/schemas/ExternalUiClientExceptionV1Model'
        purchaseOrderDate:
          type: string
          format: date
          nullable: true
        deliveryAddress:
          type: string
          nullable: true
        deliveryDate:
          type: string
          format: date
          nullable: true
        erpSyncedAt:
          type: string
          format: date-time
          nullable: true
        lockedAt:
          type: string
          format: date-time
          nullable: true
        closedAt:
          type: string
          format: date-time
          nullable: true
        cancelledAt:
          type: string
          format: date-time
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        lines:
          type: array
          items:
            $ref: '#/components/schemas/ExternalBffPurchaseOrderLineV1Model'
      description: List of records for the current page
    ExternalUiClientExceptionV1Model:
      type: object
      properties:
        name:
          type: string
          description: The error name
        type:
          type: string
          description: >-
            The error type


            ⚠️ This enum is not exhaustive; new values may be added in the
            future.
          nullable: false
          deprecated: false
          enum:
            - BAD_REQUEST
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - CONFLICT
            - UNPROCESSABLE_CONTENT
        errors:
          type: array
          description: List of errors providing details about what went wrong
          items:
            $ref: '#/components/schemas/ExternalUiClientExceptionErrorV1Model'
      description: Failure context when vendor onboarding fails.
      nullable: true
    ExternalBffPurchaseOrderLineV1Model:
      type: object
      properties:
        id:
          type: string
          format: uuid
        companyId:
          type: string
          format: uuid
        purchaseOrderId:
          type: string
          format: uuid
        description:
          type: string
          nullable: true
        quantity:
          type: integer
          format: int64
          nullable: true
        unitPrice:
          type: integer
          format: int64
          nullable: true
        accountId:
          type: string
          format: uuid
          nullable: true
        accountLabel:
          type: string
          nullable: true
        taxCodeId:
          type: string
          format: uuid
          nullable: true
        amount:
          type: integer
          format: int64
          nullable: true
        taxAmount:
          type: integer
          format: int64
          nullable: true
        netAmount:
          type: integer
          format: int64
          nullable: true
        taxCodeLabel:
          type: string
          nullable: true
        costCenterId:
          type: string
          format: uuid
          nullable: true
        costCenterName:
          type: string
          nullable: true
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    ExternalUiClientExceptionErrorV1Model:
      type: object
      properties:
        type:
          type: string
          description: A string code identifying the error type
        message:
          type: string
          description: A human-readable message providing more details about the error
        path:
          type: array
          description: >-
            Optional path of the error when the error is for a specific field.
            Used mostly on BAD_REQUEST errors, that path will match the field
            name on the request object
          nullable: true
          items:
            type: string
            description: >-
              Optional path of the error when the error is for a specific field.
              Used mostly on BAD_REQUEST errors, that path will match the field
              name on the request object
            nullable: true
        context:
          type: object
          additionalProperties:
            type: object
            description: >-
              Optional context providing additional information about the error.
              This can include any relevant data that might help in
              understanding or resolving the error
            nullable: true
          description: >-
            Optional context providing additional information about the error.
            This can include any relevant data that might help in understanding
            or resolving the error
          nullable: true
      description: List of errors providing details about what went wrong
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      description: >-
        Basic authentication header of the form **Basic** **<api_key>**, where
        **<api_key>** is your api key.
      name: Authorization
      in: header
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````