Developers
Sign inGet API keys
API reference/Commerce

Catalog

CatalogService reads the catalog. All writes go through SyncService.Push as patches, so the web dashboard and offline devices share one write path.

holygrail.catalog.v1.CatalogService5 methodscatalog.read · catalog.write

GetCatalog#

catalog.readRead
POST/holygrail.catalog.v1.CatalogService/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_id

Includes only this location's prices; empty for every location's.

Response

currencyCodestringcurrency_code
taxRatesTaxRate[]tax_rates
categoriesCategory[]
itemsItem[]
itemVariantsItemVariant[]item_variants
modifierGroupsModifierGroup[]modifier_groups
modifiersModifier[]
cursorint64 string

Pull from this cursor to receive changes made after the snapshot.

locationPricesLocationPrice[]location_prices
departmentsDepartment[]
discountsDiscount[]
Request
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"
}'
Response example
{
  "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#

catalog.writeWrite
POST/holygrail.catalog.v1.CatalogService/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 string
contentTypestringcontent_type
filenamestring

Response

imageImage
existingboolean

True when the same file was already in the library.

Request
curl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/UploadImage \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "image": {
    "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
    "filename": "",
    "width": 0,
    "height": 0,
    "sizeBytes": "0",
    "createdAt": "",
    "usedBy": 0
  },
  "existing": false
}

ListImages#

catalog.readRead
POST/holygrail.catalog.v1.CatalogService/ListImages

ListImages returns the library, newest first, with how many items and variants show each image.

Request body

pageSizeintegerpage_size
pageTokenstringpage_token

Response

imagesImage[]
nextPageTokenstringnext_page_token
Request
curl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/ListImages \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "pageSize": 50
}'
Response example
{
  "images": [
    {
      "id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
      "filename": "",
      "width": 0,
      "height": 0,
      "sizeBytes": "0",
      "createdAt": "",
      "usedBy": 0
    }
  ],
  "nextPageToken": ""
}

DeleteImage#

catalog.writeWrite
POST/holygrail.catalog.v1.CatalogService/DeleteImage

DeleteImage removes an image no item or variant shows any more.

Request body

idstring

Response

No fields: send {}.

Request
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"
}'
Response example
{}

ExportItems#

catalog.readRead
POST/holygrail.catalog.v1.CatalogService/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 string
filenamestring
contentTypestringcontent_type
Request
curl https://api.buziin.tech/holygrail.catalog.v1.CatalogService/ExportItems \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "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_id

Includes only this location's prices; empty for every location's.

GetCatalogResponse

holygrail.catalog.v1.GetCatalogResponse

currencyCodestringcurrency_code
taxRatesTaxRate[]tax_rates
categoriesCategory[]
itemsItem[]
itemVariantsItemVariant[]item_variants
modifierGroupsModifierGroup[]modifier_groups
modifiersModifier[]
cursorint64 string

Pull from this cursor to receive changes made after the snapshot.

locationPricesLocationPrice[]location_prices
departmentsDepartment[]
discountsDiscount[]

UploadImageRequest

holygrail.catalog.v1.UploadImageRequest

database64 string
contentTypestringcontent_type
filenamestring

UploadImageResponse

holygrail.catalog.v1.UploadImageResponse

imageImage
existingboolean

True when the same file was already in the library.

ListImagesRequest

holygrail.catalog.v1.ListImagesRequest

pageSizeintegerpage_size
pageTokenstringpage_token

ListImagesResponse

holygrail.catalog.v1.ListImagesResponse

imagesImage[]
nextPageTokenstringnext_page_token

DeleteImageRequest

holygrail.catalog.v1.DeleteImageRequest

idstring

DeleteImageResponse

holygrail.catalog.v1.DeleteImageResponse

No fields.

ExportItemsRequest

holygrail.catalog.v1.ExportItemsRequest

formatstring

"csv" (the default) or "xlsx".

ExportItemsResponse

holygrail.catalog.v1.ExportItemsResponse

database64 string
filenamestring
contentTypestringcontent_type

TaxRate

holygrail.catalog.v1.TaxRate

idstring
namestring
rateBpintegerrate_bp

Basis points: 825 = 8.25%.

inclusiveboolean

True when prices already include this tax (common for VAT).

archivedboolean

Category

holygrail.catalog.v1.Category

idstring
namestring
colorstring

"#RRGGBB" or empty.

sortOrderintegersort_order
archivedboolean
departmentIdstringdepartment_id

The department its items belong to, unless an item names its own.

Item

holygrail.catalog.v1.Item

idstring
categoryIdstringcategory_id

Empty for uncategorised items.

namestring
descriptionstring
taxRateIdsIdListtax_rate_ids
modifierGroupIdsIdListmodifier_group_ids
archivedboolean
durationMinutesintegerduration_minutes

How long a service takes, for booking; 0 for anything else.

departmentIdstringdepartment_id

Its own department, when not its category's; empty to follow the category.

imageIdstringimage_id

The library image the register and dashboard show for it; empty for none.

modifierOverridesModifierOverridesmodifier_overrides

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.

idstring
itemIdstringitem_id
namestring

