---
title: "Create Purchase Order"
method: POST
path: "/purchase-orders"
tags: ["purchase_order"]
---

# Create Purchase Order

`POST /purchase-orders`

## Request

- Base URL: `https://app.zenventory.com/rest`
- URL: `https://app.zenventory.com/rest/purchase-orders`
- Auth: none declared

Create a new purchase order.

## Request body

- object
  - `supplierId` integer, required: Id of the supplier that is being ordered from.
  - `supplierName` string, required: Name of the supplier that is being ordered from. Ignored if supplierId is provided.
  - `warehouseId` integer: Id of the warehouse the items will be delivered to. If no warehouse parameters are given, then the user's current warehouse will be used.
  - `warehouseName` string: Name of the warehouse the items will be delivered to. Ignored if warehouseId is provided.
  - `clientId` integer: Id of the client that the purchase order is for. Defaults to the user's client id.
  - `clientName` string: Name of the client that the purchase order is for. Ignored if clientId is provided and is nonzero.
  - `orderNumber` string: Order number for the purchase order. If blank, one will automatically be generated.
  - `draft` boolean: True if the purchase order should be created as a draft to allow future editing.
  - `requiredByDate` string, date
  - `projectNumber` string
  - `notes` string
  - `shipMethod` string
  - `terms` string
  - `userField1` string
  - `userField2` string
  - `userField3` string
  - `purchasedForClient` boolean: Can only be true if the purchase order is for a client.
  - `items` object[]: Items being ordered. Can be empty, but if so then will be created as a draft regardless of draft's value.
    - `itemId` integer, required: Id of the item master.
    - `sku` string, required: SKU of the item master. Ignored if itemId is provided.
    - `description` string, required: Description of the item. Defaults to the item master's description if not provided, but an error will be returned if the item master is also lacking a description.
    - `quantity` integer, required: How many are being ordered. Must be nonzero.
    - `uom` string: The unit of measurement being ordered. Uses the item master's default uom if blank.
    - `unitCost` number: Cost per unit. Defaults to the cost of the item in the supplier's catalog. If not in the catalog, then the item master's default item cost is used.
    - `createNew` boolean: If sku is provided, true to create a new item instead of returning an error if no item matches the sku.

## Response `201`

Success

- PurchaseOrder
  - `id` integer
  - `orderNumber` string
  - `supplier` SupplierCompact
    - `id` integer
    - `name` string
  - `warehouse` WarehouseCompact
    - `id` integer
    - `name` string
  - `client` ClientCompact
    - `id` integer
    - `name` string
  - `user` UserCompact
    - `id` integer
    - `name` string
  - `draft` boolean
  - `completed` boolean
  - `deleted` boolean
  - `createdDate` string, date-time
  - `preparedDate` string, date-time
  - `requiredByDate` string, date
  - `projectNumber` string
  - `notes` string
  - `shipMethod` string
  - `terms` string
  - `userField1` string
  - `userField2` string
  - `userField3` string
  - `items` PurchaseOrderItem[]
    - `id` integer
    - `itemId` integer
    - `sku` string
    - `description` string
    - `quantity` integer
    - `uom` string
    - `unitCost` number

---

[API](https://skmtc.dev/zenventory/apis/zenventory-rest-api.md) · [All operations](https://skmtc.dev/zenventory/apis/zenventory-rest-api/llms.txt) · [OpenAPI document](https://skmtc.dev/zenventory/apis/zenventory-rest-api/revisions/b40aa340773b?raw)
