Attributes
| Name | Type | Description |
|---|---|---|
| id | Integer | Automatically set |
| created_at | Datetime | Automatically set |
| updated_at | Datetime | Automatically set |
| title | String | Required |
| code | String | Required |
| value_type | String | Values: percentage or amount. |
| value | Integer | Required |
| valid_from | Datetime | |
| valid_until | Datetime | |
| active | Boolean | |
| applies_to | Object | |
| allowed_booking_start_at | Datetime | |
| allowed_booking_end_at | Datetime | |
| min_order_amount | Decimal | |
| max_order_amount | Decimal | |
| availability | Integer | Will decrease when used |
| min_count | Integer | |
| max_count | Integer | |
| custom_data | Array | Not required. |
Listing
GET /coupons will return all coupons.
Response
[
{
"coupon": {
"id": 1,
"code": "SUPERWEEKND",
"value_type": "percentage",
"value": 50,
"title": "Super weekend - 50% off for first 100 customers",
"valid_from": "2024-09-11T09:30:00+02:00",
"valid_until": null,
"active": true,
"applies_to": {},
"allowed_booking_start_at": "2024-08-16T00:00:00+02:00",
"allowed_booking_end_at": "2024-08-18T00:00:00+02:00",
"min_order_amount": "50.0",
"max_order_amount": "500.0",
"availability": 100,
"min_count": null,
"max_count": null,
"custom_data": null,
"created_at": "2024-08-15T16:04:09+02:00",
"updated_at": "2024-09-04T02:00:20+02:00"
}
}
]
Get coupon
GET /coupons/{coupon_id} will get a coupon with id {coupon_id}.
Add new coupon
POST /coupons will create a new coupon.
Update coupon
PUT /coupons/{coupon_id} will update existing coupon with id {coupon_id}.
Delete coupon
DELETE /coupons/{coupon_id} will delete existing coupon with id {coupon_id}.