Developers Information - API & Web Services
API Method /discount_new
This method creates new discount code. It returns the ID of the newly created discount code.
Arguments
- authentication
- This method controls access via required user authentication.
- event_id integer
- The event ID. The event must have been previously created using /event_new.
- codestring
- The discount code. Spaces, apostrophes and non-alphanumeric characters are not allowed, except for dashes and underscores. Examples: "earlybirdspecial_08", "membersonly", "dc121232".
- amount_off float
- The fixed amount off the ticket price. Each discount code can have a fixed discount amount or a variable (percentage) discount amount, but not both
- percent_off float
- The percentage off the ticket price. Each discount code can have a fixed discount amount or a variable (percentage) discount amount, but not both
- tickets string
- Comma-separated list of ticket IDs for which the discount applies. If not provided, the discount will apply to all ticket types.
- quantity_availableinteger
- Maximum number of times this discount can be used. If not provided, no maximum is set.
- start_date string
- The discount start date and time, in ISO 8601 format (e.g., "2007-12-31 23:59:59").
- end_date string
- The discount end date and time, in ISO 8601 format (e.g., "2007-12-31 23:59:59").
Example Request
https://www.eventbrite.com/xml/discount_new?...&event_id=546213823534
&code=Discount_005&amount_off=10.0&start_date=2009-12-12 13:00:00&quantity=100
https://www.eventbrite.com/xml/discount_new?...&event_id=546213823534
&code=Discount_006&percent_off=15&end_date=12-0-0&quantity=100
https://www.eventbrite.com/xml/discount_new?...&event_id=546213823534
&code=Discount_007&percent_off=15&tickets=8532123,8546789
Output Parameters
This method returns XML with the following structure:
- id integer
- The discount ID.
- status string
- Processing status.
- message string
- Processing message.
Example XML Response
<?xml version="1.0" encoding="utf-8" ?> <process> <id>78658</id> <message>Discount_new : complete</message> <status>ok</status> </process>
Error Codes
This method may return these errors in an error document:
- Authentication Error
- The specified user was not found or the login credentials didn't match.
- Not found
- No such event. [1234567].
- Discount error
- Please Please enter a valid discount code.
- Discount error
- Spaces, apostrophes and non-alphanumeric characters (except "-" and "_") are not allowed.
- Discount error
- The discount code is missing or invalid.
- Date error
- The start date is invalid or in the past : required Format is (YYYY-MM-DD HH:MM:SS).
- Date error
- The end date is invalid or in the past : required Format is (YYYY-MM-DD HH:MM:SS).
- Date inconsistent
- The discount date cannot end before it starts.
- Date inconsistent
- Start discount date greater than Event's ending date.
- Date inconsistent
- End discount date greater than Event's ending date.
- Amount error
- Invalid amount off ticket price(numeric, Float).
- Percentage error
- Invalid percentage off ticket price(numeric, Float).
- Quantity error
- Invalid Quantity of discount code (numeric).
- Discount error
- Please enter either an amount or a percentage off the ticket price.
- Code error
- The discount code "xxxxx" is already in use.