Developers
Sign inGet API keys
API reference/Intelligence

Forecast

ForecastService forecasts what each location will sell, item by item and hour by hour, and drafts purchase orders and next week's shifts from it. See docs/adr/0056-demand-forecasts.md.

Forecasts are refreshed every morning at 06:00 local time from the last eight weeks of completed sales (less refunds), by business date. They are arithmetic over the business's own records: the same weekday's weighted average, a recent trend, closed days left out, slow sellers handled on their own, and new items borrowing a weekly pattern. Every number carries a one-line basis, and every past forecast is scored against what sold.

Drafts are never sent or published here: purchase orders wait in Draft for someone to send them, and shifts stay unpublished until a manager publishes the week.

holygrail.forecast.v1.ForecastService8 methodsinsights.read · insights.write

GetDemandForecast#

insights.readRead
POST/holygrail.forecast.v1.ForecastService/GetDemandForecast

GetDemandForecast is a location's forecast for a range of days (today and the next 13 by default): the location's orders and sales by day and hour, each item's units, and how accurate the forecasts have been.

Request body

locationIdstringlocation_id
fromstring

YYYY-MM-DD, inclusive; empty for today and the 13 days after. At most 60 days, and no further ahead than 14 days from today.

tostring
querystring

Filters items by name; empty for all.

limitinteger

At most this many items, busiest first; 0 for 200.

Response

todaystring
salesAccuracyAccuracysales_accuracy
itemAccuracyAccuracyitem_accuracy
madeAtstringmade_at

When the forecast was last made (RFC 3339); empty when never.

draftsActivebooleandrafts_active

Whether drafts are being made for this location, and why.

draftsReasonstringdrafts_reason

Events on the requested days.

Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/GetDemandForecast \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'
Response example
{
  "today": "",
  "days": [
    {
      "date": "2026-12-05",
      "orders": "0",
      "netSales": "0",
      "lowSales": "0",
      "highSales": "0",
      "hourOrders": [
        "0"
      ],
      "hourSales": [
        "0"
      ],
      "confidence": "",
      "basis": "",
      "past": false,
      "actualOrders": "0",
      "actualNetSales": "0",
      "upliftOrders": "0",
      "upliftSales": "0",
      "reasons": [
        ""
      ]
    }
  ],
  "items": [
    {
      "variantId": "",
      "name": "Amina Mushi",
      "category": "",
      "days": [
        "0"
      ],
      "total": "150000",
      "lowTotal": "150000",
      "highTotal": "150000",
      "method": "",
      "confidence": "",
      "basis": "",
      "soldLast28Days": "0",
      "uplift": "0"
    }
  ],
  "salesAccuracy": {
    "days": 0,
    "wapeBp": 0,
    "biasBp": 0,
    "text": ""
  },
  "itemAccuracy": {
    "days": 0,
    "wapeBp": 0,
    "biasBp": 0,
    "text": ""
  },
  "madeAt": "",
  "draftsActive": false,
  "draftsReason": "",
  "events": [
    {
      "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
      "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
      "date": "2026-12-05",
      "kind": "",
      "name": "Amina Mushi",
      "guests": 0,
      "note": ""
    }
  ]
}

RefreshDemandForecast#

insights.writeWrite
POST/holygrail.forecast.v1.ForecastService/RefreshDemandForecast

RefreshDemandForecast rebuilds a location's history and forecast now.

Request body

locationIdstringlocation_id

Response

itemsinteger
madeAtstringmade_at
Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/RefreshDemandForecast \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'
Response example
{
  "items": 0,
  "madeAt": ""
}

GetForecastSettings#

insights.readRead
POST/holygrail.forecast.v1.ForecastService/GetForecastSettings

Request body

locationIdstringlocation_id

Response

Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/GetForecastSettings \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'
Response example
{
  "settings": {
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "drafts": "",
    "orderWeekday": 0,
    "orderHour": 0,
    "orderCycleDays": 0,
    "scheduleWeekday": 0,
    "scheduleHour": 0,
    "draftsActive": false,
    "draftsReason": ""
  }
}

UpdateForecastSettings#

insights.writeWrite
POST/holygrail.forecast.v1.ForecastService/UpdateForecastSettings

Request body

