Check an order
check_orderCheck a basket against the bakery's ordering rules BEFORE any checkout. Returns the lane (same day on Toast, or catering on Shopify), the priced lines, the subtotal, any problems, and the dates and times the bakery can serve. Rules it applies: closed Mondays and blocked dates; same day = only today's counter items, up to 6 full-size, pickup, while open; catering = 3 days' notice for up to 24 full-size or 4 dozen bite-size (pickup), a week ahead (by Saturday) for anything larger, any delivery and custom cakes; delivery within 15 miles on orders over $100 or with a cake of $75 or more. Show the customer the lines and the subtotal, and never promise a date or time the result did not allow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| zip | No | Delivery ZIP code (delivery is within 15 miles). | |
| date | No | The date as YYYY-MM-DD ('today' also works). Work it out from the customer's words using today's date in Seattle (Pacific time). If their words could mean two dates, like 'next Friday' said earlier in the same week, ask them which before calling. Needed for catering. | |
| time | No | 12-hour time like '1:00 pm'. Needed for catering. | |
| items | Yes | What to order. Use item names exactly as get_menu or search_menu gave them. | |
| notes | No | Optional note for the bakery. | |
| channel | No | Optional. 'today' = same day from the counter menu, paid on Toast; 'catering' = ordered ahead, paid on Shopify. Left out, the basket decides. | |
| utensils | No | Catering: include utensils. Default true. | |
| fulfillment | No | Default pickup. Delivery is catering, week-ahead only. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | True when the order is allowed as asked. | |
| view | Yes | ||
| when | No | ||
| lines | Yes | ||
| title | No | ||
| today | No | Today's date in Seattle, like 'Thursday, September 24'. | |
| channel | No | ||
| problems | Yes | ||
| lane_label | No | ||
| date_choices | No | Present when the date asked for could mean either of these; ask the customer which. | |
| allowed_dates | No | ||
| allowed_times | No | ||
| earliest_date | No | ||
| subtotal_cents | Yes | Before tax; the checkout page shows the final total. | |
| delivery_allowed | No | ||
| allowed_date_labels | No | allowed_dates with weekdays, like 'Fri Oct 2'. |