list_coupons (version 1)
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 required
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)
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.
version float optional
you can optionally specify the version of the API that you're using. Use the value of latest or simply skip this parameter to use the latest API version. The latest version is: 1
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
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)
Click here to test this function in the API playground.