API - Planyo Web Services - list_coupons

Sie sind hier: Planyo » Hilfe » API » list_coupons



Lists the purchased coupons. You can specify a number of parameters to filter the results.


resource_id int optional
If you specify resource ID only coupons which can be used for this resource will be listed.
site_id int optional
Setting site_id and not specifying any resource_id will list coupons compatible with multiple resources. If your api key is valid for a single site, you can leave this empty.
coupon_code string optional
You can enter a coupon code if you want to list only coupons with this code.
email string optional
You can enter an email address if you want to list only coupons purchased for this email address.
check_if_valid bool optional
If true, only coupons which can still be used are returned. This basically checks if the amount is greater than 0 and for the 'valid for given number of days' coupon type, the valid-until date is checked against the rental_time parameter (only if passed)
include_reservations bool optional
If true, all reservations for which given coupon was used will be returned in the results
rental_time DateTime optional
If passed AND if check_if_valid is true, only coupons which can still be used at the time passed in this parameter will be returned. Please note that Planyo checks if the rental's end time lies within the coupon's validity date.
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.


results array
Array whose items are named arrays with the following keys: id, resource_id, email, type (1=prepaid amount, 2=number of hours, 3=number of entries, 4=valid for given number of days), amount_left, is_personal, personal_usage, coupon_code, purchase_date, entry_per_person (used only with the number of entries coupon type; if set to 1, then each person in the reservation uses up one entry). If include_reservations is set to true, a list of reservation IDs will be returned in the key reservations.

API playground:

Click here to test this function in the API playground.