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 number for pagination
Show deleted/inactive promotions when true
Roles
Accessible by: admin, manager, cashier
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
Promotion name (minimum 3 characters)
Optional description of the promotion
Scope of promotion: ORDER or ITEM
Type of discount: percentage or fixed_amount
Discount value (percentage 0-100, or amount in smallest currency unit)
Maximum discount amount cap (for percentage discounts)
Promotion start date (ISO 8601 format)
Promotion end date (ISO 8601 format, must be after start_date)
Whether the promotion is active
Array of promotion rules
Rule type: MINIMUM_ORDER_AMOUNT, REQUIRED_PRODUCT, REQUIRED_CATEGORY, ALLOWED_PAYMENT_METHOD, ALLOWED_ORDER_TYPE
Rule value (depends on rule_type)
Optional rule description
Array of promotion targets
Target type: PRODUCT or CATEGORY
UUID of target product or category ID
Roles
Accessible by: admin, manager only
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
Promotion ID (UUID format)
Roles
Accessible by: admin, manager, cashier
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
Promotion ID (UUID format)
Roles
Accessible by: admin, manager only
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
Promotion ID (UUID format)
Roles
Accessible by: admin, manager only
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
Promotion ID (UUID format)
Roles
Accessible by: admin, manager only