Response

Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/UpdateForecastSettings \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "settings": {
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
  }
}'
Response example
{
  "settings": {
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "drafts": "",
    "orderWeekday": 0,
    "orderHour": 0,
    "orderCycleDays": 0,
    "scheduleWeekday": 0,
    "scheduleHour": 0,
    "draftsActive": false,
    "draftsReason": ""
  }
}

DraftFromForecast#

insights.writeWrite
POST/holygrail.forecast.v1.ForecastService/DraftFromForecast

DraftFromForecast drafts purchase orders (inventory.manage) or a week's shifts (shifts.manage) now, whatever the settings say.

Request body

locationIdstringlocation_id
kindstring

orders or schedule.

weekStartstringweek_start

For a schedule, the Monday the week starts (YYYY-MM-DD); empty for next week.

Response

summarystring
purchaseOrderIdsstring[]purchase_order_ids
shiftsDraftedintegershifts_drafted
openShiftsintegeropen_shifts
Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/DraftFromForecast \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'
Response example
{
  "summary": "",
  "purchaseOrderIds": [
    ""
  ],
  "shiftsDrafted": 0,
  "openShifts": 0
}

ListForecastEvents#

insights.readRead
POST/holygrail.forecast.v1.ForecastService/ListForecastEvents

Events are what is known about a day ahead that history can't see: a party, a group reservation or a catering order (ADR 75). Saving or deleting one refreshes the forecast. Needs inventory.manage, shifts.manage or pos.bookings.

Request body

locationIdstringlocation_id
fromstring

YYYY-MM-DD; empty for today and the next 60 days.

tostring

Response

Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/ListForecastEvents \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'
Response example
{
  "events": [
    {
      "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
      "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
      "date": "2026-12-05",
      "kind": "",
      "name": "Amina Mushi",
      "guests": 0,
      "note": ""
    }
  ]
}

SaveForecastEvent#

insights.writeWrite
POST/holygrail.forecast.v1.ForecastService/SaveForecastEvent

Request body

Empty id for a new event.

Response

Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/SaveForecastEvent \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "event": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "date": "2026-12-05",
    "name": "Amina Mushi",
    "lines": [
      {
        "name": "Amina Mushi",
        "quantity": 1
      }
    ]
  }
}'
Response example
{
  "event": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
    "date": "2026-12-05",
    "kind": "",
    "name": "Amina Mushi",
    "guests": 0,
    "note": ""
  }
}

DeleteForecastEvent#

insights.writeWrite
POST/holygrail.forecast.v1.ForecastService/DeleteForecastEvent

Request body

idstring

Response

No fields: send {}.

Request
curl https://api.buziin.tech/holygrail.forecast.v1.ForecastService/DeleteForecastEvent \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'
Response example
{}

Types

The messages and enums these methods use. Field names are lowerCamelCase in JSON; the snake_case names work too. Enum values are sent as their names.

GetDemandForecastRequest

holygrail.forecast.v1.GetDemandForecastRequest

locationIdstringlocation_id
fromstring

YYYY-MM-DD, inclusive; empty for today and the 13 days after. At most 60 days, and no further ahead than 14 days from today.

tostring
querystring

Filters items by name; empty for all.

limitinteger

At most this many items, busiest first; 0 for 200.

GetDemandForecastResponse

holygrail.forecast.v1.GetDemandForecastResponse

todaystring
salesAccuracyAccuracysales_accuracy
itemAccuracyAccuracyitem_accuracy
madeAtstringmade_at

When the forecast was last made (RFC 3339); empty when never.

draftsActivebooleandrafts_active

Whether drafts are being made for this location, and why.

draftsReasonstringdrafts_reason

Events on the requested days.

RefreshDemandForecastRequest

holygrail.forecast.v1.RefreshDemandForecastRequest

locationIdstringlocation_id

RefreshDemandForecastResponse

holygrail.forecast.v1.RefreshDemandForecastResponse

itemsinteger
madeAtstringmade_at

GetForecastSettingsRequest

holygrail.forecast.v1.GetForecastSettingsRequest

locationIdstringlocation_id

GetForecastSettingsResponse

holygrail.forecast.v1.GetForecastSettingsResponse

UpdateForecastSettingsRequest

holygrail.forecast.v1.UpdateForecastSettingsRequest

UpdateForecastSettingsResponse

holygrail.forecast.v1.UpdateForecastSettingsResponse

DraftFromForecastRequest

