Coupons

Update a coupon

This endpoint updates a coupon.

put/shop/coupons/{couponId}

Request body

namestring required

Internal label for the coupon, shown to staff in the admin UI and on reports. Not customer-facing; codes issued from this coupon use a separate redemption code. 1-120 characters.

descriptionstring nullable

A string to describe the coupon

valid_weekdaysstring[]

An array of weekdays which this coupon is available for use

invalid_date_set_idsstring[]

An array of IDs of DateSets describing when this coupon is not valid. The DateSet must belong to the same organisation as the coupon.

default_validity_intervalstring nullable

The default duration this coupon is valid for, as an ISO8601 string. See https://en.wikipedia.org/wiki/ISO_8601#Durations

default_multi_useboolean

The default for whether a code created from this coupon may be used multiple times

for_lead_booker_onlyboolean

Whether this coupon can only be used by the lead booker of a booking

max_usesinteger nullable

The maximum number of times this coupon can be used within the specified max uses period

max_uses_period'P1D' | 'P1W' | 'P1M' | 'P1Y' nullable

The time period for usage limits when max_uses is set. The duration is specified as an ISO8601 duration string. See https://en.wikipedia.org/wiki/ISO_8601#Durations P1D = daily limit, P1W = weekly limit, P1M = monthly limit, P1Y = yearly limit

redemption_type'manual' | 'programmatic'

The method that this coupon may be redeemed.

Example request

{
  "name": "Test coupon",
  "description": "This coupon is a test",
  "valid_weekdays": [
    "monday"
  ],
  "default_validity_interval": "P1Y",
  "default_multi_use": true,
  "max_uses": 2
}

Response

The coupon was successfully created

Example response

{
  "data": {
    "name": "Test coupon",
    "description": "This coupon is a test",
    "offering_discounts": [
      {
        "offerings": [
          {
            "offering_name": "Test offering"
          }
        ],
        "fixed_amount": 50,
        "percentage": 10
      }
    ],
    "currency": "gbp",
    "valid_weekdays": [
      "monday"
    ],
    "default_validity_interval": "P1Y",
    "default_multi_use": true,
    "for_lead_booker_only": true,
    "max_uses": 2,
    "redemption_type": "manual",
    "created_at": "2020-02-24T12:00:00+01:00",
    "updated_at": "2020-02-24T12:00:00+01:00",
    "deleted_at": "2020-02-24T12:00:00+01:00"
  }
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.