---
title: "Create a purchase order"
method: POST
path: "/ext/v2/purchase-orders/"
tags: ["Inventory"]
---

# Create a purchase order

`POST /ext/v2/purchase-orders/`

## Request

- Base URL: `https://connect.vetcove.com`
- URL: `https://connect.vetcove.com/ext/v2/purchase-orders/`
- Auth: HTTP bearer

This endpoint is available to Group API Keys only.

Creates a new purchase order in draft status with the specified line items. The quantities specified in the line items are expected to be in the same unit of measure as the configured unit of measure for the inventory code.

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.

## Request body

- PurchaseOrderCreateSchema
  - `clinic_id` integer, required: The ID of the clinic this purchase order belongs to
  - `order_datetime` string, date-time, required: The datetime when the order was placed
  - `po_number` string, nullable: An optional purchase order number. If omitted, one is auto-generated.
  - `purchase_order_items` PurchaseOrderItemCreateSchema[], required: The line items to include in the purchase order
    - `inventory_id` integer, nullable: The inventory id identifying the item to order. Must provide exactly one of inventory_shortcode or inventory_id, not both
    - `inventory_shortcode` string, nullable: The inventory shortcode (human-readable code) identifying the item to order. Must provide exactly one of inventory_shortcode or inventory_id, not both. Inventory shortcodes are deprecated for new integrations; supported during a deprecation window for existing callers.
    - `quantity` union, required: The quantity to order (must be greater than 0)
      - number
      - string
    - `sku` string: An optional SKU identifier for this item
    - `total_price` integer: The total price for this line item, in cents
  - `supplier` string, required: The name of the supplier for this order

## Response `201`

Created

- ExternalPurchaseOrderSchema
  - `clinic_id` integer, required: The ID of the clinic this purchase order belongs to
  - `created` string, date-time, required: The datetime this object was created.
  - `effective_total` integer, required: The effective total of the order, in cents
  - `id` integer, required: The unique identifier for the purchase order
  - `modified` string, date-time, required: The datetime this object was last modified; changes to related entities will not update this field.
  - `order_datetime` string, date-time, required: The datetime when the order was placed
  - `po_number` string, required: The purchase order number
  - `purchase_order_items` ExternalPurchaseOrderItemSchema[], required: The line items included in this purchase order
    - `created` string, date-time, required: The datetime this object was created.
    - `id` integer, required: The unique identifier for the purchase order item
    - `inventory_id` integer, nullable, required: The inventory id for this item
    - `inventory_shortcode` string: The inventory shortcode (human-readable code) for this item
    - `modified` string, date-time, required: The datetime this object was last modified; changes to related entities will not update this field.
    - `quantity` union, required: The quantity ordered
      - number
      - string
    - `sku` string, required: The SKU identifier for this item
    - `total_price` integer, required: The total price for this line item, in cents
    - `unit_of_measure` string, required: The unit of measure for this item
  - `raw_total` integer, required: The raw total of the order, in cents
  - `status` 'DRAFT' | 'PENDING' | 'PARTIALLY_RECEIVED' | 'FULLY_RECEIVED' | 'CANCELED' | 'RETURNED' | 'CLOSED', required
  - `supplier` string, required: The name of the supplier for this order

---

[API](https://skmtc.dev/vetcove/apis/ninjaapi.md) - [All operations](https://skmtc.dev/vetcove/apis/ninjaapi/llms.txt) - [OpenAPI document](https://skmtc.dev/vetcove/apis/ninjaapi/revisions/4ceaed956e15?raw)
