Skip to content

Latest commit

 

History

History
79 lines (65 loc) · 2.42 KB

File metadata and controls

79 lines (65 loc) · 2.42 KB
title Coupons
nav_order 10

Attributes

NameTypeDescription
idIntegerAutomatically set
created_atDatetimeAutomatically set
updated_atDatetimeAutomatically set
titleStringRequired
codeStringRequired
value_typeStringValues: percentage or amount.
valueIntegerRequired
valid_fromDatetime
valid_untilDatetime
activeBoolean
applies_toObject
allowed_booking_start_atDatetime
allowed_booking_end_atDatetime
min_order_amountDecimal
max_order_amountDecimal
availabilityIntegerWill decrease when used
min_countInteger
max_countInteger
custom_dataArrayNot 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}.