What are Spreetail's Purchase Orders API Endpoints?
The Purchase Orders API lets you send root purchase orders to Spreetail and track them through to delivery.
How a root purchase order is organized
- A root purchase order is one order to one supplier. Its
idis therootPurchaseOrderIdused in every request. - Each root purchase order has one or more purchase orders (the
purchaseOrderslist), one for each Spreetail warehouse the goods are going to. Each has its ownid, used aspurchaseOrderId. - Each purchase order has line items: a part number and a quantity.
Placing an order, step by step
- Create a draft with Create Root Purchase Order. Nothing is sent to Spreetail yet. If your brand has more than one supplier, get the supplier IDs from List Suppliers first.
- Pick a ship-from address with List Ship Points, then set it with Update Draft Root Purchase Order.
- Add purchase orders with Add Purchase Orders, giving each one a warehouse (a
warehouseIdfrom List Warehouses), an earliest ship date, and line items. - Submit with Submit Root Purchase Order. If anything is missing, the response tells you what.
- Check progress with Get Root Purchase Order. The
statemoves fromSubmittingtoSubmitted, usually within a few minutes. - Track delivery with List Root Purchase Order Shipments.
Before you can submit, a draft needs:
- An order type (
domesticorimport) and matching transportation terms - A ship point
- At least one purchase order, each with an earliest ship date and at least one line item
- A supplier. This is set when the draft is created. If your brand has one supplier it's filled in for you; if it has more than one, send
supplierId(from List Suppliers) with Create Root Purchase Order.
Drafts can be changed freely. Once submitted, use the Purchase Order Changes endpoints instead.
Key terms
- Root purchase order: one order to one supplier. It holds the order type, transportation terms, and ship point, and is what you submit. Its
idis therootPurchaseOrderId. - Purchase order: the part of a root purchase order going to one Spreetail warehouse, with its own ship date and line items. Its
idis thepurchaseOrderId. - Ship point: the address the goods ship from. Choose one from List Ship Points.
- Warehouse: the Spreetail warehouse a purchase order is going to. Get the
warehouseIdfrom List Warehouses. - Order type and transportation terms:
domesticorders useCollect - VariableorPrepaid - Vendor builds freight into cost.;importorders useDDP - Delivery Duty Paid (Prepaid),DDPp - Delivery Duty Paid (Port), ormDDP - Modified Delivery Duty Paid (Collect). - Origin:
CreatedInPlatformif you created the order through this API,CreatedBySpreetailif Spreetail created it for you. Orders Spreetail created can be viewed but not changed here. - Supplier purchase order number: Spreetail's number for a purchase order, assigned once it's submitted.
Order state
state shows where the root purchase order is in this API:
| State | Meaning |
|---|---|
Draft | Not sent yet. You can change it freely. If Spreetail rejects a submission, the order comes back here and the submission attempt says why. |
Submitting | Sent, waiting for Spreetail to confirm. |
Submitted | Spreetail has the order. Use Purchase Order Changes to change it. |
SubmitFailed | The submission didn't go through. It's retried for you. |
SubmitParked | The submission needs a look from Spreetail. No action is needed from you. |
Updating | A change is being processed. Other changes return 409 Conflict until it finishes. |
UpdateFailed | A change couldn't be completed and needs a look from Spreetail. |
Deleted | The order was deleted. |
Cancelled | The order was cancelled. |
Brand status
brandStatus is a simpler view of the same order, for after it's submitted:
Open: still in progress.Received: the goods have arrived.Cancelled: the order was cancelled.
Each purchase order has its own brandStatus. The root purchase order is Open while any of them are open. It is null until Spreetail has the order.
Change status
Each change you send after submitting has a status:
Pending: saved, not yet sent to Spreetail.Dispatched: sent to Spreetail, waiting for the result.Succeeded: applied.Rejected: Spreetail declined it and nothing changed.failureDetailsays why.Failed: it couldn't be completed. The order moves toUpdateFaileduntil Spreetail resolves it.
