API Playground - add_coupon_type

add_coupon_type


Adds a new coupon type. (click for full documentation)

type

The type of the coupon: 1 - Prepaid amount, 2 - Number of hours, 3 - Number of entries, 4 - Valid for given number of days, 5 - Discount valid for given number of days.

amount

The coupon's amount. Depending on the coupon type, this can be: prepaid amount, number of hours, number of entries or number of days.

price

The coupon price. Note that the currency set up in the site is used when purchasing and using coupons.

custom_currency

Leave this field unset to use the default currency of your site. If you choose a custom currency, this will be the currency used when purchasing the coupon. In case of the Prepaid amount coupon, this will be also the currency of the coupon's amount. Note that the Prepaid coupon can be used only when its currency matches the reservation currency. For example, a prepaid coupon denominated in CHF can be used only with a reservation whose price is also denominated in CHF. It will not work with a reservation using e.g. EUR.

resource_ids

The comma-separated resource IDs for which the coupon can be used. If empty, the coupon can be used will all resources of the site.

label

Optional coupon's label. The label will be visible to the customer on the coupon purchase page instead of the standard coupon description.

is_personal

When true, the coupon can be used only by a single person identified by an email address. When false, the coupon can be used with different email addresses. Defaults to 'false'.

entry_per_person

Valid for the Number of entries coupon only. When true, one entry is counted per person. Otherwise, one entry is counted per reservation.

validity_limit_days

Valid for the Prepaid amount, Number of hours and Number of entries coupons only. When the coupon usage is time limited, this is the number of days of the limit.

free_validity_limit_start_date

Valid for the Prepaid amount, Number of hours and Number of entries coupons only, when the coupon usage is time limited with validity_limit_days. The value of true means the customer can freely choose the first date of validity. Otherwise, coupon's validity always starts on the day the coupon is purchased.

validity_limit_relative_to

Valid for the Prepaid amount, Number of hours and Number of entries coupons only, when the coupon usage is time limited with validity_limit_days. For the value of rental_creation, validity will be checked against the time when a reservation is being made. For arrival_departure, validity will be checked against the reservation's arrival and departure dates. Defaults to arrival_departure.

discount_amount

For the Discount valid for given number of days type, this is the discount value in percent. Value between 0 and 100 is expected.

access_type

Determines how the customer will access the coupon. If empty (default), the customer can freely choose the access method (email, code or both). For email the customer is limited to use email address, for code the customer has to use code and for email_and_code the customer has to use both email address and code.

purchase_limit

You can limit the number of coupons of this type that your customers can purchase. For example, for 10, only up to 10 such coupons can be sold. Leave this field empty not to set any limit.

language

by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned

api_key

* - påkrevd felt