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 upload endpoints accept image files via multipart/form-data and return the updated resource — either the product or the bakery — with the new image URL populated. All three endpoints use the same underlying upload mechanism: a POST with a single image form field carrying the file.

Upload mechanism

The app constructs a FormData object with one field named image, determines the MIME type from the file extension, and sends the request with Content-Type: multipart/form-data. The X-User-Name header is still required, but Content-Type: application/json is not sent on upload requests.
const formData = new FormData();
formData.append("image", { uri, name: filename, type });

fetch(`${API_BASE}${endpoint}`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${this.token}`,
    "Content-Type": "multipart/form-data",
  },
  body: formData,
});

Supported file types

ExtensionMIME type
.jpg / .jpegimage/jpeg
.pngimage/png
.webpimage/webp
Any other extension is sent as image/jpeg. The server may reject unsupported formats with a non-2xx status.

POST /upload/product/:id

Uploads a photo for a specific product. Use this after creating or editing a product to attach or replace its image.

Path parameters

id
string
required
The unique product ID. Obtain this from the response of POST /products or GET /products/my.

Request

curl -X POST https://your-backend.com/api/v1/upload/product/prd_001 \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@/path/to/photo.jpg"

Form fields

image
file
required
The image file to upload. Accepted types: image/jpeg, image/png, image/webp.

Response

Returns the updated product object with imageUrl populated.
{
  "data": {
    "id": "prd_001",
    "name": "Pan de masa madre",
    "imageUrl": "https://cdn.example.com/products/prd_001.jpg",
    ...
  }
}

Uploads a square logo image for the authenticated bakery. The app recommends a 1:1 aspect ratio.

Request

curl -X POST https://your-backend.com/api/v1/upload/bakery/logo \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@/path/to/logo.png"

Form fields

image
file
required
The logo image file. Use a square crop for best results. Accepted types: image/jpeg, image/png, image/webp.

Response

Returns the updated bakery object with logoUrl populated.
{
  "data": {
    "id": "bky_abc123",
    "logoUrl": "https://cdn.example.com/logos/bky_abc123.jpg",
    ...
  }
}

POST /upload/bakery/banner

Uploads a wide banner image for the authenticated bakery. The app uses a 16:9 aspect ratio for the banner crop.

Request

curl -X POST https://your-backend.com/api/v1/upload/bakery/banner \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: multipart/form-data" \
  -F "image=@/path/to/banner.jpg"

Form fields

image
file
required
The banner image file. Use a 16:9 crop for best results. Accepted types: image/jpeg, image/png, image/webp.

Response

Returns the updated bakery object with bannerUrl populated.
{
  "data": {
    "id": "bky_abc123",
    "bannerUrl": "https://cdn.example.com/banners/bky_abc123.jpg",
    ...
  }
}
Upload endpoints do not share the JSON error format used by other endpoints. If the upload fails, the server returns a non-2xx status and the app throws Error("Upload failed: <status>"). Ensure your server returns an appropriate HTTP status code on failure.

Build docs developers (and LLMs) love