Edit purchase order
hub_update_purchase_orderRewrite an order that has not been sent yet. ONLY works while it is suggested or draft — a sent or received order is refused, because the supplier already has it. This REPLACES the whole order: the lines and charges you pass become the order, and anything you leave out is dropped. Read it with get_purchase_order first and send the full set back. This is also how a suggestion is ACCEPTED: editing a suggested order turns it into a draft and gives it its PO number. To accept one unchanged, pass its existing lines back verbatim.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | The complete new set of lines | |
| notes | No | ||
| discount | No | Flat discount on the whole order, e.g. "25.00". Not with discountPercent | |
| dutyFees | No | Duty / customs charged on the order | |
| outletId | Yes | Outlet id the goods will be received into | |
| customFees | No | Any other named charge on the order, e.g. "Handling" | |
| supplierId | Yes | Supplier id — normally the order’s current supplier | |
| shippingFee | No | Shipping charged on the order, e.g. "18.00" | |
| expectedDate | No | ||
| discountPercent | No | Discount as a percentage of the items subtotal | |
| purchaseOrderId | Yes | Purchase order id from get_purchase_orders — not a PO number |