Draft supplier POs (supplier-direct sends)
POST/api/send-plans/:sendPlan/supplier-purchase-orders
Create draft purchase orders from the plan's supplier-direct suggestions: what your warehouses can't cover of a network's need, ordered from a supplier that ships straight to that network (supplier profile → Ships to Fulfillment Networks). One draft PO per supplier × network, delivered to the network's warehouse, quantities rounded to whole cases and at least the supplier's minimum; the PO's expected delivery date is today + that supplier's lead time for the network. Each line is priced at the supplier's price for the product, or its average cost when the supplier has no price (or a $0 price). Nothing is sent to the supplier: the POs are drafts. Use Preview supplier POs first to see what would be created. A suggestion that already has a PO is skipped. The next plan counts the PO as on its way to the network (line inbound, meta.on_order), so the units aren't suggested again.
send-plans:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body: line_ids (optional, integer[]): only these lines' suggestions; omit for every suggestion in the plan.
Response: created (id, number, supplier_id, supplier_name, destination_warehouse_id, products, units per PO) and skipped (suggestions that already had a PO).
Needs the send_planner.draft and purchase_orders.create permissions (403 with an explanation otherwise). API tokens: send-plans:write.
Request
Responses
- 200
- 401
- 403
- 404
- 422
- 429
OK
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Validation failed — the body is a field → messages map (Laravel shape) or the platform envelope with a stable machine-readable code. Fix the payload and resubmit.
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.