create_order
ChatGPTCreate a new sales order. Echo the parsed order back to the user for confirmation before calling this. Source is recorded as "chat" and the raw args are stored for audit. Rejected (as a tool error) when the fulfillment date breaks the shop's date rules. No customer is notified. For a delivery, the address is sent to Google Maps to estimate drive time; if the shop caps bookings per storefront time slot, the new booked count is published to its Shopify storefront. Returns {id, summary}. If the user attached a photo of the bouquet or product, pass it as image; the result then carries imageAttached: true, or imageError when the order was created without it — only tell the user the photo was saved when imageAttached is true. Always pass a new idempotency_key for each record you mean to create, and the same key again when retrying it, so a retry never creates a duplicate.
create_purchase_order
ChatGPTRecord a purchase order from a supplier. Echo the supplier, items, and total back to the user for confirmation before calling. Amounts are in the PO's currency, one of: USD. Total = Σ(quantity × unit_price) + shipping + tax − discount and must be > 0. Status defaults to ordered. Internal record only — the supplier is not contacted. Returns the created purchase order. If the user attached a photo of the receipt or invoice, read the supplier, date (ordered_at), lines and amounts off it yourself, confirm them, and pass the photo as receipt_image so the PO keeps it as its source; the result then carries imageAttached: true, or imageError when the PO was created without it — only tell the user the photo was saved when imageAttached is true. Always pass a new idempotency_key for each record you mean to create, and the same key again when retrying it, so a retry never creates a duplicate.
get_cost_center_summary
ChatGPTHeadline overhead and labor figures for any month, quarter, year or date range: recurring monthly/annual burn of the bills active today, that burn prorated over the period, one-off overhead in the period, and (when the pay module is on) labor cost per staff member with worked and overtime minutes. Flags explain missing numbers (missing pay rate, mixed currencies, someone still clocked in). No comparison — use get_expense_series or get_profit_report for change over time. Labor here is null when any worked day lacks a pay rate; get_profit_report instead counts the labor it can price and flags laborIncomplete. Money figures are numbers rounded to 2dp. Each amount is reported in its native currency, plus a base* equivalent in the shop's reporting (primary) currency. A base figure is null — never 0 — when an FX rate is missing: say the total is unavailable rather than treating null as zero or summing across currencies yourself. Base figures for past periods are converted at today's exchange rate, not the rate on the day.
get_expense_series
ChatGPTTime series of operating expenses over any month, quarter, year or custom range, split into overhead (recurring bills prorated to a daily share), one-off overhead (landing whole on its date), labor (staff pay; omitted when the pay module is off — see laborIncluded), and processing_fees (what payment processors kept from orders, by fulfillment date; present only when the period has any). laborIncomplete=true means some worked days had no pay rate, so labor is understated. Purchase orders are NOT included (see get_sales_series metric=cost). period and comparison give the resolved dates and day counts; delta compares raw totals, perDayBase compares per-day averages — use perDayBase when the two windows differ in length or the period is partial. Money figures are numbers rounded to 2dp. Each amount is reported in its native currency, plus a base* equivalent in the shop's reporting (primary) currency. A base figure is null — never 0 — when an FX rate is missing: say the total is unavailable rather than treating null as zero or summing across currencies yourself. Base figures for past periods are converted at today's exchange rate, not the rate on the day.
get_order
ChatGPTFetch a single order by id: status, fulfillment type/time (ISO 8601, UTC), customer and recipient contact, delivery address and driver, items, design and card notes, image URLs, amounts and payment.
get_profit_report
ChatGPTThe shop's P&L for any month, quarter, year or date range, in the base currency: revenue (non-cancelled orders less their sales tax, by fulfillment date) − cost of goods (non-cancelled purchase orders, by order date) = gross profit; − operating expenses (overhead bills prorated per day, one-off bills, staff pay, card processing fees) = operating profit; with margins, per-bucket profit and deltas vs the comparison window. Use it for 'did we make money in Q3', 'how is this month's margin vs last year'. includes says which lines the shop's modules provide — when costOfGoods or operatingExpenses is false that line is null and the profit above it is all there is; say so rather than calling gross profit 'profit'. Cost of goods is cash-basis (what was bought in the period, not matched to what was sold). operatingExpenses.laborIncomplete=true means some worked days had no pay rate, so labor is understated and operating profit overstated. Any null amount means an exchange rate is missing — report it as unavailable, never as 0 (a missing rate in the comparison window nulls the expense buckets too). A profit pct is null when the previous profit was zero or a loss — describe the change from the amounts. period and comparison give the resolved dates and day counts; delta compares raw totals, perDayBase compares per-day averages — use perDayBase when the two windows differ in length or the period is partial. Money figures are numbers rounded to 2dp. Each amount is reported in its native currency, plus a base* equivalent in the shop's reporting (primary) currency. A base figure is null — never 0 — when an FX rate is missing: say the total is unavailable rather than treating null as zero or summing across currencies yourself. Base figures for past periods are converted at today's exchange rate, not the rate on the day.
get_purchase_order
ChatGPTFetch a single purchase order with its line items by id.
get_purchasing_report
ChatGPTOne-call purchase-order analysis for any month, quarter, year or date range — use this (not list_purchase_orders, which is one month of raw POs) for questions like 'what did I spend on flowers in Q3', 'who are my biggest suppliers this year' or 'are rose prices going up'. POs are dated by their order date (ordered_at); cancelled POs are reported apart and excluded from spend. Returns: spend (per currency + base), PO count and average PO size with deltas vs the comparison window; shipping / tax / discount within that spend; spend per bucket; top suppliers by spend (names matched case- and space-insensitively) and the supplier count; spend by status (ordered, in transit, received); top items by spend — matched on name and unit — with quantity, PO count and the unit price (first, last, min, max, quantity-weighted average, in the base currency) plus the comparison window's average unit price, for price trends; and needsReview, how many POs were read from invoice emails and not yet checked by the owner (their figures are as read). Purchase orders only — overhead and labor are in get_expense_series. period and comparison give the resolved dates and day counts; delta compares raw totals, perDayBase compares per-day averages — use perDayBase when the two windows differ in length or the period is partial. Money figures are numbers rounded to 2dp. Each amount is reported in its native currency, plus a base* equivalent in the shop's reporting (primary) currency. A base figure is null — never 0 — when an FX rate is missing: say the total is unavailable rather than treating null as zero or summing across currencies yourself. Base figures for past periods are converted at today's exchange rate, not the rate on the day.
get_sales_dashboard
ChatGPTSnapshot of the shop's sales as of today (shop-local; the response's timezone names the zone): KPI tiles (today's revenue and order count, 30-day average order value, 30-day revenue vs purchasing) with deltas vs the prior period; month-to-date cumulative revenue vs last month at the same day; revenue by currency and by order source this month; a daily order-count heatmap; top products by units over the last 30 days (from structured line items only — coverage counts say how many orders had none); and orders needing attention (past due, missing pickup time, delivery without a driver). Revenue counts non-cancelled orders by fulfillment date, less the sales tax recorded on them (platform orders); a manual order with no tax recorded counts whole. Money figures are numbers rounded to 2dp. Each amount is reported in its native currency, plus a base* equivalent in the shop's reporting (primary) currency. A base figure is null — never 0 — when an FX rate is missing: say the total is unavailable rather than treating null as zero or summing across currencies yourself. Base figures for past periods are converted at today's exchange rate, not the rate on the day.
get_sales_report
ChatGPTOne-call sales analysis for any month, quarter, year or date range — use this (not get_sales_series) for questions like 'how did Q3 go', 'which channel sold most last year', 'best-selling bouquets in September' or 'who are my repeat customers'. Revenue counts non-cancelled orders by fulfillment date, less the sales tax recorded on them (platform orders); a manual order with no tax recorded counts whole. Returns: revenue (per currency + base), order count and average order value with deltas vs the comparison window; revenue per bucket; breakdowns by order source, pickup vs delivery and weekday (shop-local); top products by revenue from structured line items (topProducts.ordersWithoutItems says how many orders had none, so product revenue never reconciles to the total); top customers by revenue, matched on phone then email, plus repeat-customer counts; cancelled orders (count and value, excluded from revenue), unpaid orders and walk-ins. Optional source / fulfillment_type filters narrow every figure. period and comparison give the resolved dates and day counts; delta compares raw totals, perDayBase compares per-day averages — use perDayBase when the two windows differ in length or the period is partial. Money figures are numbers rounded to 2dp. Each amount is reported in its native currency, plus a base* equivalent in the shop's reporting (primary) currency. A base figure is null — never 0 — when an FX rate is missing: say the total is unavailable rather than treating null as zero or summing across currencies yourself. Base figures for past periods are converted at today's exchange rate, not the rate on the day.
get_sales_series
ChatGPTTime series of revenue (orders less their sales tax, by fulfillment date) or cost (non-cancelled purchase orders, by order date) over any month, quarter, year or custom range, bucketed by day/week/month, with per-currency amounts, a base-currency total, and the delta vs a comparison window. Cost covers purchase orders only — use get_expense_series for overhead and labor. period and comparison give the resolved dates and day counts; delta compares raw totals, perDayBase compares per-day averages — use perDayBase when the two windows differ in length or the period is partial. Money figures are numbers rounded to 2dp. Each amount is reported in its native currency, plus a base* equivalent in the shop's reporting (primary) currency. A base figure is null — never 0 — when an FX rate is missing: say the total is unavailable rather than treating null as zero or summing across currencies yourself. Base figures for past periods are converted at today's exchange rate, not the rate on the day.
list_orders_for_day
ChatGPTList orders whose fulfillment falls on the given date (shop-local), sorted by fulfillmentAt ascending. Each order has the same fields as get_order.
list_purchase_orders
ChatGPTList purchase orders (supplier buys — flowers and goods for resale) ordered in a period (by shop-local order date; default this month), newest first, with line items — one page at a time. nextCursor is non-null when there are more: pass it back as cursor, with the same filters, for the next page. totals are per-currency sums of the WHOLE filtered period (never combined across currencies), not just this page; suppliers are the supplier names used historically. Filter by supplier substring, status, or currency. For spend totals, trends, top suppliers or item prices over a period use get_purchasing_report instead of paging.
search_order
ChatGPTResolve a customer's natural-language reference (name, phone, items mentioned, date range) to one or more order ids — newest fulfillment first. Returns orders (at most limit trimmed summaries; call get_order for full details on one) and nextCursor: when it is not null there are more matches — pass it back as cursor, with the same filters, for the next page. At least one filter is required. For totals, trends, top products or customers over a period use get_sales_report instead of paging through orders.
update_order
ChatGPTApply a partial update to an existing order, overwriting the supplied fields (items, when supplied, replace the whole list). ALWAYS call get_order first and echo the proposed diff to the owner for confirmation before invoking. Only supplied fields are changed. For status-only changes, prefer update_status. A new delivery address is sent to Google Maps to re-estimate drive time. When the patch changes the status (directly, or via item statuses): Side effects outside BouquetOS: for an order imported from the shop's connected Shopify store, a status change is pushed to Shopify, and Shopify emails the customer — pickup: ready_for_pickup marks it ready for pickup (Shopify sends the "ready for pickup" email, once per order) and completed creates the Shopify fulfillment (Shopify sends the fulfilled/picked-up email); delivery: delivering creates the Shopify fulfillment (shipping-confirmation email) and delivering → completed marks it delivered (delivered email); moving an order back out of those states cancels the Shopify fulfillment. Emails already sent cannot be recalled. Orders not from Shopify notify no one. If the shop caps bookings per storefront time slot, the updated booked counts are also published to its Shopify storefront. If the shop caps orders per day, cancelling an order can reopen its day on the storefront (and a day that reaches the cap closes by itself). Returns the updated order.
update_purchase_order
ChatGPTApply a partial update to a purchase order — e.g. mark it received, fix a price, add shipping. Call get_purchase_order first and confirm the change with the user. Only supplied fields change; items, when supplied, replace the whole list. Currency must be one of: USD. Internal record only — the supplier is not contacted. Returns the updated purchase order.
update_status
ChatGPTTransition an order to a new status (sets every item on the order to that status). Records the change in the order status history under the signed-in user; setting the status the order already has changes nothing. Confirm with the user before calling. Side effects outside BouquetOS: for an order imported from the shop's connected Shopify store, a status change is pushed to Shopify, and Shopify emails the customer — pickup: ready_for_pickup marks it ready for pickup (Shopify sends the "ready for pickup" email, once per order) and completed creates the Shopify fulfillment (Shopify sends the fulfilled/picked-up email); delivery: delivering creates the Shopify fulfillment (shipping-confirmation email) and delivering → completed marks it delivered (delivered email); moving an order back out of those states cancels the Shopify fulfillment. Emails already sent cannot be recalled. Orders not from Shopify notify no one. If the shop caps bookings per storefront time slot, the updated booked counts are also published to its Shopify storefront. If the shop caps orders per day, cancelling an order can reopen its day on the storefront (and a day that reaches the cap closes by itself). Returns the updated order.
upload_image
ChatGPTUpload a bouquet reference image to object storage and return its URL (anyone with the URL can view the image) to pass back as image_url on create_order. Accepts base64-encoded JPEG/PNG/WEBP/GIF up to 10 MB. Returns {url, bytes}.