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 aDocumentation 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.
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
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:| Header | Value | Required |
|---|---|---|
Content-Type | application/json | Yes (JSON bodies) |
Authorization | Bearer <firebase-id-token> | Yes |
X-User-Name | <displayName> | Yes |
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:HTTP status codes
| Code | Meaning | App behavior |
|---|---|---|
2xx | Success | Unwraps and returns data.data ?? data |
401 | Unauthorized | Throws Error("NO_AUTH") — triggers re-login |
| Other non-2xx | Request error | Throws Error(err.message | \HTTP $`)` |
Resource groups
| Group | Endpoints | Description |
|---|---|---|
| Bakery | 3 | Profile, update, open/close toggle |
| Orders | 6 | List, filter, status updates, QR verification |
| Products | 6 | CRUD, stock control, demo seed |
| Promotions | 4 | Discounts, happy hours, toggle active |
| Stats | 1 | Aggregated revenue and order metrics |
| Reviews | 1 | Read customer reviews for a bakery |
| Uploads | 3 | Product image, bakery logo, bakery banner |
Pagination
The all-orders endpoint acceptspage and pageSize query parameters:
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