Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Panahashi/llms.txt

Use this file to discover all available pages before exploring further.

Loyalty cards track the stamps a user earns at each bakery. Each completed order earns stamps, and once the threshold is reached the user receives a free item reward. All loyalty endpoints require Firebase authentication. Active promotions for a bakery can be fetched without authentication via the promotions endpoint documented below.
Loyalty endpoints require an Authorization: Bearer <token> header. Calls made without a valid Firebase token will be rejected.

GET /loyalty — fetchMyLoyaltyCards()

Returns all loyalty cards belonging to the authenticated user, one per bakery.

Response fields

id
string
Unique loyalty card identifier.
bakeryId
string
ID of the bakery this card is associated with.
stamps
number
Current number of stamps on the card.
stampsForReward
number
Number of stamps required to earn one free-item reward.
freeItemsAvailable
number
Number of unredeemed free-item rewards currently available.
totalRewardsEarned
number
Cumulative rewards earned on this card since it was created.

Example

import { fetchMyLoyaltyCards } from './services/api';

const cards = await fetchMyLoyaltyCards();

GET /loyalty/:bakeryId — fetchLoyaltyCard(bakeryId)

Returns the loyalty card for a specific bakery, for the authenticated user.

Request parameters

bakeryId
string
required
ID of the bakery whose loyalty card you want to retrieve.

Response fields

Returns a single loyalty card object with the same shape as an entry from fetchMyLoyaltyCards().

Example

import { fetchLoyaltyCard } from './services/api';

const card = await fetchLoyaltyCard('bakery-id-123');

GET /promotions?bakeryId= — fetchPromotions(bakeryId)

Returns the active promotions for a given bakery. No authentication required.
This endpoint is public. No Authorization header is needed.

Request parameters

bakeryId
string
required
ID of the bakery whose active promotions you want to list.

Response fields

Returns an array of promotion objects. Each promotion can be referenced by its ID when creating an order via createOrder({ promotionId }).

Example

import { fetchPromotions } from './services/api';

const promos = await fetchPromotions('bakery-id-123');

Build docs developers (and LLMs) love