API reference · Area

Purchase orders

Create purchase orders for vendors, receive deliveries and record payments. Track vendor costs and charges through to the final landed cost, including corrections after receiving.

49 endpointsStable throughout v1
Required permissionsRead purchase ordersManage purchase ordersDelete recordsSee costsEnter and correct costsSend emailsChange settings

Before you start

Choose access for costs

Enter and correct costs covers vendor costs, tax, shipping and charges, payments to vendors, publishing costs to Shopify and QuickBooks, and correcting costs already received.

Receiving changes stock

Receiving a delivery adds the received units to Shopify stock. Stock updates happen in the background.

Finalize when costs are complete

Finalizing a received purchase order makes its estimated charges final and locks cost editing. Reopen it before changing costs again.

Find records

15 endpoints
GET/purchase-ordersList purchase ordersReturns accessible purchase orders with the most recently changed first.Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}Get a purchase orderReturns a purchase order’s line items and status, with amounts when the caller can view costs.Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}/attachmentsList a purchase order’s filesReturns the purchase order’s saved files, newest first.Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}/attachments/{attachmentId}Get a purchase order file linkReturns a temporary link to a purchase order file.Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}/chargesGet a purchase order’s costs and chargesReturns charges and their line shares in allocations, estimated or final amounts, goods, tax, shipping, totals, planned landed cost, cost_status and…Any ofSee costsEnter and correct costsGET/purchase-orders/{id}/email-placeholdersList a purchase order’s merge fieldsThe merge fields the purchase order’s vendor email can use, each with this purchase order’s value (its own, never the customer order’s), as its…Manage purchase ordersGET/purchase-orders/{id}/freed-unitsList units freed by a canceled orderReturns received units freed by a canceled customer order.Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}/new-productsList products awaiting creationReturns purchase order lines awaiting a new Shopify product: creating, failed with Shopify’s reason, or not_queued.Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}/pdfDownload a purchase order’s PDFThe purchase order as a PDF, as its page’s Download PDF makes it (the merchant’s copy: lines, delivery, notes and terms).Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}/receiptsList a purchase order’s receiptsReturns posted receipts, newest first, with received and rejected quantities, receipt charges and later cost changes.Any ofRead purchase ordersManage purchase ordersGET/purchase-orders/{id}/vendor-paymentsList payments to the vendorReturns payments recorded against the purchase order, oldest first, with the total paid.Any ofSee costsEnter and correct costsGET/vendorsList vendorsReturns your store’s vendors alphabetically by display name.Any ofRead purchase ordersManage purchase ordersGET/vendors/shopify-sync/{jobId}Get a vendor syncReturns the sync’s status: queued, running, completed, failed or unknown after a finished job is cleared.Any ofRead purchase ordersManage purchase ordersGET/vendors/{id}Get a vendorReturns a vendor’s details.Any ofRead purchase ordersManage purchase ordersGET/warehousesList warehousesReturns your store’s warehouse delivery addresses alphabetically.Any ofManage purchase ordersChange settings

Create records

4 endpoints

Record actions

