Skip to main content

List Promotions

curl -X GET "http://localhost:8080/api/v1/promotions?page=1&limit=10&trash=false" \
  -H "Authorization: Bearer YOUR_TOKEN"
Get a paginated list of promotions with optional trash filter.

Query Parameters

page
integer
default:"1"
Page number for pagination
limit
integer
default:"10"
Number of items per page
trash
boolean
default:"false"
Show deleted/inactive promotions when true

Roles

Accessible by: admin, manager, cashier

Create Promotion

curl -X POST "http://localhost:8080/api/v1/promotions" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Weekend Special",
    "description": "20% off on weekends",
    "scope": "ORDER",
    "discount_type": "percentage",
    "discount_value": 20,
    "max_discount_amount": 50000,
    "start_date": "2024-01-01T00:00:00Z",
    "end_date": "2024-12-31T23:59:59Z",
    "is_active": true,
    "rules": [
      {
        "rule_type": "MINIMUM_ORDER_AMOUNT",
        "rule_value": "100000",
        "description": "Minimum order 100k"
      }
    ],
    "targets": []
  }'
Create a new promotion with rules and targets.

Request Body

name
string
required
Promotion name (minimum 3 characters)
description
string
Optional description of the promotion
scope
string
required
Scope of promotion: ORDER or ITEM
discount_type
string
required
Type of discount: percentage or fixed_amount
discount_value
integer
required
Discount value (percentage 0-100, or amount in smallest currency unit)
max_discount_amount
integer
Maximum discount amount cap (for percentage discounts)
start_date
string
required
Promotion start date (ISO 8601 format)
end_date
string
required
Promotion end date (ISO 8601 format, must be after start_date)
is_active
boolean
Whether the promotion is active
rules
array
Array of promotion rules
targets
array
Array of promotion targets

Roles

Accessible by: admin, manager only

Get Promotion

curl -X GET "http://localhost:8080/api/v1/promotions/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN"
Retrieve details of a specific promotion by its ID.

Path Parameters

id
string
required
Promotion ID (UUID format)

Roles

Accessible by: admin, manager, cashier

Update Promotion

curl -X PUT "http://localhost:8080/api/v1/promotions/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Updated Weekend Special",
    "description": "25% off on weekends",
    "scope": "ORDER",
    "discount_type": "percentage",
    "discount_value": 25,
    "start_date": "2024-01-01T00:00:00Z",
    "end_date": "2024-12-31T23:59:59Z",
    "is_active": true,
    "rules": [],
    "targets": []
  }'
Update an existing promotion by ID. Request body is the same as Create Promotion.

Path Parameters

id
string
required
Promotion ID (UUID format)

Roles

Accessible by: admin, manager only

Delete Promotion

curl -X DELETE "http://localhost:8080/api/v1/promotions/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN"
Soft delete a promotion by its ID.

Path Parameters

id
string
required
Promotion ID (UUID format)

Roles

Accessible by: admin, manager only

Restore Promotion

curl -X POST "http://localhost:8080/api/v1/promotions/550e8400-e29b-41d4-a716-446655440000/restore" \
  -H "Authorization: Bearer YOUR_TOKEN"
Restore a soft-deleted promotion by its ID.

Path Parameters

id
string
required
Promotion ID (UUID format)

Roles

Accessible by: admin, manager only

Build docs developers (and LLMs) love