Cafe
10 operations in the cafe namespace.
cafe.createSite
Section titled “cafe.createSite”Create a café site
POST /rpc/v1/cafe.createSiteA site is the unit that has somebody standing in it, which is why live views and anomaly detection are scoped here rather than to a machine.
Requires permission cafe.write and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
name |
string | yes | |
code |
string | yes | |
locationId |
string | no | |
timezone |
string | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.createSite \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.getLiveBar
Section titled “cafe.getLiveBar”What is happening at the bar right now
POST /rpc/v1/cafe.getLiveBarThe last five minutes and any group head currently going wrong, read from the site’s live session rather than the database — the point is to answer in seconds, not on the next rollup.
Requires permission cafe.read and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
siteId |
string | yes |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.getLiveBar \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.getSitePerformance
Section titled “cafe.getSitePerformance”How a site has been running
POST /rpc/v1/cafe.getSitePerformanceAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
Reads the hourly rollups, never the shots. A busy chain produces millions of shots a year and every dashboard would otherwise scan them.
Requires permission cafe.read and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
siteId |
string | yes | |
from |
string | yes | |
to |
string | yes |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.getSitePerformance \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.importPosSales
Section titled “cafe.importPosSales”Import sales lines from a point-of-sale system
POST /rpc/v1/cafe.importPosSalesIdempotent on the POS system’s own line id, so re-importing a day — which every reconciliation job eventually does — adds nothing.
Requires permission cafe.ingest and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
siteId |
string | yes | |
lines |
object[] | yes |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.importPosSales \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.listMachines
Section titled “cafe.listMachines”List bar equipment
POST /rpc/v1/cafe.listMachinesAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
Requires permission cafe.read and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
filter |
object | no | |
page |
object | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.listMachines \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.listReconciliations
Section titled “cafe.listReconciliations”Past reconciliations
POST /rpc/v1/cafe.listReconciliationsAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
A single day’s variance says little on its own. A consistent 8% is a process problem; one bad Tuesday is a bad Tuesday, and only the history distinguishes them.
Requires permission cafe.read and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
filter |
object | no | |
page |
object | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.listReconciliations \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.listShots
Section titled “cafe.listShots”Individual shots
POST /rpc/v1/cafe.listShotsAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
The raw rows, for investigating something the rollups surfaced. A time window is required: this is the highest-volume table in the system, and an unbounded query against it is never what anyone meant.
Requires permission cafe.read and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
filter |
object | yes | |
limit |
integer | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.listShots \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.listSites
Section titled “cafe.listSites”List café sites
POST /rpc/v1/cafe.listSitesAlso available as GET with a URL-encoded input query parameter, so the response can be HTTP-cached.
Requires permission cafe.read and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
page |
object | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.listSites \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.reconcilePos
Section titled “cafe.reconcilePos”Compare shots pulled against coffee sold
POST /rpc/v1/cafe.reconcilePosCounts shots and sale shot-equivalents for one business day and records the variance. A positive variance is coffee pulled but not sold — waste, comps or theft; a negative one means the till saw sales the machines did not report, which usually means a bridge is down.
Requires permission cafe.write and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
siteId |
string | yes | |
businessDate |
string | yes |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.reconcilePos \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'cafe.registerMachine
Section titled “cafe.registerMachine”Register bar equipment
POST /rpc/v1/cafe.registerMachinegroupCount matters: every group head is judged separately, because one failing group on a three-group machine is the most common real fault and a machine-level average hides it behind two groups that are fine.
Requires permission cafe.write and the cafe module on the organization’s plan.
Request
Section titled “Request”| Field | Type | Required | Description |
|---|---|---|---|
siteId |
string | yes | |
name |
string | yes | |
code |
string | yes | |
kind |
espresso_machine | grinder | batch_brewer | water_system |
yes | |
groupCount |
integer | no | |
brand |
string | no | |
model |
string | no | |
deviceId |
string | no |
Example
Section titled “Example”curl -X POST https://api.roastery.run/rpc/v1/cafe.registerMachine \ -H "Authorization: Bearer $ROASTERY_API_KEY" \ -H "X-Roastery-Org: $ORG_ID" \ -H "Content-Type: application/json" \ -d '{}'