18 endpoints
POST/purchase-orders/{id}/attachmentsUpload a purchase order fileUploads a file of up to 10 MB and returns 201 with the file; the purchase order’s file limit applies.Manage purchase ordersPOST/purchase-orders/{id}/attachments/from-urlAdd a purchase order file from a URLAdds a JPEG, PNG, WebP, GIF or PDF of up to 10 MB to a purchase order from a public http or https URL and returns 201 with the file.Manage purchase ordersPOST/purchase-orders/{id}/cancelCancel a purchase orderCancels and deletes a purchase order if no items have been received.Manage purchase ordersAndDelete recordsPOST/purchase-orders/{id}/chargesAdd a purchase order chargeAdds freight, duty, inbound shipping, brokerage, insurance, handling, a tariff or another cost, split by value, quantity, weight or manual amounts, or…Enter and correct costsPOST/purchase-orders/{id}/charges/previewPreview a charge’s splitReturns how a charge would be split across purchase order lines, including the share applied immediately to received units, without saving it.Enter and correct costsPOST/purchase-orders/{id}/charges/{chargeId}/estimatedMark a charge estimated or finalMarks a charge final with is_estimated: false, or estimated again, and returns the updated costs.Enter and correct costsPOST/purchase-orders/{id}/cost-sync/retryRetry publishing costs to ShopifyQueues another attempt to publish the purchase order’s costs to Shopify’s cost per item when cost_sync_status is failed or paused; retrying also…Enter and correct costsPOST/purchase-orders/{id}/finalizeFinalize a purchase orderMakes a received purchase order’s estimated charges final and locks cost editing.Manage purchase ordersPOST/purchase-orders/{id}/freed-units/decisionStock or write off freed unitsRecords what to do with units freed by a canceled order: add_to_stock creates their stock product in Shopify and adds them with their cost in the…Enter and correct costsPOST/purchase-orders/{id}/mark-sentMark a purchase order as sentMarks a Draft or Sending purchase order as Sent without emailing it, for example after a phone call or sharing the PDF.Manage purchase ordersPOST/purchase-orders/{id}/new-products/retryRetry creating purchase order productsRetries Shopify product creation for one waiting new-product line using line_id, or for all waiting lines.Manage purchase ordersPOST/purchase-orders/{id}/quickbooks-syncSend a purchase order to QuickBooksQueues the purchase order for QuickBooks, including retries after a failed send.Enter and correct costsPOST/purchase-orders/{id}/receipts/{receiptId}/cost-adjustmentsAdjust a received costRecords and returns a late charge, corrected unit cost, vendor credit or reversal against the receipt’s received units, or one line’s, with a required…Enter and correct costsPOST/purchase-orders/{id}/receiveReceive a purchase orderRecords received items on a sent purchase order using cumulative quantities for each line.Manage purchase ordersPOST/purchase-orders/{id}/reopenReopen a purchase orderReopens a finalized purchase order for cost corrections.Manage purchase ordersPOST/purchase-orders/{id}/sendEmail a purchase orderEmails the purchase order and its PDF to the vendor, moving it from Draft to Sending to Sent once the email is accepted, or back to Draft if it cannot…Manage purchase ordersAndSend emailsPOST/purchase-orders/{id}/send/previewPreview a purchase order’s emailThe vendor email as the purchase order’s composer previews it, sending nothing: the store’s vendor template unless template_key names one (GET…Manage purchase ordersPOST/purchase-orders/{id}/vendor-paymentsRecord a payment to the vendorRecords a vendor payment’s amount, date and method and returns 201 with the purchase order’s payments and the new payment_id.Enter and correct costs

Update or delete records

12 endpoints
PATCH/purchase-orders/{id}Change a purchase order’s deliveryUpdates only an editable purchase order’s delivery type, receiving location and address.Manage purchase ordersDELETE/purchase-orders/{id}/attachments/{attachmentId}Delete a purchase order fileRemoves a file from the purchase order and records the removal in its activity.Manage purchase ordersPATCH/purchase-orders/{id}/charges/{chargeId}Change a purchase order chargeUpdates the supplied charge fields, recalculates the line shares, adjusts received units’ costs and returns the updated costs.Enter and correct costsDELETE/purchase-orders/{id}/charges/{chargeId}Remove a purchase order chargeRemoves a charge, subtracts its share from received units’ costs and returns the updated purchase order costs.Enter and correct costsPATCH/purchase-orders/{id}/linesChange a purchase order’s line itemsUpdates quantities with lines, removes items with remove_lines and adds order or stock items with add_lines, using kind from POST /purchase-orders.Manage purchase ordersPATCH/purchase-orders/{id}/receipts/{receiptId}Correct a receiptCorrects received or rejected counts, rejection reasons, vendor unit costs and receipt charges, adds missed items through add_lines and returns the…Any ofManage purchase ordersEnter and correct costsPATCH/purchase-orders/{id}/vendor-costsChange a purchase order’s tax and shippingUpdates tax and vendor shipping and returns the revised purchase order total.Enter and correct costsDELETE/purchase-orders/{id}/vendor-payments/{paymentId}Remove a recorded vendor paymentRemoves a payment recorded in error, removes the matching entry in QuickBooks and returns the updated purchase order payments.Enter and correct costsPATCH/vendors/{id}Change a vendorUpdates only the supplied vendor details and returns the vendor.Manage purchase ordersDELETE/vendors/{id}Delete a vendorDeletes a vendor and its activity; returns 422 DELETE_REFUSED while purchase orders or order lines reference it, so use PATCH /vendors/{id} with…Manage purchase ordersAndDelete recordsPATCH/warehouses/{id}Change a warehouseRename a warehouse or change its address (send either or both; the other is kept).Change settingsDELETE/warehouses/{id}Delete a warehouseDelete a warehouse from the list.Change settings

Stuck?

Chip, the OrderPilot beaver

Send us your request, the response and the time you sent it. Remove your key before sharing.

Email support[email protected]