API Method discount_new
This method creates a new discount code for a specific event, returning the ID of the newly created discount code.
Request Parameters
| Name | description |
|---|---|
| event_id | A numeric event ID is required for each discount code. |
| code | The discount code. Spaces, apostrophes and non-alphanumeric characters are not allowed, except for dashes and underscores. Examples: “earlybirdspecial_08″, “membersonly”, “dc121232″. |
| amount_off | 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 | 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 | Comma-separated list of ticket-type IDs for which the discount applies. If not provided, the discount will apply to all ticket types for this event. |
| quantity_available | Maximum number of times this discount can be used. If not provided, no maximum is set. |
| start_date | The discount start date and time, in ISO 8601 format (e.g., “2007-12-31 23:59:59″). |
| end_date | The discount end date and time, in ISO 8601 format (e.g., “2007-12-31 23:59:59″). |
Example Request URL
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
Example Response
<?xml version="1.0" encoding="utf-8" ?> <process> <id>78658</id> <message>Discount_new : complete</message> <status>ok</status> </process>
Method-Specific Errors
More information about error-handling and common error messages are available in our error docs.
| error_type | error_message |
|---|---|
| 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. |