Catalog
CatalogService reads the catalog. All writes go through SyncService.Push as patches, so the web dashboard and offline devices share one write path.
GetCatalog#
GetCatalog returns every catalog entity (archived ones included) and the sync cursor the snapshot was taken at. A new device loads this once, then calls SyncService.Pull from that cursor.
Request body
locationIdstringlocation_idIncludes only this location's prices; empty for every location's.
Response
currencyCodestringcurrency_codecategoriesCategory[]itemsItem[]modifiersModifier[]cursorint64 stringPull from this cursor to receive changes made after the snapshot.
departmentsDepartment[]discountsDiscount[]curl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/GetCatalog \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70"
}'{
"currencyCode": "TZS",
"taxRates": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"rateBp": 0,
"inclusive": false,
"archived": false
}
],
"categories": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"color": "",
"sortOrder": 0,
"archived": false,
"departmentId": ""
}
],
"items": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"categoryId": "",
"name": "Amina Mushi",
"description": "",
"kind": "ITEM_KIND_PRODUCT",
"archived": false,
"durationMinutes": 0,
"departmentId": "",
"imageId": ""
}
],
"itemVariants": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"itemId": "",
"name": "Amina Mushi",
"sku": "",
"barcode": "",
"price": "150000",
"trackStock": false,
"sortOrder": 0,
"archived": false,
"unit": "",
"unitPrecision": 0,
"imageId": "",
"wholesalePrice": "150000"
}
],
"modifierGroups": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"minSelect": 0,
"maxSelect": 0,
"archived": false,
"freeCount": 1,
"kind": "",
"displayName": "Amina Mushi",
"maxPerChoice": 0
}
],
"modifiers": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"groupId": "",
"name": "Amina Mushi",
"price": "150000",
"sortOrder": 0,
"archived": false,
"isDefault": false,
"soldOut": false,
"action": "",
"childGroupId": "",
"stockVariantId": "",
"ownTaxes": false
}
],
"cursor": "0",
"locationPrices": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"locationId": "0193a4f2-0b10-7f62-a4c9-6d1e2b3c4f70",
"variantId": "",
"price": "150000",
"archived": false
}
],
"departments": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"color": "",
"sortOrder": 0,
"archived": false
}
],
"discounts": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"kind": "DISCOUNT_KIND_PERCENT",
"percentBp": 0,
"amount": "150000",
"variable": false,
"scope": "DISCOUNT_SCOPE_ORDER",
"maxAmount": "150000",
"minOrderAmount": "150000",
"minQuantity": 1,
"automatic": false,
"requiresApproval": false,
"startsOn": "",
"endsOn": "",
"daysOfWeek": 0,
"startMinute": 0,
"endMinute": 0,
"color": "",
"sortOrder": 0,
"archived": false,
"itemOnly": false
}
]
}UploadImage#
UploadImage adds a photo to the business's image library and returns it. The server checks it is a real JPEG, PNG, WebP or GIF, turns it upright, strips its metadata (such as GPS) and stores it in three sizes. The same file uploaded twice returns the image already in the library. An item or variant shows an image by naming it in image_id.
Request body
database64 stringcontentTypestringcontent_typefilenamestringResponse
imageImageexistingbooleanTrue when the same file was already in the library.
curl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/UploadImage \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"image": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"filename": "",
"width": 0,
"height": 0,
"sizeBytes": "0",
"createdAt": "",
"usedBy": 0
},
"existing": false
}ListImages#
ListImages returns the library, newest first, with how many items and variants show each image.
Request body
pageSizeintegerpage_sizepageTokenstringpage_tokenResponse
imagesImage[]nextPageTokenstringnext_page_tokencurl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/ListImages \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 50
}'{
"images": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"filename": "",
"width": 0,
"height": 0,
"sizeBytes": "0",
"createdAt": "",
"usedBy": 0
}
],
"nextPageToken": ""
}DeleteImage#
DeleteImage removes an image no item or variant shows any more.
Request body
idstringResponse
No fields: send {}.
curl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/DeleteImage \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{}ExportItems#
ExportItems writes every item that isn't archived as a spreadsheet, one row per variant: item, variant, category, price, SKU, barcode, unit, track stock, taxes and description. The same file, edited, imports again through AssistantService.ReadCatalog.
Request body
formatstring"csv" (the default) or "xlsx".
Response
database64 stringfilenamestringcontentTypestringcontent_typecurl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/ExportItems \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"data": "",
"filename": "",
"contentType": ""
}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.
GetCatalogRequest
holygrail.catalog.v1.GetCatalogRequest
locationIdstringlocation_idIncludes only this location's prices; empty for every location's.
GetCatalogResponse
holygrail.catalog.v1.GetCatalogResponse
currencyCodestringcurrency_codecategoriesCategory[]itemsItem[]modifiersModifier[]cursorint64 stringPull from this cursor to receive changes made after the snapshot.
departmentsDepartment[]discountsDiscount[]UploadImageRequest
holygrail.catalog.v1.UploadImageRequest
database64 stringcontentTypestringcontent_typefilenamestringUploadImageResponse
holygrail.catalog.v1.UploadImageResponse
imageImageexistingbooleanTrue when the same file was already in the library.
ListImagesRequest
holygrail.catalog.v1.ListImagesRequest
pageSizeintegerpage_sizepageTokenstringpage_tokenListImagesResponse
holygrail.catalog.v1.ListImagesResponse
imagesImage[]nextPageTokenstringnext_page_tokenDeleteImageRequest
holygrail.catalog.v1.DeleteImageRequest
idstringDeleteImageResponse
holygrail.catalog.v1.DeleteImageResponse
No fields.
ExportItemsRequest
holygrail.catalog.v1.ExportItemsRequest
formatstring"csv" (the default) or "xlsx".
ExportItemsResponse
holygrail.catalog.v1.ExportItemsResponse
database64 stringfilenamestringcontentTypestringcontent_typeTaxRate
holygrail.catalog.v1.TaxRate
idstringnamestringrateBpintegerrate_bpBasis points: 825 = 8.25%.
inclusivebooleanTrue when prices already include this tax (common for VAT).
archivedbooleanCategory
holygrail.catalog.v1.Category
idstringnamestringcolorstring"#RRGGBB" or empty.
sortOrderintegersort_orderarchivedbooleandepartmentIdstringdepartment_idThe department its items belong to, unless an item names its own.
Item
holygrail.catalog.v1.Item
idstringcategoryIdstringcategory_idEmpty for uncategorised items.
namestringdescriptionstringkindItemKindarchivedbooleandurationMinutesintegerduration_minutesHow long a service takes, for booking; 0 for anything else.
departmentIdstringdepartment_idIts own department, when not its category's; empty to follow the category.
imageIdstringimage_idThe library image the register and dashboard show for it; empty for none.
Its own selection rules for some of its modifier groups (ADR 115); unset when it takes every group as it is.
ItemVariant
holygrail.catalog.v1.ItemVariant
ItemVariant is what is actually sold: every item has at least one.
idstringitemIdstringitem_idnamestringEmpty for an item's single default variant, e.g. "Large", "Red / M".
skustringbarcodestringpriceint64 stringtrackStockbooleantrack_stocksortOrderintegersort_orderarchivedbooleanunitstringUnit the variant is sold by, as its abbreviation ("kg", "lb", "h"), or empty to sell it by the piece. price is per one unit.
unitPrecisionintegerunit_precisionDecimals a quantity of the unit takes, 0 to 3. Above 0 the register asks for the measure (1.25 kg) and stock is kept in thousandths of the unit.
imageIdstringimage_idIts own library image, such as the red one of a shirt; empty to show the item's.
wholesalePriceint64 stringwholesale_priceThe price for wholesale customers (hotels and restaurants buying in bulk), per one unit like price; 0 when they pay the normal price (ADR 49).
ModifierGroup
holygrail.catalog.v1.ModifierGroup
idstringnamestringminSelectintegermin_selectmaxSelectintegermax_select0 means no limit.
archivedbooleanfreeCountintegerfree_countHow many choices come free (ADR 46): the first ones chosen are included in the price, and only the rest are charged.
availabilityModifierAvailabilityWhere and when the group is offered (ADR 46); unset for always.
kindstring"modifier" (a choice that changes the item: size, milk, cooking) or "addon" (an optional extra, usually charged) (ADR 115).
displayNamestringdisplay_nameWhat the register, kiosk and guests see; empty to show name. name is what the team manages the set by ("Milk (coffee bar)").
maxPerChoiceintegermax_per_choiceHow many times one choice can be picked: 0 or 1 for once, up to 99 ("Extra shot" ×3). Each pick goes on the line as its own modifier.
Modifier
holygrail.catalog.v1.Modifier
idstringgroupIdstringgroup_idnamestringpriceint64 stringsortOrderintegersort_orderarchivedbooleanisDefaultbooleanis_defaultChosen already when the item is picked; it can be taken off.
soldOutbooleansold_outSold out for now (86'd): shown, but it can't be chosen.
actionstringHow the kitchen and the receipt say it: "" (just the name), "add", "extra", "no", "sub", "side" or "light". "no" prints "NO Onions".
childGroupIdstringchild_group_idA group that opens when this is chosen ("Add cheese", then "Which cheese?"); empty for none.
excludesIdListChoices that can't go with this one, in any group.
availabilityModifierAvailabilityWhere and when it is offered; unset for always.
stockVariantIdstringstock_variant_idOffered only while this variant (an ingredient) has stock at the register's location; empty for always.
What it costs at some locations instead of price.
With own_taxes, taxed with tax_rate_ids (none for untaxed) instead of like its item (ADR 46).
ownTaxesbooleanown_taxesLocationPrice
holygrail.catalog.v1.LocationPrice
LocationPrice sells a variant at one location for a different price than the catalog's. Managers can set them for their own locations; the catalog itself is shared by every location.
idstringlocationIdstringlocation_idvariantIdstringvariant_idpriceint64 stringarchivedbooleanArchived goes back to the catalog price.
Department
holygrail.catalog.v1.Department
Department is a part of the business that makes or serves what is sold: Kitchen, Bar, Barista. Categories and items belong to one; kitchen tickets go to it, and sales are reported by it.
idstringnamestringcolorstring"#RRGGBB" or empty.
sortOrderintegersort_orderarchivedbooleanDiscount
holygrail.catalog.v1.Discount
Discount is a preset discount the register offers: "Staff 20%", "Happy hour", "$5 off $50". The register applies it to an order as an orders.v1.AppliedDiscount, a snapshot of these terms. See docs/adr/0026-discounts.md for how the rules work offline.
idstringnamestringkindDiscountKindpercentBpintegerpercent_bpBasis points for a percentage: 1500 = 15%. Up to 10000.
amountint64 stringMinor units for a fixed amount.
variablebooleanThe cashier types the percentage or amount at the sale (an open discount); percent_bp or amount is then a suggestion, or 0.
scopeDiscountScopeITEMS scope: the items and categories it applies to; both empty for any.
maxAmountint64 stringmax_amountCaps what one application takes; 0 for no cap.
minOrderAmountint64 stringmin_order_amountRules. The sale must be at least this much before discounts (0 for any), with at least min_quantity units it applies to (0 for any).
minQuantityintegermin_quantityautomaticbooleanApplied by the register on its own whenever the rules are met.
requiresApprovalbooleanrequires_approvalNeeds someone with pos.discount_approve to enter their passcode.
Locations it is offered at; empty for every location.
startsOnstringstarts_onLocal dates (YYYY-MM-DD) it runs from and to, both included; empty for no limit.
endsOnstringends_ondaysOfWeekintegerdays_of_weekDays of the week it runs on, a bit each from Sunday (1) to Saturday (64); 0 for every day.
startMinuteintegerstart_minuteLocal time of day it runs from and until, in minutes after midnight; both 0 for all day. An end before the start runs past midnight.
endMinuteintegerend_minutecolorstring"#RRGGBB" or empty: its button on the register.
sortOrderintegersort_orderarchivedbooleanitemOnlybooleanitem_onlyITEMS scope: off each item's own price only, never its modifiers ("half off pizzas, not the toppings").
Image
holygrail.catalog.v1.Image
Image is a photo in the business's image library. Its files are served, without signing in, at <api>/media/images/<id>/<size> with size one of sm (320 px), md (800 px) or lg (1600 px) on the longer side, never upscaled. An image's files never change, so clients cache them for good.
idstringRandom, so it cannot be guessed from another image's.
filenamestringThe uploaded file's name, to tell images apart in the library.
widthintegerOf the largest size kept.
heightintegersizeBytesint64 stringsize_bytesBytes of all sizes kept.
createdAttimestampcreated_atusedByintegerused_byItems and variants (archived ones included) that show it.
IdList
holygrail.catalog.v1.IdList
IdList wraps a list of ids so a patch can tell "not changed" from "cleared".
idsstring[]ModifierOverrides
holygrail.catalog.v1.ModifierOverrides
ModifierOverrides are an item's own rules for its modifier groups, by modifier group id.
ModifierAvailability
holygrail.catalog.v1.ModifierAvailability
ModifierAvailability says where and when a modifier group or choice is offered.
locationIdsstring[]location_idsThe locations that offer it; empty for every location.
daysOfWeekintegerdays_of_weekDays of the week, bit 0 = Sunday, bit 6 = Saturday; 0 for every day.
startMinuteintegerstart_minuteMinutes after midnight, local time. Equal for all day; an end before the start runs past midnight (18:00 to 02:00).
endMinuteintegerend_minuteLocationPrices
holygrail.catalog.v1.LocationPrices
LocationPrices is what a modifier costs at some locations instead of its price, by location id.
pricesmap<string, int64 string>ModifierGroupOverride
holygrail.catalog.v1.ModifierGroupOverride
ModifierGroupOverride changes a shared modifier group's selection rules for one item only (ADR 115); an unset field keeps the group's rule.
minSelectintegeroptionalmin_selectmaxSelectintegeroptionalmax_selectfreeCountintegeroptionalfree_countItemKind enum
holygrail.catalog.v1.ItemKind
ITEM_KIND_UNSPECIFIEDITEM_KIND_PRODUCTITEM_KIND_SERVICEA service has a duration and can be booked (Phase 4).
ITEM_KIND_FEEITEM_KIND_INGREDIENTStocked and used by recipes, never sold at the register: flour, milk, or a prepared sauce. See docs/adr/0027-storage-and-recipes.md.
DiscountKind enum
holygrail.catalog.v1.DiscountKind
DISCOUNT_KIND_UNSPECIFIEDDISCOUNT_KIND_PERCENTA percentage of what it applies to: percent_bp.
DISCOUNT_KIND_AMOUNTA fixed amount: amount, per unit on an item, once on a sale.
DiscountScope enum
holygrail.catalog.v1.DiscountScope
DISCOUNT_SCOPE_UNSPECIFIEDDISCOUNT_SCOPE_ORDERComes off the whole sale, spread over its lines.
DISCOUNT_SCOPE_ITEMSComes off each line it applies to: the items and categories it names, or any line when it names none.
Base URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.