Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/AndrewwCO/Pana-Baker/llms.txt

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

The Panahashi Baker backend exposes a versioned REST API that the mobile app communicates with exclusively. Every request must carry a valid Firebase ID token and the baker’s display name. All successful responses wrap their payload in a data key; the client unwraps with data.data ?? data. Errors return a plain { message } object. Understanding this contract lets you integrate with or extend the API without reading through app source code.

Base URL

https://your-backend.com/api/v1
Replace your-backend.com with the hostname of your deployed server. All paths in this reference are relative to that base URL.

Request headers

Every JSON request must include the following headers:
HeaderValueRequired
Content-Typeapplication/jsonYes (JSON bodies)
AuthorizationBearer <firebase-id-token>Yes
X-User-Name<displayName>Yes
Image upload requests use Content-Type: multipart/form-data and omit the JSON content type. See Image upload API endpoints for details.

Response envelope

All endpoints return JSON. Successful responses wrap their payload:
{
  "data": { ... }
}
The app unwraps with:
const data = await res.json();
return data.data ?? data;
Error responses return:
{
  "message": "Human-readable error description"
}

HTTP status codes

CodeMeaningApp behavior
2xxSuccessUnwraps and returns data.data ?? data
401UnauthorizedThrows Error("NO_AUTH") — triggers re-login
Other non-2xxRequest errorThrows Error(err.message | \HTTP $`)`
For authentication details and token management, see Authenticating API requests.

Resource groups

GroupEndpointsDescription
Bakery3Profile, update, open/close toggle
Orders6List, filter, status updates, QR verification
Products6CRUD, stock control, demo seed
Promotions4Discounts, happy hours, toggle active
Stats1Aggregated revenue and order metrics
Reviews1Read customer reviews for a bakery
Uploads3Product image, bakery logo, bakery banner

Pagination

The all-orders endpoint accepts page and pageSize query parameters:
GET /orders/bakery?page=1&pageSize=100
Other list endpoints return all records without pagination.

Explore by resource

Authentication

Bearer token flow, header format, and token refresh

Bakery

Get and update bakery profile; toggle open/close

Orders

List, filter, and advance orders through statuses

Products

Create, update, delete products and manage stock

Promotions

Percentage, fixed-amount, and happy-hour discounts

Statistics

Revenue, order counts, top products, and hourly breakdown

Uploads

Upload product images, bakery logo, and banner

Build docs developers (and LLMs) love