# EditPurchaseOrderInput

input type

Edit-input for a PurchaseOrder. Every field optional, at least ONE required; supplied fields REPLACE, omitted fields are preserved (no clearing semantic yet). DRAFT-ONLY WHOLESALE: header fields + a FULL line replace while draft (no per-line patching); the orgVendorId and the currency snapshot are BIRTH-FIXED (re-vendor = cancel + new); a live post-draft doc refuses CONFLICT/REF_STATE naming the required draft state (amend = cancel / close_short + a NEW PO); a write in an immutable terminal (received / closed_short / cancelled) refuses CONFLICT/IMMUTABLE.

## Fields

| Field | Type | Required | Notes |
| --- | --- | --- | --- |
| `caption` | [String](/types/#scalars) | no | No further notes. |
| `paymentTerms` | [String](/types/#scalars) | no | No further notes. |
| `incotermCode` | [String](/types/#scalars) | no | No further notes. |
| `vendorReference` | [String](/types/#scalars) | no | No further notes. |
| `notes` | [String](/types/#scalars) | no | No further notes. |
| `lines` | [PurchaseOrderLineInput](/types/PurchaseOrderLineInput/) `[PurchaseOrderLineInput!]` | no | The wholesale line replacement (draft-only) — same shape, defaults and gates as create; the WHOLE set, up to 1000.: it PERSISTS as a DIFF by the natural (variantId x logicalFacilityId) key — an unchanged line costs no write, a kept line KEEPS its lineNo, a new key mints at nextLineNo, an absent key deletes (a line carrying orderLineRef refuses CONFLICT/REFERENCED); a delta past 90 line actions refuses VALIDATION/INVALID naming the budget and the three line ops. |

## Used by

- [updatePurchaseOrder](/reference/purchase-order/updatePurchaseOrder/)
