Customers
CustomersService reads customers and their loyalty points.
Customers and the loyalty program are synced entities: registers and the dashboard create and edit them through SyncService with CustomerPatch and LoyaltyProgramPatch, merged field by field like the catalog. Every register keeps the whole customer list so it can look people up offline.
Points are kept by the server. A completed order that names a customer earns points on what was spent before tax, and redeems the points the register used for a reward. Points cannot be edited directly; AdjustPoints records a correction with a reason.
ListCustomers#
Request body
querystringMatches name, email or phone.
includeArchivedbooleaninclude_archivedpageSizeintegerpage_sizeOrdered by name; pass the previous response's next_page_token.
pageTokenstringpage_tokenResponse
customersCustomer[]nextPageTokenstringnext_page_tokencurl https://api.buziin.tech/holygrail.customers.v1.CustomersService/ListCustomers \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 50
}'{
"customers": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"email": "amina@example.co.tz",
"phone": "+255712345678",
"note": "",
"archived": false,
"pointsBalance": "150000",
"visitCount": 1,
"totalSpent": "0",
"lastVisitAt": "",
"createdAt": "",
"wholesale": false,
"tierId": "",
"qualifyingSpend": "0",
"lifetimePoints": "0",
"birthday": "",
"marketingOptIn": false,
"cardToken": ""
}
],
"nextPageToken": ""
}GetCustomer#
Request body
idstringResponse
customerCustomerpointsPointsEvent[]Newest first, at most 100.
curl https://api.buziin.tech/holygrail.customers.v1.CustomersService/GetCustomer \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"customer": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"email": "amina@example.co.tz",
"phone": "+255712345678",
"note": "",
"archived": false,
"pointsBalance": "150000",
"visitCount": 1,
"totalSpent": "0",
"lastVisitAt": "",
"createdAt": "",
"wholesale": false,
"tierId": "",
"qualifyingSpend": "0",
"lifetimePoints": "0",
"birthday": "",
"marketingOptIn": false,
"cardToken": ""
},
"points": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "POINTS_KIND_EARNED",
"points": "0",
"orderId": "",
"orderNumber": "",
"reason": "",
"createdAt": ""
}
]
}ExportCustomers#
ExportCustomers pages through every customer for a register's first sync, with the feed cursor to pull from afterwards.
Request body
pageSizeintegerpage_sizeDefaults to 1000, at most 5000.
pageTokenstringpage_tokenResponse
customersCustomer[]The program, if the organization has set one up.
cursorint64 stringThe feed position this page was read at. Pull from the first page's.
nextPageTokenstringnext_page_tokencurl https://api.buziin.tech/holygrail.customers.v1.CustomersService/ExportCustomers \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"pageSize": 50
}'{
"customers": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"email": "amina@example.co.tz",
"phone": "+255712345678",
"note": "",
"archived": false,
"pointsBalance": "150000",
"visitCount": 1,
"totalSpent": "0",
"lastVisitAt": "",
"createdAt": "",
"wholesale": false,
"tierId": "",
"qualifyingSpend": "0",
"lifetimePoints": "0",
"birthday": "",
"marketingOptIn": false,
"cardToken": ""
}
],
"loyaltyProgram": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"enabled": false,
"spendPerPoint": "0",
"rewardPoints": "0",
"rewardValue": "0",
"name": "Amina Mushi",
"welcomePoints": "0",
"birthdayPoints": "0",
"expiryMonths": 0,
"tierWindowMonths": 0,
"color": ""
},
"cursor": "0",
"nextPageToken": ""
}AdjustPoints#
Request body
idstringClient-chosen UUID, so a retried request adjusts once.
customerIdstringcustomer_idpointsint64 stringreasonstringResponse
customerCustomercurl https://api.buziin.tech/holygrail.customers.v1.CustomersService/AdjustPoints \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01"
}'{
"customer": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"email": "amina@example.co.tz",
"phone": "+255712345678",
"note": "",
"archived": false,
"pointsBalance": "150000",
"visitCount": 1,
"totalSpent": "0",
"lastVisitAt": "",
"createdAt": "",
"wholesale": false,
"tierId": "",
"qualifyingSpend": "0",
"lifetimePoints": "0",
"birthday": "",
"marketingOptIn": false,
"cardToken": ""
}
}GetLoyaltyReport#
GetLoyaltyReport shows how the program is doing over a period: members, points earned, redeemed and expired, what members spend, tiers, the rewards people pick and the best members. See docs/adr/0120.
Request body
fromstringRFC 3339 bounds; to is exclusive.
tostringtimeZonestringtime_zoneIANA zone the days are counted in; defaults to UTC.
Response
membersintegernewMembersintegernew_membersactiveMembersintegeractive_membersMembers who bought in the period, and those who bought twice or more.
returningMembersintegerreturning_memberspointsEarnedint64 stringpoints_earnedpointsBonusint64 stringpoints_bonuspointsRedeemedint64 stringpoints_redeemedpointsExpiredint64 stringpoints_expiredpointsOutstandingint64 stringpoints_outstandingUnspent points now, and what they are worth at the standard reward's rate.
liabilityint64 stringsalesint64 stringCompleted sales, tax included, and how much of it was to members.
memberSalesint64 stringmember_salesordersintegermemberOrdersintegermember_ordersdaysLoyaltyDay[]tiersTierCount[]rewardsRewardUse[]rewardsValueint64 stringrewards_valueWhat rewards took off orders in the period.
curl https://api.buziin.tech/holygrail.customers.v1.CustomersService/GetLoyaltyReport \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"members": 0,
"newMembers": 0,
"activeMembers": 0,
"returningMembers": 0,
"pointsEarned": "0",
"pointsBonus": "0",
"pointsRedeemed": "0",
"pointsExpired": "0",
"pointsOutstanding": "0",
"liability": "0",
"sales": "0",
"memberSales": "0",
"orders": 0,
"memberOrders": 0,
"days": [
{
"date": "2026-12-05",
"pointsEarned": "0",
"pointsRedeemed": "0",
"memberSales": "0"
}
],
"tiers": [
{
"tierId": "",
"name": "Amina Mushi",
"members": 0
}
],
"rewards": [
{
"rewardId": "",
"name": "Amina Mushi",
"redemptions": 0,
"points": "0",
"value": "0"
}
],
"topMembers": [
{
"spent": "0",
"visits": 0
}
],
"rewardsValue": "0"
}GetMemberCard#
GetMemberCard is public: the customer's own loyalty card, opened from the private link the business shares with them. It needs no sign-in.
Request body
tokenstringResponse
businessNamestringbusiness_nameprogramNamestringprogram_namecolorstringcurrencystringcustomerNamestringcustomer_namepointsBalanceint64 stringpoints_balancelifetimePointsint64 stringlifetime_pointsmemberSincestringmember_sincetierLoyaltyTierThe next tier up and what is left to spend to reach it.
spendToNextTierint64 stringspend_to_next_tierrewardsLoyaltyReward[]Rewards the member can see, cheapest first.
campaignsLoyaltyCampaign[]Campaigns running today.
pointsPointsEvent[]Newest first, at most 20.
expiryMonthsintegerexpiry_monthslastVisitAtstringlast_visit_atcurl https://api.buziin.tech/holygrail.customers.v1.CustomersService/GetMemberCard \
-H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'{
"businessName": "Amina Mushi",
"programName": "Amina Mushi",
"color": "",
"currency": "TZS",
"customerName": "Amina Mushi",
"pointsBalance": "150000",
"lifetimePoints": "0",
"memberSince": "",
"tier": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"minSpend": "0",
"earnMultiplierBp": 0,
"perks": "",
"color": ""
},
"nextTier": {
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"minSpend": "0",
"earnMultiplierBp": 0,
"perks": "",
"color": ""
},
"spendToNextTier": "0",
"rewards": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"description": "",
"points": "0",
"kind": "REWARD_KIND_AMOUNT_OFF",
"value": "0",
"maxValue": "0",
"variantIds": [
""
],
"minTierId": "",
"archived": false
}
],
"campaigns": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"name": "Amina Mushi",
"kind": "CAMPAIGN_KIND_MULTIPLIER",
"multiplierBp": 0,
"bonusPoints": "0",
"startsOn": "",
"endsOn": "",
"daysOfWeek": 0,
"minSpend": "0",
"tierIds": [
""
],
"active": false
}
],
"points": [
{
"id": "4f1c2e9a-8b3d-4e57-9a10-2c6f7d8e9b01",
"kind": "POINTS_KIND_EARNED",
"points": "0",
"orderId": "",
"orderNumber": "",
"reason": "",
"createdAt": ""
}
],
"expiryMonths": 0,
"lastVisitAt": ""
}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.
ListCustomersRequest
holygrail.customers.v1.ListCustomersRequest
querystringMatches name, email or phone.
includeArchivedbooleaninclude_archivedpageSizeintegerpage_sizeOrdered by name; pass the previous response's next_page_token.
pageTokenstringpage_tokenListCustomersResponse
holygrail.customers.v1.ListCustomersResponse
customersCustomer[]nextPageTokenstringnext_page_tokenGetCustomerRequest
holygrail.customers.v1.GetCustomerRequest
idstringGetCustomerResponse
holygrail.customers.v1.GetCustomerResponse
customerCustomerpointsPointsEvent[]Newest first, at most 100.
ExportCustomersRequest
holygrail.customers.v1.ExportCustomersRequest
pageSizeintegerpage_sizeDefaults to 1000, at most 5000.
pageTokenstringpage_tokenExportCustomersResponse
holygrail.customers.v1.ExportCustomersResponse
customersCustomer[]The program, if the organization has set one up.
cursorint64 stringThe feed position this page was read at. Pull from the first page's.
nextPageTokenstringnext_page_tokenAdjustPointsRequest
holygrail.customers.v1.AdjustPointsRequest
idstringClient-chosen UUID, so a retried request adjusts once.
customerIdstringcustomer_idpointsint64 stringreasonstringGetLoyaltyReportRequest
holygrail.customers.v1.GetLoyaltyReportRequest
fromstringRFC 3339 bounds; to is exclusive.
tostringtimeZonestringtime_zoneIANA zone the days are counted in; defaults to UTC.
GetLoyaltyReportResponse
holygrail.customers.v1.GetLoyaltyReportResponse
membersintegernewMembersintegernew_membersactiveMembersintegeractive_membersMembers who bought in the period, and those who bought twice or more.
returningMembersintegerreturning_memberspointsEarnedint64 stringpoints_earnedpointsBonusint64 stringpoints_bonuspointsRedeemedint64 stringpoints_redeemedpointsExpiredint64 stringpoints_expiredpointsOutstandingint64 stringpoints_outstandingUnspent points now, and what they are worth at the standard reward's rate.
liabilityint64 stringsalesint64 stringCompleted sales, tax included, and how much of it was to members.
memberSalesint64 stringmember_salesordersintegermemberOrdersintegermember_ordersdaysLoyaltyDay[]tiersTierCount[]rewardsRewardUse[]rewardsValueint64 stringrewards_valueWhat rewards took off orders in the period.
GetMemberCardRequest
holygrail.customers.v1.GetMemberCardRequest
tokenstringGetMemberCardResponse
holygrail.customers.v1.GetMemberCardResponse
businessNamestringbusiness_nameprogramNamestringprogram_namecolorstringcurrencystringcustomerNamestringcustomer_namepointsBalanceint64 stringpoints_balancelifetimePointsint64 stringlifetime_pointsmemberSincestringmember_sincetierLoyaltyTierThe next tier up and what is left to spend to reach it.
spendToNextTierint64 stringspend_to_next_tierrewardsLoyaltyReward[]Rewards the member can see, cheapest first.
campaignsLoyaltyCampaign[]Campaigns running today.
pointsPointsEvent[]Newest first, at most 20.
expiryMonthsintegerexpiry_monthslastVisitAtstringlast_visit_atCustomer
holygrail.customers.v1.Customer
idstringnamestringemailstringphonestringnotestringarchivedbooleanpointsBalanceint64 stringpoints_balanceKept by the server from completed orders and adjustments.
visitCountintegervisit_counttotalSpentint64 stringtotal_spentOrder totals, including tax, in minor units.
lastVisitAtstringlast_visit_atRFC 3339; empty before the first visit.
createdAtstringcreated_atwholesalebooleanA wholesale customer (a hotel or restaurant buying in bulk) pays each item's wholesale price where it has one (ADR 49).
tierIdstringtier_idLoyalty membership (ADR 120). The tier is kept by the server from what the customer spent in the program's tier window.
qualifyingSpendint64 stringqualifying_spendBefore tax, in minor units, over the program's tier window.
lifetimePointsint64 stringlifetime_pointsEvery point ever earned, bonuses included.
birthdaystring"MM-DD" or "YYYY-MM-DD"; empty if not given. Earns the birthday bonus.
marketingOptInbooleanmarketing_opt_inThe customer agreed to hear about offers.
cardTokenstringcard_tokenThe private part of the customer's loyalty card link. Output only.
PointsEvent
holygrail.customers.v1.PointsEvent
idstringkindPointsKindpointsint64 stringPositive adds points, negative takes them away.
orderIdstringorder_idThe order, for earned and redeemed points.
orderNumberstringorder_numberreasonstringcreatedAtstringcreated_atLoyaltyProgram
holygrail.customers.v1.LoyaltyProgram
LoyaltyProgram is the organization's loyalty program; its id is the organization's id. Amounts are minor units.
Tiers, rewards and campaigns are part of the program document: an owner edits them together on the dashboard and each list is replaced whole when it changes (ADR 120).
idstringenabledbooleanspendPerPointint64 stringspend_per_pointOne point for every this much spent before tax, e.g. 100 for $1.
rewardPointsint64 stringreward_pointsThe standard reward, offered when rewards is empty: it costs this many points...
rewardValueint64 stringreward_value...and takes this much off an order.
namestringThe program's name on receipts, the member card and the register: "Mama Lishe Rewards". Empty means "Rewards".
welcomePointsint64 stringwelcome_pointsPoints given once when a customer joins.
birthdayPointsint64 stringbirthday_pointsPoints given once a year on the customer's birthday.
expiryMonthsintegerexpiry_monthsPoints lapse after this many months without a visit; 0 keeps them.
tierWindowMonthsintegertier_window_monthsTiers count spend over this many months; 0 counts every sale.
tiersLoyaltyTier[]Lowest first by min_spend.
rewardsLoyaltyReward[]campaignsLoyaltyCampaign[]colorstringA hex accent for the member card, e.g. "#0F766E".
LoyaltyDay
holygrail.customers.v1.LoyaltyDay
datestringYYYY-MM-DD in the request's zone.
pointsEarnedint64 stringpoints_earnedpointsRedeemedint64 stringpoints_redeemedmemberSalesint64 stringmember_salesTierCount
holygrail.customers.v1.TierCount
tierIdstringtier_idEmpty for members below every tier.
namestringmembersintegerRewardUse
holygrail.customers.v1.RewardUse
rewardIdstringreward_idnamestringredemptionsintegerpointsint64 stringvalueint64 stringLoyaltyTier
holygrail.customers.v1.LoyaltyTier
A level customers reach by spending: Silver, Gold. Higher tiers earn faster.
idstringClient-chosen UUID, kept when the tier is renamed.
namestringminSpendint64 stringmin_spendSpend before tax over the tier window that reaches the tier. The lowest tier usually has 0.
earnMultiplierBpintegerearn_multiplier_bpPoints earned are multiplied by this, in basis points: 15000 is 1.5×.
perksstringWhat members get, shown on the register and the member card.
colorstringLoyaltyReward
holygrail.customers.v1.LoyaltyReward
Something a member can spend points on.
idstringnamestringdescriptionstringpointsint64 stringkindRewardKindvalueint64 stringmaxValueint64 stringmax_valuevariantIdsstring[]variant_idsminTierIdstringmin_tier_idOnly members at this tier or above; empty for everyone.
archivedbooleanLoyaltyCampaign
holygrail.customers.v1.LoyaltyCampaign
A promotion that earns extra points while it runs.
idstringnamestringkindCampaignKindmultiplierBpintegermultiplier_bpbonusPointsint64 stringbonus_pointsstartsOnstringstarts_onDates at the sale's location, inclusive; empty is open-ended.
endsOnstringends_ondaysOfWeekintegerdays_of_weekDays it runs, bit 0 Sunday to bit 6 Saturday; 0 is every day.
minSpendint64 stringmin_spendSpend before tax a sale needs to qualify.
tierIdsstring[]tier_idsOnly members of these tiers; empty for everyone.
activebooleanPointsKind enum
holygrail.customers.v1.PointsKind
POINTS_KIND_UNSPECIFIEDPOINTS_KIND_EARNEDPOINTS_KIND_REDEEMEDPOINTS_KIND_ADJUSTEDPOINTS_KIND_BONUSWelcome and birthday bonuses.
POINTS_KIND_EXPIREDPoints that lapsed after the program's expiry months without a visit.
RewardKind enum
holygrail.customers.v1.RewardKind
REWARD_KIND_UNSPECIFIEDREWARD_KIND_AMOUNT_OFFvalue off the order.
REWARD_KIND_PERCENT_OFFvalue basis points off the order, up to max_value if set.
REWARD_KIND_FREE_ITEMOne of variant_ids free: the register takes the price of one off when it is on the order.
CampaignKind enum
holygrail.customers.v1.CampaignKind
CAMPAIGN_KIND_UNSPECIFIEDCAMPAIGN_KIND_MULTIPLIERPoints earned are multiplied by multiplier_bp: double points weekends.
CAMPAIGN_KIND_BONUSbonus_points more on each qualifying sale.
Base URL https://api.buziin.tech. Every method is POST with a JSON body; see Making requests.