API - Planyo Web Services - generate_coupon

Sie sind hier: Planyo » Hilfe » API » generate_coupon

generate_coupon

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'.
custom_amount string optional
Allows you to override the original amount set up in the coupon definition (see coupon_id above).
method string required
must be set to generate_coupon
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:

new_amount int
Current amount on the coupon. Note that the meaning of this value depends on the coupon type.

API playground:

Click here to test this function in the API playground.