Developers
Sign inGet API keys
API reference/Commerce

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.

holygrail.customers.v1.CustomersService6 methodscustomers.read · customers.write

ListCustomers#

customers.readRead
POST/holygrail.customers.v1.CustomersService/ListCustomers

Request body

querystring

Matches name, email or phone.

includeArchivedbooleaninclude_archived
pageSizeintegerpage_size

Ordered by name; pass the previous response's next_page_token.

pageTokenstringpage_token

Response

customersCustomer[]
nextPageTokenstringnext_page_token
Request
curl https://api.buziin.tech/holygrail.customers.v1.CustomersService/ListCustomers \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "pageSize": 50
}'
Response example
{
  "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#

customers.readRead
POST/holygrail.customers.v1.CustomersService/GetCustomer

Request body

idstring

Response

customerCustomer

Newest first, at most 100.

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

customers.readRead
POST/holygrail.customers.v1.CustomersService/ExportCustomers

ExportCustomers pages through every customer for a register's first sync, with the feed cursor to pull from afterwards.

Request body

pageSizeintegerpage_size

Defaults to 1000, at most 5000.

pageTokenstringpage_token

Response

customersCustomer[]
loyaltyProgramLoyaltyProgramloyalty_program

The program, if the organization has set one up.

cursorint64 string

The feed position this page was read at. Pull from the first page's.

nextPageTokenstringnext_page_token
Request
curl https://api.buziin.tech/holygrail.customers.v1.CustomersService/ExportCustomers \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "pageSize": 50
}'
Response example
{
  "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#

customers.writeWrite
POST/holygrail.customers.v1.CustomersService/AdjustPoints

Request body

idstring

Client-chosen UUID, so a retried request adjusts once.

customerIdstringcustomer_id
pointsint64 string
reasonstring

Response

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

customers.readRead
POST/holygrail.customers.v1.CustomersService/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

fromstring

RFC 3339 bounds; to is exclusive.

tostring
timeZonestringtime_zone

IANA zone the days are counted in; defaults to UTC.

Response

membersinteger
newMembersintegernew_members
activeMembersintegeractive_members

Members who bought in the period, and those who bought twice or more.

returningMembersintegerreturning_members
pointsEarnedint64 stringpoints_earned
pointsBonusint64 stringpoints_bonus
pointsRedeemedint64 stringpoints_redeemed
pointsExpiredint64 stringpoints_expired
pointsOutstandingint64 stringpoints_outstanding

Unspent points now, and what they are worth at the standard reward's rate.

liabilityint64 string
salesint64 string

Completed sales, tax included, and how much of it was to members.

memberSalesint64 stringmember_sales
ordersinteger
memberOrdersintegermember_orders
topMembersTopMember[]top_members
rewardsValueint64 stringrewards_value

What rewards took off orders in the period.

Request
curl https://api.buziin.tech/holygrail.customers.v1.CustomersService/GetLoyaltyReport \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "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#

customers.readRead
POST/holygrail.customers.v1.CustomersService/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

tokenstring

Response

businessNamestringbusiness_name
programNamestringprogram_name
colorstring
currencystring
customerNamestringcustomer_name
pointsBalanceint64 stringpoints_balance
lifetimePointsint64 stringlifetime_points
memberSincestringmember_since
nextTierLoyaltyTiernext_tier

The next tier up and what is left to spend to reach it.

spendToNextTierint64 stringspend_to_next_tier

Rewards the member can see, cheapest first.

Campaigns running today.

Newest first, at most 20.

expiryMonthsintegerexpiry_months
lastVisitAtstringlast_visit_at
Request
curl https://api.buziin.tech/holygrail.customers.v1.CustomersService/GetMemberCard \
  -H "Authorization: Bearer $LUMORA_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
Response example
{
  "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

querystring

Matches name, email or phone.

includeArchivedbooleaninclude_archived
pageSizeintegerpage_size

Ordered by name; pass the previous response's next_page_token.

pageTokenstringpage_token

ListCustomersResponse

holygrail.customers.v1.ListCustomersResponse

customersCustomer[]
nextPageTokenstringnext_page_token

GetCustomerRequest

holygrail.customers.v1.GetCustomerRequest

idstring

GetCustomerResponse

holygrail.customers.v1.GetCustomerResponse

customerCustomer

Newest first, at most 100.

ExportCustomersRequest

holygrail.customers.v1.ExportCustomersRequest

pageSizeintegerpage_size

Defaults to 1000, at most 5000.

pageTokenstringpage_token

ExportCustomersResponse

holygrail.customers.v1.ExportCustomersResponse

customersCustomer[]
loyaltyProgramLoyaltyProgramloyalty_program

The program, if the organization has set one up.

cursorint64 string

The feed position this page was read at. Pull from the first page's.

nextPageTokenstringnext_page_token

AdjustPointsRequest

holygrail.customers.v1.AdjustPointsRequest

idstring

Client-chosen UUID, so a retried request adjusts once.

customerIdstringcustomer_id
pointsint64 string
reasonstring

AdjustPointsResponse

holygrail.customers.v1.AdjustPointsResponse

customerCustomer

GetLoyaltyReportRequest

holygrail.customers.v1.GetLoyaltyReportRequest

fromstring

RFC 3339 bounds; to is exclusive.

tostring
timeZonestringtime_zone

IANA zone the days are counted in; defaults to UTC.

GetLoyaltyReportResponse

holygrail.customers.v1.GetLoyaltyReportResponse

membersinteger
newMembersintegernew_members
activeMembersintegeractive_members

Members who bought in the period, and those who bought twice or more.

returningMembersintegerreturning_members
pointsEarnedint64 stringpoints_earned
pointsBonusint64 stringpoints_bonus
pointsRedeemedint64 stringpoints_redeemed
pointsExpiredint64 stringpoints_expired
pointsOutstandingint64 stringpoints_outstanding

Unspent points now, and what they are worth at the standard reward's rate.

liabilityint64 string
salesint64 string

Completed sales, tax included, and how much of it was to members.

memberSalesint64 stringmember_sales
ordersinteger
memberOrdersintegermember_orders
topMembersTopMember[]top_members
rewardsValueint64 stringrewards_value

What rewards took off orders in the period.

GetMemberCardRequest

holygrail.customers.v1.GetMemberCardRequest

tokenstring

GetMemberCardResponse

holygrail.customers.v1.GetMemberCardResponse

businessNamestringbusiness_name
programNamestringprogram_name
colorstring
currencystring
customerNamestringcustomer_name
pointsBalanceint64 stringpoints_balance
lifetimePointsint64 stringlifetime_points
memberSincestringmember_since
nextTierLoyaltyTiernext_tier

The next tier up and what is left to spend to reach it.

spendToNextTierint64 stringspend_to_next_tier

Rewards the member can see, cheapest first.

Campaigns running today.

Newest first, at most 20.

expiryMonthsintegerexpiry_months
lastVisitAtstringlast_visit_at

Customer

holygrail.customers.v1.Customer

idstring
namestring
emailstring
phonestring
notestring
archivedboolean
pointsBalanceint64 stringpoints_balance

Kept by the server from completed orders and adjustments.

visitCountintegervisit_count
totalSpentint64 stringtotal_spent

Order totals, including tax, in minor units.

lastVisitAtstringlast_visit_at

RFC 3339; empty before the first visit.

createdAtstringcreated_at
wholesaleboolean

A wholesale customer (a hotel or restaurant buying in bulk) pays each item's wholesale price where it has one (ADR 49).

tierIdstringtier_id

Loyalty membership (ADR 120). The tier is kept by the server from what the customer spent in the program's tier window.

qualifyingSpendint64 stringqualifying_spend

Before tax, in minor units, over the program's tier window.

lifetimePointsint64 stringlifetime_points

Every point ever earned, bonuses included.

birthdaystring

"MM-DD" or "YYYY-MM-DD"; empty if not given. Earns the birthday bonus.

marketingOptInbooleanmarketing_opt_in

The customer agreed to hear about offers.

cardTokenstringcard_token

The private part of the customer's loyalty card link. Output only.

PointsEvent

holygrail.customers.v1.PointsEvent

idstring
pointsint64 string

Positive adds points, negative takes them away.

orderIdstringorder_id

The order, for earned and redeemed points.

orderNumberstringorder_number
reasonstring
createdAtstringcreated_at

LoyaltyProgram

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

idstring
enabledboolean
spendPerPointint64 stringspend_per_point

One point for every this much spent before tax, e.g. 100 for $1.

rewardPointsint64 stringreward_points

The standard reward, offered when rewards is empty: it costs this many points...

rewardValueint64 stringreward_value

...and takes this much off an order.

namestring

The program's name on receipts, the member card and the register: "Mama Lishe Rewards". Empty means "Rewards".

welcomePointsint64 stringwelcome_points

Points given once when a customer joins.

birthdayPointsint64 stringbirthday_points

Points given once a year on the customer's birthday.

expiryMonthsintegerexpiry_months

Points lapse after this many months without a visit; 0 keeps them.

tierWindowMonthsintegertier_window_months

Tiers count spend over this many months; 0 counts every sale.

Lowest first by min_spend.

colorstring

A hex accent for the member card, e.g. "#0F766E".

LoyaltyDay

holygrail.customers.v1.LoyaltyDay

datestring

YYYY-MM-DD in the request's zone.

pointsEarnedint64 stringpoints_earned
pointsRedeemedint64 stringpoints_redeemed
memberSalesint64 stringmember_sales

TierCount

holygrail.customers.v1.TierCount

tierIdstringtier_id

Empty for members below every tier.

namestring
membersinteger

RewardUse

holygrail.customers.v1.RewardUse

rewardIdstringreward_id
namestring
redemptionsinteger
pointsint64 string
valueint64 string

TopMember

holygrail.customers.v1.TopMember

customerCustomer
spentint64 string
visitsinteger

LoyaltyTier

holygrail.customers.v1.LoyaltyTier

A level customers reach by spending: Silver, Gold. Higher tiers earn faster.

idstring

Client-chosen UUID, kept when the tier is renamed.

namestring
minSpendint64 stringmin_spend

Spend before tax over the tier window that reaches the tier. The lowest tier usually has 0.

earnMultiplierBpintegerearn_multiplier_bp

Points earned are multiplied by this, in basis points: 15000 is 1.5×.

perksstring

What members get, shown on the register and the member card.

colorstring

LoyaltyReward

holygrail.customers.v1.LoyaltyReward

Something a member can spend points on.

idstring
namestring
descriptionstring
pointsint64 string
valueint64 string
maxValueint64 stringmax_value
variantIdsstring[]variant_ids
minTierIdstringmin_tier_id

Only members at this tier or above; empty for everyone.

archivedboolean

LoyaltyCampaign

holygrail.customers.v1.LoyaltyCampaign

A promotion that earns extra points while it runs.

idstring
namestring
multiplierBpintegermultiplier_bp
bonusPointsint64 stringbonus_points
startsOnstringstarts_on

Dates at the sale's location, inclusive; empty is open-ended.

endsOnstringends_on
daysOfWeekintegerdays_of_week

Days it runs, bit 0 Sunday to bit 6 Saturday; 0 is every day.

minSpendint64 stringmin_spend

Spend before tax a sale needs to qualify.

tierIdsstring[]tier_ids

Only members of these tiers; empty for everyone.

activeboolean

PointsKind enum

holygrail.customers.v1.PointsKind

POINTS_KIND_UNSPECIFIED
POINTS_KIND_EARNED
POINTS_KIND_REDEEMED
POINTS_KIND_ADJUSTED
POINTS_KIND_BONUS

Welcome and birthday bonuses.

POINTS_KIND_EXPIRED

Points that lapsed after the program's expiry months without a visit.

RewardKind enum

holygrail.customers.v1.RewardKind

REWARD_KIND_UNSPECIFIED
REWARD_KIND_AMOUNT_OFF

value off the order.

REWARD_KIND_PERCENT_OFF

value basis points off the order, up to max_value if set.

REWARD_KIND_FREE_ITEM

One 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_UNSPECIFIED
CAMPAIGN_KIND_MULTIPLIER

Points earned are multiplied by multiplier_bp: double points weekends.

CAMPAIGN_KIND_BONUS

bonus_points more on each qualifying sale.

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