1. Create the plan
POST /api/restock-plans with name (and optionally brandId, collectionId,
description). It returns the new plan’s id and status (DRAFT).
- cURL
- Python
- JavaScript
2. Add an item
POST /api/restock-plans/{planId}/items with variantId, sizeId, shopId, quantity.
It returns { "success": true, "itemId": "…" }.
- cURL
- Python
- JavaScript
Handle the response
Adding items runs through business rules, so plan for these outcomes:- Success —
{ "success": true, "itemId": "…" }. - Blocked by a rule —
success: falsewitherrorCode: "BUSINESS_RULE_VIOLATION"; read the message and adjust. - Validation —
errorCode: "VARIANT_REQUIRED","QUANTITY_INVALID", etc. Fix the payload. - Auth —
401 UNAUTHORIZED(bad/expired token) or403 FORBIDDEN(missing permission).
Other plan types follow the same pattern — e.g. rebalance is
POST /api/rebalance-plans
then POST /api/rebalance-plans/{id}/items. Browse the exact fields per endpoint in the
API Reference tab.
