Create a coupon
post
https://api.flactrum.com/v1/coupons
| Required scope | coupons.write |
| Success status | 201 |
| Returns | One Coupon object |
Request body
| Field | Type | Description |
|---|---|---|
| code * | string | Stored in upper case. |
| name * | string | — |
| description | string|null | — |
| discount_type * | string | — |
| discount_value * | number | Percentage discounts cannot exceed 100. |
| max_discount | number|null | — |
| min_order_total | number|null | — |
| starts_at | string|null | — |
| ends_at | string|null | Must be after starts_at. |
| usage_limit | integer|null | — |
| per_customer_limit | integer|null | — |
| is_active | boolean | — |
| branch_ids | array | Omit or send empty for every branch. |
Response fields
| Field | Type | Description |
|---|---|---|
| id | string | — |
| code | string | Unique within the brand, always upper case. |
| name | string | — |
| description | string|null | — |
| discount_type | string | — |
| discount_value | number | — |
| max_discount | number|null | Cap for a percentage discount. |
| discount_label | string | — |
| min_order_total | number|null | — |
| starts_at | string|null | — |
| ends_at | string|null | — |
| usage_limit | integer|null | Total redemptions allowed; null means unlimited. |
| per_customer_limit | integer|null | Redemptions per registered customer. |
| used_count | integer | Redemptions so far. Cancelling or refunding the order gives the use back. |
| is_active | boolean | — |
| is_usable | boolean | Active, within dates and not used up. |
| status | string | — |
| branch_ids | array | Empty means every branch. |
Examples
Recorded from the test suite — these are real requests and their real responses.
curl -X POST 'https://api.flactrum.com/v1/coupons' \
-H 'Authorization: Bearer flk_your_key:your_secret' \
-H 'Content-Type: application/json' \
-d '{
"code": "yaz 25",
"name": "Yaz indirimi",
"discount_type": "percent",
"discount_value": 25,
"max_discount": 50,
"min_order_total": 100,
"usage_limit": 500,
"branch_ids": [
"01m43mxvja6q201pm6zq27mesr"
]
}'
HTTP 201 · application/json
{
"data": {
"id": "01m43mxvk5z3haxsbnz1dftdm5",
"code": "YAZ25",
"name": "Yaz indirimi",
"description": null,
"discount_type": "percent",
"discount_value": 25,
"max_discount": 50,
"discount_label": "%25 (en fazla ₺50,00)",
"min_order_total": 100,
"starts_at": null,
"ends_at": null,
"usage_limit": 500,
"per_customer_limit": null,
"used_count": 0,
"is_active": true,
"is_usable": true,
"status": "Geçerli",
"branch_ids": [
"01m43mxvja6q201pm6zq27mesr"
],
"created_at": "2026-10-04T14:26:15+00:00",
"updated_at": "2026-10-04T14:26:15+00:00"
}
}