Check a coupon against the cart
post
https://api.flactrum.com/v1/kiosk/coupon
Prices the cart the same way the sale will (branch prices, campaigns, bundles) and applies the coupon to the result. Nothing is consumed here; send the same coupon_code with POST /orders, where the coupon is checked again and its use is recorded. An unusable code returns 409 with details.coupon_reason: not_found, inactive, not_started, expired, branch, min_total (with min_order_total), used_up or customer_limit. The error message is ready to show to the customer.
| Required scope | kiosk.read |
| Success status | 200 |
Request body
| Field | Type | Description |
|---|---|---|
| code * | string | As the customer typed it; case and spaces do not matter. |
| lines * | array | The cart, exactly as it will be sent to POST /orders: {product_id, quantity, addon_ids?}. |
| customer_id | string | Signed-in customer, so per-customer limits are checked. |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X POST 'https://api.flactrum.com/v1/kiosk/coupon' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"code": " hosgeldin ",
"lines": [
{
"product_id": "01m43mxvv67tk8fhd91xnck7me",
"quantity": 2
}
]
}'
HTTP 200 · application/json
{
"data": {
"code": "HOSGELDIN",
"name": "Hoş geldin",
"label": "%15 (en fazla ₺20,00)",
"subtotal": 200,
"discount": 20,
"total": 180
}
}