Draft a purchase order from low stock
Creates a draft purchase order with one line per variant whose
available plus incoming units are at or below its reorder point:
reorder_quantity units (or enough to reach the point), at the last
purchase cost or the variant's cost.
Authorization
bearer_auth Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.
In: header
Path Parameters
Store id
uuidHeader Parameters
A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.
length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/stock/reorder-draft" \ -H "Content-Type: application/json" \ -d '{}'{
"closed_at": "2019-08-24T14:15:22Z",
"created_at": "2019-08-24T14:15:22Z",
"currency": "string",
"expected_at": "2019-08-24",
"goods_cents": 0,
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"line_count": 0,
"location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
"notes": "string",
"number": "string",
"ordered_at": "2019-08-24T14:15:22Z",
"other_cents": 0,
"shipping_cents": 0,
"status": "draft",
"supplier_id": "3cb1e20c-c6c9-4e71-ba66-399c468f697c",
"supplier_name": "string",
"total_ordered": 0,
"total_received": 0,
"lines": [
{
"current_name": "string",
"description": "string",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"item_id": "4d8cd62e-a579-4dae-af8c-3172f96f8f7c",
"quantity_ordered": 0,
"quantity_received": 0,
"sku": "string",
"unit_cost_cents": 0
}
],
"receipts": [
{
"created_at": "2019-08-24T14:15:22Z",
"id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
"items": [
{
"description": "string",
"quantity": 0,
"sku": "string",
"unit_cost_cents": 0
}
],
"location_name": "string",
"note": "string",
"quantity": 0,
"received_by": "string"
}
]
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}{
"code": "not_found",
"details": {},
"error": "Order not found"
}