API - Planyo Web Services - list_coupon_types

Sie sind hier: Planyo » Hilfe » API » list_coupon_types

list_coupon_types

Description:

Lists coupons (coupon definitions) that can be purchased for your site.

Input:

resource_id int optional
If you specify resource ID only coupons which can be used for this resource will be listed.
include_unpublished bool optional
When true, unpublished coupons will be included in the results.
method string required
must be set to list_coupon_types
language string optional
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 string required
your API key - Click here to get your key. If your API key uses a hash key, you must also include the parameters hash_key and hash_timestamp.

Output:

results array
Array whose items are named arrays with the following keys:
coupon_id int
ID of the existing coupon definition for the site.
type int
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.
type_pretty string
Pretty name of the coupon type.
label string
The coupon label as entered on the Create coupons page.
currency string
Your site's currency.
amount int
The coupon's amount. Depending on the coupon type, this can be: prepaid amount, number of hours, number of entries or number of days.
amount pretty string
The text representing the coupon's amount. E.g. $120, 25 hours, 5 entries, 30 days or 30 day (10%).
price float
The coupon price.
resource_ids string
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.
is_personal bool
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.
discount_amount int
For the Discount valid for given number of days type, this is the discount value in percent.
entry_per_person bool
The Number of entries coupon only. When true, one entry is counted per person. Otherwise, one entry is counted per reservation.
validity_limit_days int
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 bool
The Prepaid amount, Number of hours and Number of entries coupons only. Returned only when the coupon usage is time limited. 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 string
The Prepaid amount, Number of hours and Number of entries coupons only. Returned only when the coupon usage is time limited. 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.
access_type string
Determines how the customer will access the coupon. If empty, 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.
unpublished bool
Set to true when the coupon is unpublished.

API playground:

Click here to test this function in the API playground.