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.

Promotions let a bakery offer discounts to customers. The API supports three promotion types: a percentage off the order total, a fixed monetary amount deducted, and a happy-hour window during which a percentage discount applies automatically. Each promotion can be enabled or disabled independently without deleting it.

Promotion types

TypeDescriptionRequired fields
PERCENTAGEApplies a percentage discount to the order totaldiscountPct
FIXED_AMOUNTDeducts a fixed amount in COP from the order totaldiscountAmount
HAPPY_HOURApplies a percentage discount during a specified time windowdiscountPct, happyHourStart, happyHourEnd

GET /promotions/me

Returns all promotions for the authenticated bakery, both active and inactive.
curl https://your-backend.com/api/v1/promotions/me \
  -H "Authorization: Bearer <token>" \
  -H "X-User-Name: María"

Response

Returns an array of promotion objects.
{
  "data": [
    {
      "id": "prm_001",
      "title": "20% en croissants",
      "description": "Válido todos los días.",
      "type": "PERCENTAGE",
      "discountPct": 20,
      "discountAmount": 0,
      "happyHourStart": "",
      "happyHourEnd": "",
      "active": true
    }
  ]
}
id
string
Unique promotion identifier.
title
string
Short display name for the promotion.
description
string
Optional longer description of the promotion.
type
string
Promotion type. One of PERCENTAGE, FIXED_AMOUNT, or HAPPY_HOUR.
discountPct
number
Percentage discount value. Used for PERCENTAGE and HAPPY_HOUR types.
discountAmount
number
Fixed discount amount in COP. Used for FIXED_AMOUNT type.
happyHourStart
string
Start time of the happy-hour window in HH:mm format. Used for HAPPY_HOUR type.
happyHourEnd
string
End time of the happy-hour window in HH:mm format. Used for HAPPY_HOUR type.
active
boolean
Whether the promotion is currently active and applied to orders.

POST /promotions

Creates a new promotion for the authenticated bakery.

Request body

{
  "title": "Happy hour mañanero",
  "description": "Descuento especial en las primeras horas.",
  "type": "HAPPY_HOUR",
  "discountPct": 15,
  "discountAmount": 0,
  "happyHourStart": "07:00",
  "happyHourEnd": "09:00"
}
title
string
required
Short display name for the promotion. The app requires this field before saving.
description
string
Optional longer description of the promotion.
type
string
required
Promotion type. One of PERCENTAGE, FIXED_AMOUNT, or HAPPY_HOUR.
discountPct
number
Percentage to discount (0–100). Required when type is PERCENTAGE or HAPPY_HOUR.
discountAmount
number
Fixed amount to deduct in COP. Required when type is FIXED_AMOUNT.
happyHourStart
string
Start of the discount window in HH:mm format. Required when type is HAPPY_HOUR.
happyHourEnd
string
End of the discount window in HH:mm format. Required when type is HAPPY_HOUR.

Response

Returns the created promotion object, including the server-assigned id and an active field reflecting the server’s default state.

PATCH /promotions/:id/toggle

Toggles the active state of a promotion. An active promotion becomes inactive, and vice versa. No request body is required.

Path parameters

id
string
required
The unique promotion ID.
curl -X PATCH https://your-backend.com/api/v1/promotions/prm_001/toggle \
  -H "Authorization: Bearer <token>" \
  -H "X-User-Name: María"

Response

Returns the updated promotion object with the new active value.
{
  "data": {
    "id": "prm_001",
    "active": false,
    ...
  }
}

DELETE /promotions/:id

Permanently deletes a promotion. This action cannot be undone.

Path parameters

id
string
required
The unique promotion ID.

Response

Returns a success indicator or the deleted promotion object. The app removes the promotion from the local list on success.
To temporarily disable a promotion without losing its configuration, use PATCH /promotions/:id/toggle to set active: false instead of deleting it.

Build docs developers (and LLMs) love