The Loyalty API manages per-bakery stamp cards for customers. Each customer gets a separate card for every bakery they order from. Stamps are added automatically when an order reachesDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi-Backend/llms.txt
Use this file to discover all available pages before exploring further.
COMPLETED status. Every 9 stamps earns one free item, which a baker can redeem.
LoyaltyCard object
Card ID — formatted as
{userId}_{bakeryId}.Card owner’s Firebase UID.
Bakery this card belongs to.
Current stamp count (0–8 before reward).
Stamps required for one reward. Always
9.Lifetime rewards earned.
Unclaimed free items available to redeem.
Last updated epoch ms.
GET /api/v1/loyalty
Returns all loyalty cards for the authenticated customer across all bakeries. Auth required: Yes — CUSTOMERGET /api/v1/loyalty/
Returns the customer’s loyalty card for a specific bakery. Creates the card if it doesn’t exist yet. Auth required: Yes — CUSTOMERBakery ID.
POST /api/v1/loyalty/redeem
Redeems one free item from a customer’s loyalty card for the baker’s bakery. Auth required: Yes — BAKERFirebase UID of the customer whose reward to redeem.
Returns 400 if the customer has no free items available (
freeItemsAvailable = 0).How stamps are earned
Stamps are added automatically — you don’t need to call any endpoint. When a baker marks an order asCOMPLETED (or verifies the QR), the system:
- Adds one stamp to the customer’s card for that bakery.
- If stamps reach a multiple of 9, increments
freeItemsAvailableby 1 andtotalRewardsEarnedby 1. - Sends the customer a push notification announcing their stamp progress.