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

# List purchase orders

> Returns a list of purchase orders for a clinic. The purchase orders are sorted by creation date, with the most recent appearing first.

A **purchase order** tracks an order placed by a clinic to a supplier for inventory items. Each purchase order contains one or more line items identifying the inventory being ordered, the quantity, and the price. Purchase orders are created in draft status and can later be finalized in the pims web ui.



## OpenAPI

````yaml get /ext/v2/purchase-orders/
openapi: 3.1.0
info:
  description: ''
  title: NinjaAPI
  version: 2.0.0
servers:
  - url: https://connect.vetcove.com/
security: []
paths:
  /ext/v2/purchase-orders/:
    get:
      tags:
        - Inventory
      summary: List purchase orders
      description: >-
        Returns a list of purchase orders for a clinic. The purchase orders are
        sorted by creation date, with the most recent appearing first.


        A **purchase order** tracks an order placed by a clinic to a supplier
        for inventory items. Each purchase order contains one or more line items
        identifying the inventory being ordered, the quantity, and the price.
        Purchase orders are created in draft status and can later be finalized
        in the pims web ui.
      operationId: purchase_order_list
      parameters:
        - description: When provided, filters to objects with these IDs.
          in: query
          name: ids
          required: false
          schema:
            anyOf:
              - items:
                  type: integer
                type: array
              - type: 'null'
            description: When provided, filters to objects with these IDs.
            title: Ids
        - description: >-
            A cursor used for pagination. Fetches the page of results ending
            immediately before the object with the given ID. Cannot be used at
            the same time as `starting_after`.
          in: query
          name: ending_before
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: >-
              A cursor used for pagination. Fetches the page of results ending
              immediately before the object with the given ID. Cannot be used at
              the same time as `starting_after`.
            title: Ending Before
        - description: >-
            A cursor used for pagination. Fetches the page of results starting
            immediately after the given ID. Cannot be used at the same time as
            `ending_before`.
          in: query
          name: starting_after
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: >-
              A cursor used for pagination. Fetches the page of results starting
              immediately after the given ID. Cannot be used at the same time as
              `ending_before`.
            title: Starting After
        - description: The maximum number of items to return per page.
          in: query
          name: limit
          required: false
          schema:
            default: 10
            description: The maximum number of items to return per page.
            maximum: 100
            minimum: 1
            title: Limit
            type: integer
        - description: The ID of the clinic to list purchase orders for
          in: query
          name: clinic_id
          required: true
          schema:
            description: The ID of the clinic to list purchase orders for
            title: Clinic Id
            type: integer
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExternalPurchaseOrderSchemaList'
          description: OK
      security:
        - ExternalAPIAuth: []
components:
  schemas:
    ExternalPurchaseOrderSchemaList:
      properties:
        data:
          description: A single page of data contained within this list.
          items:
            $ref: '#/components/schemas/ExternalPurchaseOrderSchema'
          title: Data
          type: array
        has_more:
          default: false
          description: Whether there are more pages or data in this list.
          title: Has More
          type: boolean
        next_page:
          description: A URL linking to the next page of this list.
          title: Next Page
          type: string
        type:
          default: list
          description: Type of this object. Always `list`.
          title: Type
          type: string
      required:
        - data
        - next_page
      title: ExternalPurchaseOrderSchemaList
      type: object
    ExternalPurchaseOrderSchema:
      properties:
        clinic_id:
          description: The ID of the clinic this purchase order belongs to
          title: Clinic Id
          type: integer
        created:
          description: The datetime this object was created.
          format: date-time
          title: Created
          type: string
        effective_total:
          description: The effective total of the order, in cents
          title: Effective Total
          type: integer
        id:
          description: The unique identifier for the purchase order
          title: Id
          type: integer
        modified:
          description: >-
            The datetime this object was last modified; changes to related
            entities will not update this field.
          format: date-time
          title: Modified
          type: string
        order_datetime:
          description: The datetime when the order was placed
          format: date-time
          title: Order Datetime
          type: string
        po_number:
          description: The purchase order number
          title: Po Number
          type: string
        purchase_order_items:
          description: The line items included in this purchase order
          items:
            $ref: '#/components/schemas/ExternalPurchaseOrderItemSchema'
          title: Purchase Order Items
          type: array
        raw_total:
          description: The raw total of the order, in cents
          title: Raw Total
          type: integer
        status:
          $ref: '#/components/schemas/PurchaseOrderStatus'
          description: The current status of the purchase order
        supplier:
          description: The name of the supplier for this order
          title: Supplier
          type: string
      required:
        - created
        - modified
        - id
        - clinic_id
        - order_datetime
        - po_number
        - supplier
        - status
        - raw_total
        - effective_total
        - purchase_order_items
      title: ExternalPurchaseOrderSchema
      type: object
    ExternalPurchaseOrderItemSchema:
      properties:
        created:
          description: The datetime this object was created.
          format: date-time
          title: Created
          type: string
        id:
          description: The unique identifier for the purchase order item
          title: Id
          type: integer
        inventory_id:
          anyOf:
            - type: integer
            - type: 'null'
          description: The inventory id for this item
          title: Inventory Id
        inventory_shortcode:
          default: ''
          description: The inventory shortcode (human-readable code) for this item
          title: Inventory Shortcode
          type: string
        modified:
          description: >-
            The datetime this object was last modified; changes to related
            entities will not update this field.
          format: date-time
          title: Modified
          type: string
        quantity:
          anyOf:
            - type: number
            - type: string
          description: The quantity ordered
          title: Quantity
        sku:
          description: The SKU identifier for this item
          title: Sku
          type: string
        total_price:
          description: The total price for this line item, in cents
          title: Total Price
          type: integer
        unit_of_measure:
          description: The unit of measure for this item
          title: Unit Of Measure
          type: string
      required:
        - created
        - modified
        - id
        - inventory_id
        - sku
        - quantity
        - total_price
        - unit_of_measure
      title: ExternalPurchaseOrderItemSchema
      type: object
    PurchaseOrderStatus:
      enum:
        - DRAFT
        - PENDING
        - PARTIALLY_RECEIVED
        - FULLY_RECEIVED
        - CANCELED
        - RETURNED
        - CLOSED
      title: PurchaseOrderStatus
      type: string
  securitySchemes:
    ExternalAPIAuth:
      scheme: bearer
      type: http

````