API Playground - create_voucher

create_voucher


Use this function to create a new voucher. Vouchers can be limited to a metasite, to a single site, or to specific resources. Other settings correspond to the settings from the backend UI. (click for full documentation)

quantity

Maximum number of reservations which can use the voucher

voucher_code_prefix

Voucher code. Depending on the parameter unique_codes, this is the entire code or the prefix followed by digits. Voucher code can only include alphanumeric characters, dash and underscore characters

discount_value

Voucher discount. It can be expressed in percent (e.g. 20%) or as a fixed discount (e.g. 20.00)

reservation_start_time

First day of validity (meaning, the time when a reservation using the voucher can be entered into the system)

reservation_end_time

Last day of validity (after this date, reservations entered into the system can no longer use the voucher)

voucher_title

Voucher description/title, can be left empty.

rental_start_time

If rental_start_time and rental_end_time are set, reservations using the voucher must have the rental duration between these two dates. E.g. this could be used for a stay during a specific holiday.

rental_end_time

If rental_start_time and rental_end_time are set, reservations using the voucher must have the rental duration between these two dates. E.g. this could be used for a stay during a specific holiday.

site_id

Used only with metasite API keys. If used, the voucher will be usable only with the specified Planyo site ID

resources

Comma-separated resource IDs for which the voucher can be used. If not set, the voucher will be usable for all resources of a site or metasite

non_combinable

If set to true, customers will not be able to combine this voucher with other vouchers

is_one_per_customer

If set to true, then a single customer cannot use this voucher more than once

include_products

If set to true, the voucher expressed in percent will also apply to additional products being reserved

unique_codes

One of the following values: sequential, codes2, codes3, codes4, codes5, codes6, or not passed at all. If set, the voucher codes will have a numerical suffix at the end. For sequential, it will be simply the voucher number (e.g. ABC1, ABC2, ABC3 etc). If one of the codesX values, there will be an X-digit checksum at the end of the suffix. This is so that your customers cannot guess a second voucher code based on a voucher code given to them.

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

* - Pflichtfeld