---
title: "POST /PurchaseOrders/from-import"
method: POST
path: "/PurchaseOrders/from-import"
tags: ["PurchaseOrders"]
---

# POST /PurchaseOrders/from-import

`POST /PurchaseOrders/from-import`

## Request body

- CreatePurchaseOrderFromImportDto — Request to create (or extend) a purchase order from a parsed vendor-invoice import. Lines are pre-resolved client-side to <see cref="!:InventoryItem" /> ids.
  - `vendorId` string
  - `existingPurchaseOrderId` string, nullable — When set, append lines to this existing PO instead of creating a new one. The PO must belong to string CreatePurchaseOrderFromImportDto.VendorId and be in a status that still accepts new lines (Draft / Sent / Backordered).
  - `externalOrderNumber` string, nullable
  - `orderDate` string, date-time, nullable
  - `markReceived` boolean — If true, the PO is sent + received in the same transaction so stock and inventory transactions land immediately. Lot # / expiration are left null and filled in later via the regular receive UI.
  - `notes` string, nullable
  - `lines` CreatePurchaseOrderFromImportLineDto[]
    - `inventoryItemId` string
    - `quantity` union
      - number, double
      - string, double
    - `unitCost` union
      - number, double
      - string, double

## Response `201`

Created

- PurchaseOrderDto
  - `id` string
  - `orderNumber` string
  - `vendorId` string
  - `vendor` VendorSummaryDto
    - `id` string
    - `name` string
    - `code` string, nullable
  - `status` string
  - `orderDate` string, date-time
  - `expectedDeliveryDate` string, date-time, nullable
  - `receivedDate` string, date-time, nullable
  - `subTotal` union
    - number, double
    - string, double
  - `taxAmount` union
    - number, double
    - string, double
  - `shippingAmount` union
    - number, double
    - string, double
  - `totalAmount` union
    - number, double
    - string, double
  - `externalOrderNumber` string, nullable
  - `trackingNumber` string, nullable
  - `notes` string, nullable
  - `createdBy` DEAUserSummaryDto
    - `id` string
    - `displayName` string
    - `firstName` string, nullable
    - `lastName` string, nullable
    - `email` string
  - `approvedBy` DEAUserSummaryDto
    - `id` string
    - `displayName` string
    - `firstName` string, nullable
    - `lastName` string, nullable
    - `email` string
  - `items` PurchaseOrderItemDto[]
    - `id` string
    - `purchaseOrderId` string
    - `inventoryItemId` string
    - `inventoryItem` InventoryItemSummaryDto
      - `id` string
      - `name` string
      - `sku` string, nullable
      - `category` string
      - `trackLots` boolean
      - `totalOnHand` union
        - integer
        - string, int32
      - `reorderPoint` union
        - integer
        - string, int32
    - `quantityOrdered` union
      - number, double
      - string, double
    - `quantityReceived` union
      - number, double
      - string, double
    - `quantityBackordered` union
      - number, double
      - string, double
    - `unitCost` union
      - number, double
      - string, double
    - `lineTotal` union
      - number, double
      - string, double
    - `lotNumber` string, nullable
    - `expirationDate` string, date-time, nullable
    - `containerId` string, nullable
  - `createdAt` string, date-time
  - `updatedAt` string, date-time

## Other responses

- `400` — Bad Request
- `404` — Not Found

---

[API](https://skmtc.net/clinicos/apis/pawthosx-business-api-v1.md) · [All operations](https://skmtc.net/clinicos/apis/pawthosx-business-api-v1/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/clinicos/pawthosx-business-api-v1/revisions/d8d7501dde48/schema)
