API - Planyo Web Services - generate_coupon_payment_request

Vous êtes ici: Planyo » Aide » API » generate_coupon_payment_request

generate_coupon_payment_request

Description:

Use this function to add a new coupon to your site.

Input:

coupon_id int required
ID of the existing coupon definition for the site. You can find coupons valid for your site on the Create coupons page.
holder_email string required
Email address of the coupon holder.
holder_name string optional
Name of the coupon holder.
buyer_info string optional
Info about the coupon buyer.
valid_with_email bool required
If true, the coupon will be valid only with the specified email address. Note that at least one of the fields valid_with_email  and access_code needs to specified.
access_code string optional
If specified, the code the needs to be used when using the coupon. Coupon code needs to contain at least one letter and one digit and be at least 8 characters long.
first_day_of_validity string optional
Choose when the coupon validity should start. Leave it empty if it should start today. For example, you can have the coupon valid for 7 days, starting next Friday. E.g '2015-10-25'.
feedback_url string optional
The url of the page on your website where you embedded the Planyo module/plugin. This will be used to create the url to the coupon payment form. If not specified, the value of the URL of the reservation page on your website entered on Settings / Integrate with my website / Integration settings will be used. If this is also empty, then the url of the Simple integration with template page on our domain will be used.
method string required
must be set to generate_coupon_payment_request
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:

coupon_id int
ID of the existing coupon definition, as passed to this function.
price float
Price of the coupon as defined on the Create coupons page.
currency string
The currency of your site.
url string
The url to the coupon payment form. See the feedback_url parameter above for more information.

API playground:

Click here to test this function in the API playground.