Skip to main content

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

The Products API exposes the bakery product catalog. Customers browse available products by bakery; bakers manage their full catalog including out-of-stock items.

Product object

id
string
Unique product ID.
bakeryId
string
ID of the owning bakery.
name
string
Product name.
price
number
Price in local currency.
emoji
string
Display emoji for the product (e.g. ”🥐”).
availabilityStatus
string
One of: READY_NOW, READY_IN_20, READY_IN_60, ADVANCE_ORDER_ONLY, OUT_OF_STOCK.
stock
integer
Current stock count.
category
string
Category label (e.g. “Panes”, “Pasteles”).
description
string
Product description.
imageUrl
string
Firebase Storage image URL.
available
boolean
Whether the product is available for ordering. Automatically false when stock reaches 0.
advanceMinutes
integer
Minutes of advance notice required for ADVANCE_ORDER_ONLY items.

Availability status values

StatusMeaning
READY_NOWIn stock and ready immediately
READY_IN_20Ready in approximately 20 minutes
READY_IN_60Ready in approximately 60 minutes
ADVANCE_ORDER_ONLYMust be ordered in advance
OUT_OF_STOCKTemporarily unavailable

GET /api/v1/products

Returns all available products for a bakery (available = true). Auth required: No
bakeryId
string
required
ID of the bakery to fetch products for.
curl "http://localhost:8080/api/v1/products?bakeryId=abc123"

GET /api/v1/products/

Returns a single product by ID. Auth required: Yes (any role)
id
string
required
Product ID.
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/products/prod456

GET /api/v1/products/my

Returns all products for the authenticated baker’s bakery, including out-of-stock items. Auth required: Yes — BAKER
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/products/my

GET /api/v1/products/admin/all

Returns all products across every bakery on the platform. Auth required: Yes — ADMIN
curl -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/products/admin/all

POST /api/v1/products

Creates a new product for the authenticated baker’s bakery. Auth required: Yes — BAKER
name
string
required
Product name.
price
number
required
Price.
emoji
string
required
Display emoji.
availabilityStatus
string
required
One of the availability status values.
stock
integer
required
Initial stock count.
category
string
required
Category label.
description
string
Product description.
imageUrl
string
Image URL (use the Upload API to get this).
available
boolean
Whether immediately available. Overridden to false if stock is 0.
advanceMinutes
integer
Required advance minutes for ADVANCE_ORDER_ONLY.
curl -X POST \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"name":"Croissant","price":3.5,"emoji":"🥐","availabilityStatus":"READY_NOW","stock":20,"category":"Pasteles"}' \
  http://localhost:8080/api/v1/products

PATCH /api/v1/products/

Updates a product. Baker must own the product’s bakery. Auth required: Yes — BAKER
id
string
required
Product ID.
All body fields are optional — only supplied fields are updated.

PATCH /api/v1/products//stock

Updates only the stock count. Setting stock to 0 automatically sets available = false. Auth required: Yes — BAKER
id
string
required
Product ID.
stock
integer
required
New stock count.
curl -X PATCH \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"stock":0}' \
  http://localhost:8080/api/v1/products/prod456/stock
When stock reaches 0, available is automatically set to false. Set a positive stock value to re-enable availability.

DELETE /api/v1/products/

Deletes a product. Baker must own the product’s bakery. Auth required: Yes — BAKER
id
string
required
Product ID.

POST /api/v1/products/seed

Seeds 4 sample products for the authenticated baker’s bakery. Useful for initial setup. Does nothing if the bakery already has products. Auth required: Yes — BAKER
curl -X POST \
  -H "Authorization: Bearer <token>" \
  http://localhost:8080/api/v1/products/seed

Build docs developers (and LLMs) love