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.

All cart endpoints require Firebase authentication. The cart is associated with the logged-in user and persists across sessions. Each user may have at most one active cart at a time, and all items in a cart must belong to the same bakery.
Every cart endpoint requires an Authorization: Bearer <token> header. Calls made without a valid Firebase token will be rejected.

GET /cart — fetchCart()

Returns the current user’s cart, including all items and the associated bakery.

Response fields

bakeryId
string
ID of the bakery all cart items belong to.
bakeryName
string
Display name of the bakery.
items
object[]
Array of items currently in the cart.

Example

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

const cart = await fetchCart();

POST /cart/items — addToCartApi(bakeryId, productId, qty)

Adds a product to the cart, or increments its quantity if already present.

Request parameters

bakeryId
string
required
ID of the bakery the product belongs to. All items in a cart must share the same bakery.
productId
string
required
ID of the product to add.
qty
number
default:"1"
Quantity to add. Defaults to 1.

Response fields

Returns the updated cart object with the same shape as fetchCart().

Example

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

const updatedCart = await addToCartApi('bakery-id', 'product-id', 2);

PATCH /cart/items — updateCartItemApi(productId, qty)

Updates the quantity of an existing cart item. Set qty to 0 to remove the item entirely.

Request parameters

productId
string
required
ID of the product to update.
qty
number
required
New quantity for the product. Pass 0 to remove the item from the cart.
Passing qty: 0 is the preferred way to remove a single item without clearing the entire cart.

Response fields

Returns the updated cart object with the same shape as fetchCart().

Example

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

const updatedCart = await updateCartItemApi('product-id', 3);

DELETE /cart — clearCartApi()

Removes all items from the cart, leaving it empty.
This action clears every item in the cart. There is no confirmation prompt — handle this in your UI before calling.

Example

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

await clearCartApi();

Build docs developers (and LLMs) love