holygrail.forecast.v1.DraftFromForecastRequest

locationIdstringlocation_id
kindstring

orders or schedule.

weekStartstringweek_start

For a schedule, the Monday the week starts (YYYY-MM-DD); empty for next week.

DraftFromForecastResponse

holygrail.forecast.v1.DraftFromForecastResponse

summarystring
purchaseOrderIdsstring[]purchase_order_ids
shiftsDraftedintegershifts_drafted
openShiftsintegeropen_shifts

ListForecastEventsRequest

holygrail.forecast.v1.ListForecastEventsRequest

locationIdstringlocation_id
fromstring

YYYY-MM-DD; empty for today and the next 60 days.

tostring

ListForecastEventsResponse

holygrail.forecast.v1.ListForecastEventsResponse

SaveForecastEventRequest

holygrail.forecast.v1.SaveForecastEventRequest

Empty id for a new event.

SaveForecastEventResponse

holygrail.forecast.v1.SaveForecastEventResponse

DeleteForecastEventRequest

holygrail.forecast.v1.DeleteForecastEventRequest

idstring

DeleteForecastEventResponse

holygrail.forecast.v1.DeleteForecastEventResponse

No fields.

DemandDay

holygrail.forecast.v1.DemandDay

DemandDay is the location's forecast for one business date. For days already past, actual_* say what happened.

datestring
ordersint64 string
netSalesint64 stringnet_sales
lowSalesint64 stringlow_sales
highSalesint64 stringhigh_sales
hourOrdersint64 string[]hour_orders

24 values, local hour 0 to 23.

hourSalesint64 string[]hour_sales
confidencestring
basisstring
pastboolean
actualOrdersint64 stringactual_orders
actualNetSalesint64 stringactual_net_sales
upliftOrdersint64 stringuplift_orders

What bookings, hotel guests and events added to orders and sales (negative when fewer hotel guests lowered them), and why, one line each.

upliftSalesint64 stringuplift_sales
reasonsstring[]

ItemForecast

holygrail.forecast.v1.ItemForecast

ItemForecast is one item's units over the requested days.

variantIdstringvariant_id
namestring
categorystring
daysint64 string[]

One value per requested day, in order.

totalint64 string
lowTotalint64 stringlow_total
highTotalint64 stringhigh_total
methodstring

weekday, intermittent or new.

confidencestring
basisstring
soldLast28Daysint64 stringsold_last_28_days

Units sold over the last 28 days, for comparison.

upliftint64 string

Units over the days added by bookings, hotel guests and events.

Accuracy

holygrail.forecast.v1.Accuracy

Accuracy compares past forecasts with what sold.

daysinteger
wapeBpintegerwape_bp

Weighted absolute percentage error in basis points (1200 = 12%).

biasBpintegerbias_bp

Total forecast over total actual, less one, in basis points; positive when forecasts ran high.

textstring

ForecastEvent

holygrail.forecast.v1.ForecastEvent

ForecastEvent is something known about a day ahead.

idstring
locationIdstringlocation_id
datestring

YYYY-MM-DD, a business date.

kindstring

reservation, catering or event.

namestring
guestsinteger

Guests on top of the usual trade. With no lines, every item rises by guests over the day's expected orders.

notestring

Exactly what it will take, when known (a catering order, a set menu).

ForecastSettings

holygrail.forecast.v1.ForecastSettings

locationIdstringlocation_id
draftsstring

auto (on once forecasts have been accurate for four weeks), on or off.

orderWeekdayintegerorder_weekday

ISO weekday, 1 Monday ... 7 Sunday, and local hour.

orderHourintegerorder_hour
orderCycleDaysintegerorder_cycle_days

How many days a draft order should look ahead for what needs ordering.

scheduleWeekdayintegerschedule_weekday
scheduleHourintegerschedule_hour
draftsActivebooleandrafts_active

Read only: whether drafting is on now, and why.

draftsReasonstringdrafts_reason
recentRunsForecastRun[]recent_runs

Read only: the last drafts made, newest first.

ForecastEventLine

holygrail.forecast.v1.ForecastEventLine

variantIdstringvariant_id
namestring

Read only.

quantityint64 string

ForecastRun

holygrail.forecast.v1.ForecastRun

kindstring

forecast, orders or schedule.

periodstring
ranAtstringran_at
summarystring

Base URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.