POST/api/ordering/recurring

Create a standing order

Creates a standing order template and materializes its occurrence horizon in the same transaction. Supply customerId, name, daysOfWeek, and lines; line quantities and preparation options define the template. The response may include a non-blocking warning about an overlapping weekday order or a generation run that has already passed.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

6 body fields

The complete standing-order template. customerId, name, daysOfWeek, and lines are required; server-derived fields and line id values are rejected.

customerIdintegerrequired
The identifier of the customer for this standing order.
namestringrequired
The standing order name. Maximum 120 characters.
daysOfWeekarray<integer>required
Weekdays on which the order recurs, as integers from 0 (Sunday) to 6 (Saturday). Include at least one day.
isActivebooleanoptional
Whether the standing order is active. Defaults to true when omitted.
Default:true
pausedUntilstringoptional
Must be strictly after today. Forced to null when `isActive` is true.
linesarray<object>required
At least one standing-order line. Each line requires `itemId`, `qty`, `rawBaked`, `loosePacked`, and `sliced`; `qty` must be greater than 0. `rawBaked` must be `raw` or `baked`, `loosePacked` must be `loose` or `packed`, and `sliced` must be `sliced` or `not_sliced`. Each line may also include integer `caseQty` and a `lineNote`.

5 status codes
201Returns the created standing-order object, including its schedule, lines, and server-derived fields. The response may include a non-blocking `warning` when the customer already has an active order on one of the same weekdays or today’s generation run has passed.
idstringoptional
customerIdstringoptional
customerNamestringoptional
namestringoptional
daysOfWeekarray<integer>optional
0 = Sunday … 6 = Saturday, ascending. Always at least one.
isActivebooleanoptional
pausedUntilstringoptional
Suppressed until this day, and it fires again ON it. Null while active, and null while paused indefinitely — an indefinite pause is what "stop" means for v1.
createdByIdstringoptional
Null once the person who created it is retired.
createdAtstringoptional
lastGeneratedAtstringoptional
A true instant, not a day. Null until the first fire.
linesarray<object>optional
warningstringoptional
Present only on a create/update response, and NEVER a block. Says that this customer already has an active standing order sharing a weekday, and/or that today's generation run has already passed so this occurrence will not fire automatically.
400Returned when input is invalid, including when required fields are missing, server-derived fields or line `id` values are sent, or a value fails validation.
errorstringrequired
401Returned when the authenticated user is not signed in.
errorstringrequired
403Returned when the authenticated user lacks the required department membership or role.
errorstringrequired
500Returned when an unexpected server error occurs.
errorstringrequired

Error handling

A 400 is returned for invalid input, including omitted required fields, server-derived fields in the request, or values that fail validation; a 401 is returned when the authenticated user is not signed in. A 403 is returned when the authenticated user lacks the required department membership or role, and a 500 is returned for an unexpected server error. customerId, name, daysOfWeek, and lines are required; daysOfWeek must contain at least one integer from 0 to 6, and each line must include itemId, qty, rawBaked, loosePacked, and sliced. qty must be greater than 0, the preparation fields must use their documented enum values, and pausedUntil, when supplied, must be a date strictly after today; do not send server-derived fields or line id values.