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.

The reviews resource lets users read public reviews for any bakery and submit their own reviews for completed orders. Fetching bakery reviews is public; submitting, listing your own reviews, and checking eligibility require Firebase authentication.

GET /reviews?bakeryId= — fetchReviewsByBakery(bakeryId, page, pageSize)

Returns a paginated list of customer reviews for a specific bakery. No authentication required.
This endpoint is public. No Authorization header is needed.

Request parameters

bakeryId
string
required
ID of the bakery whose reviews you want to list.
page
number
default:"1"
Page number to retrieve. Defaults to 1.
pageSize
number
default:"20"
Number of reviews per page. Defaults to 20.

Response fields

Returns a paginated array of review objects. Each object includes at minimum:
rating
number
Star rating given by the reviewer (1–5).
comment
string
Optional written review left by the user.
user
object
Public information about the reviewer (e.g. display name).

Example

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

const reviews = await fetchReviewsByBakery('bakery-id-123', 1, 20);

GET /reviews/me — fetchMyReviews()

Returns all reviews submitted by the authenticated user.
This endpoint requires an Authorization: Bearer <token> header.

Response fields

Returns an array of review objects with the same shape as fetchReviewsByBakery(), plus orderId and bakeryId fields.

Example

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

const myReviews = await fetchMyReviews();

GET /reviews/can-review/:orderId — canReviewOrder(orderId)

Checks whether the authenticated user is eligible to leave a review for a given order. Returns true only if the order status is COMPLETED and no review has been submitted for it yet.
This endpoint requires an Authorization: Bearer <token> header.

Request parameters

orderId
string
required
ID of the order to check review eligibility for.

Response

Returns a booleantrue if the user can review this order, false if the order is not yet completed or has already been reviewed.

Example

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

const eligible = await canReviewOrder('order-id-789');
if (eligible) {
  // show review form
}

POST /reviews — createReview({...})

Submits a review for a completed order. Each order can only be reviewed once.
This endpoint requires an Authorization: Bearer <token> header.

Request parameters

orderId
string
required
ID of the order being reviewed. Must have status COMPLETED and must not have been previously reviewed.
rating
number
required
Star rating from 1 (lowest) to 5 (highest).
comment
string
Optional written review. Defaults to an empty string if omitted.

Response fields

Returns the newly created review object, including id, orderId, rating, comment, and createdAt.

Example

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

const review = await createReview({
  orderId: 'order-id-789',
  rating: 5,
  comment: 'Excellent croissants!',
});

Build docs developers (and LLMs) love