Receive a delivery
hub_receive_purchase_orderBook a delivery in against an order that was sent: ADDS THE RECEIVED QUANTITIES TO REAL STOCK at the order’s outlet and updates the item cost book. This is not a note — it changes inventory. CONFIRM THE QUANTITIES WITH THE MERCHANT FIRST, item by item, and record what genuinely ARRIVED, not what was ordered — they differ, which is the whole point of receiving. Only sent and partially_received orders can be received; each item must be one that was ordered; receiving more than ordered is allowed. A short delivery leaves the order partially_received — receive again when the rest turns up. A CALL THAT RETURNS IS NOT PROOF EVERY ITEM LANDED — check partialFailure, and stockApplied.complete on a large delivery. IF IT FAILS, DO NOT RETRY BLINDLY: "still being received" means a previous delivery is being applied right now (get_receive_progress), and a wrong-status error means it was already fully received. Call get_purchase_order to see what actually landed before deciding anything. unitCost is what this delivery actually cost per unit — pass the invoice price if it differs from the order. When it does differ, the supplier’s stored cost is NOT updated unless you list that item in updateSupplierCostVariantIds, so ask the merchant whether the new price is the going rate or a one-off.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | Yes | What actually arrived | |
| discount | No | Flat discount on the whole order, e.g. "25.00". Not with discountPercent | |
| dutyFees | No | Duty / customs charged on the order | |
| customFees | No | Any other named charge on the order, e.g. "Handling" | |
| receivedAt | No | ISO date the goods arrived — defaults to now | |
| invoiceDate | No | ISO date on the invoice | |
| shippingFee | No | Shipping charged on the order, e.g. "18.00" | |
| invoiceNumber | No | Supplier invoice number for this delivery | |
| discountPercent | No | Discount as a percentage of the items subtotal | |
| purchaseOrderId | Yes | Purchase order id from get_purchase_orders — not a PO number | |
| updateSupplierCostVariantIds | No | Items whose new unitCost should become the supplier’s stored cost from now on |