Empty for an item's single default variant, e.g. "Large", "Red / M".

skustring
barcodestring
priceint64 string
trackStockbooleantrack_stock
sortOrderintegersort_order
archivedboolean
unitstring

Unit 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_precision

Decimals 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_id

Its own library image, such as the red one of a shirt; empty to show the item's.

wholesalePriceint64 stringwholesale_price

The 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

idstring
namestring
minSelectintegermin_select
maxSelectintegermax_select

0 means no limit.

archivedboolean
freeCountintegerfree_count

How many choices come free (ADR 46): the first ones chosen are included in the price, and only the rest are charged.

Where 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_name

What the register, kiosk and guests see; empty to show name. name is what the team manages the set by ("Milk (coffee bar)").

maxPerChoiceintegermax_per_choice

How 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

idstring
groupIdstringgroup_id
namestring
priceint64 string
sortOrderintegersort_order
archivedboolean
isDefaultbooleanis_default

Chosen already when the item is picked; it can be taken off.

soldOutbooleansold_out

Sold out for now (86'd): shown, but it can't be chosen.

actionstring

How the kitchen and the receipt say it: "" (just the name), "add", "extra", "no", "sub", "side" or "light". "no" prints "NO Onions".

childGroupIdstringchild_group_id

A group that opens when this is chosen ("Add cheese", then "Which cheese?"); empty for none.

excludesIdList

Choices that can't go with this one, in any group.

Where and when it is offered; unset for always.

stockVariantIdstringstock_variant_id

Offered only while this variant (an ingredient) has stock at the register's location; empty for always.

locationPricesLocationPriceslocation_prices

What it costs at some locations instead of price.

taxRateIdsIdListtax_rate_ids

With own_taxes, taxed with tax_rate_ids (none for untaxed) instead of like its item (ADR 46).

ownTaxesbooleanown_taxes

LocationPrice

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.

idstring
locationIdstringlocation_id
variantIdstringvariant_id
priceint64 string
archivedboolean

Archived 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.

idstring
namestring
colorstring

"#RRGGBB" or empty.

sortOrderintegersort_order
archivedboolean

Discount

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.

idstring
namestring
percentBpintegerpercent_bp

Basis points for a percentage: 1500 = 15%. Up to 10000.

amountint64 string

Minor units for a fixed amount.

variableboolean

The cashier types the percentage or amount at the sale (an open discount); percent_bp or amount is then a suggestion, or 0.

itemIdsIdListitem_ids

ITEMS scope: the items and categories it applies to; both empty for any.

categoryIdsIdListcategory_ids
maxAmountint64 stringmax_amount

Caps what one application takes; 0 for no cap.

minOrderAmountint64 stringmin_order_amount

Rules. 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_quantity
automaticboolean

Applied by the register on its own whenever the rules are met.

requiresApprovalbooleanrequires_approval

Needs someone with pos.discount_approve to enter their passcode.

locationIdsIdListlocation_ids

Locations it is offered at; empty for every location.

startsOnstringstarts_on

Local dates (YYYY-MM-DD) it runs from and to, both included; empty for no limit.

endsOnstringends_on
daysOfWeekintegerdays_of_week

Days of the week it runs on, a bit each from Sunday (1) to Saturday (64); 0 for every day.

startMinuteintegerstart_minute

Local 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_minute
colorstring

"#RRGGBB" or empty: its button on the register.

sortOrderintegersort_order
archivedboolean
itemOnlybooleanitem_only

ITEMS 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.

idstring

Random, so it cannot be guessed from another image's.

filenamestring

The uploaded file's name, to tell images apart in the library.

widthinteger

Of the largest size kept.

heightinteger
sizeBytesint64 stringsize_bytes

Bytes of all sizes kept.

createdAttimestampcreated_at
usedByintegerused_by

Items 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_ids

The locations that offer it; empty for every location.

daysOfWeekintegerdays_of_week

Days of the week, bit 0 = Sunday, bit 6 = Saturday; 0 for every day.

startMinuteintegerstart_minute

Minutes after midnight, local time. Equal for all day; an end before the start runs past midnight (18:00 to 02:00).

endMinuteintegerend_minute

LocationPrices

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_select
maxSelectintegeroptionalmax_select
freeCountintegeroptionalfree_count

ItemKind enum

holygrail.catalog.v1.ItemKind

ITEM_KIND_UNSPECIFIED
ITEM_KIND_PRODUCT
ITEM_KIND_SERVICE

A service has a duration and can be booked (Phase 4).

ITEM_KIND_FEE
ITEM_KIND_INGREDIENT

Stocked 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_UNSPECIFIED
DISCOUNT_KIND_PERCENT

A percentage of what it applies to: percent_bp.

DISCOUNT_KIND_AMOUNT

A fixed amount: amount, per unit on an item, once on a sale.

DiscountScope enum

holygrail.catalog.v1.DiscountScope

DISCOUNT_SCOPE_UNSPECIFIED
DISCOUNT_SCOPE_ORDER

Comes off the whole sale, spread over its lines.

DISCOUNT_SCOPE_ITEMS

Comes 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.