Purchase Orders

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 id is the rootPurchaseOrderId used in every request.
  • Each root purchase order has one or more purchase orders (the purchaseOrders list), one for each Spreetail warehouse the goods are going to. Each has its own id, used as purchaseOrderId.
  • Each purchase order has line items: a part number and a quantity.

Placing an order, step by step

  1. 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.
  2. Pick a ship-from address with List Ship Points, then set it with Update Draft Root Purchase Order.
  3. Add purchase orders with Add Purchase Orders, giving each one a warehouse (a warehouseId from List Warehouses), an earliest ship date, and line items.
  4. Submit with Submit Root Purchase Order. If anything is missing, the response tells you what.
  5. Check progress with Get Root Purchase Order. The state moves from Submitting to Submitted, usually within a few minutes.
  6. Track delivery with List Root Purchase Order Shipments.

Before you can submit, a draft needs:

  • An order type (domestic or import) 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 id is the rootPurchaseOrderId.
  • Purchase order: the part of a root purchase order going to one Spreetail warehouse, with its own ship date and line items. Its id is the purchaseOrderId.
  • 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 warehouseId from List Warehouses.
  • Order type and transportation terms: domestic orders use Collect - Variable or Prepaid - Vendor builds freight into cost.; import orders use DDP - Delivery Duty Paid (Prepaid), DDPp - Delivery Duty Paid (Port), or mDDP - Modified Delivery Duty Paid (Collect).
  • Origin: CreatedInPlatform if you created the order through this API, CreatedBySpreetail if 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:

StateMeaning
DraftNot sent yet. You can change it freely. If Spreetail rejects a submission, the order comes back here and the submission attempt says why.
SubmittingSent, waiting for Spreetail to confirm.
SubmittedSpreetail has the order. Use Purchase Order Changes to change it.
SubmitFailedThe submission didn't go through. It's retried for you.
SubmitParkedThe submission needs a look from Spreetail. No action is needed from you.
UpdatingA change is being processed. Other changes return 409 Conflict until it finishes.
UpdateFailedA change couldn't be completed and needs a look from Spreetail.
DeletedThe order was deleted.
CancelledThe 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. failureDetail says why.
  • Failed: it couldn't be completed. The order moves to UpdateFailed until Spreetail resolves it.