TicketsAPI

new TicketsAPI(rest)

This class is used to interact with Tickets in TidyHQ.
Parameters:
NameTypeDescription
restRestThe rest instance to use for requests.

Methods

(async) createTicket(event_id, name, optionsopt) → {Promise.<TidyAPI_V1_Ticket>}

Create a ticket category for an event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
namestringThe name for the type of ticket.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
amountnumber<optional>
The amount for the ticket. Default is 0.00 and is for free tickets.
initial_quantitynumber<optional>
Limit the number of tickets available. Default is null and is for unlimited.
maximum_purchasenumber<optional>
Limit the number of tickets per purchase.
sales_endstring<optional>
The date in ISO 8601 format for sales to end. Default is null and is for no end date.
Returns:
- The newly created ticket.
Type: 
Promise.<TidyAPI_V1_Ticket>

(async) deleteTicket(event_id, ticket_id, optionsopt) → {Promise.<TidyAPI_Response>}

Delete a ticket category for an event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
ticket_idstringThe ID of the ticket.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- Whether or not the ticket was deleted.
Type: 
Promise.<TidyAPI_Response>

(async) getSoldTickets(event_id, optionsopt) → {Promise.<TidyAPI_V1_SoldTickets>}

Get a list of all sold tickets from an event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The list of sold tickets.
Type: 
Promise.<TidyAPI_V1_SoldTickets>

(async) getTicket(event_id, ticket_id, optionsopt) → {Promise.<TidyAPI_V1_Ticket>}

Get a list of all tickets from an event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
ticket_idstringThe ID of the ticket.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The ticket.
Type: 
Promise.<TidyAPI_V1_Ticket>

(async) getTickets(event_id, optionsopt) → {Promise.<TidyAPI_V1_Tickets>}

Get a list of all tickets from an event.
Parameters:
NameTypeAttributesDefaultDescription
event_idnumberThe ID of the event.
optionsobject<optional>
{}
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
Returns:
- The list of tickets.
Type: 
Promise.<TidyAPI_V1_Tickets>

(async) updateTicket(event_id, ticket_id, optionsopt) → {Promise.<TidyAPI_V1_Ticket>}

Update a ticket category for an event.
Parameters:
NameTypeAttributesDescription
event_idnumberThe ID of the event.
ticket_idstringThe ID of the ticket.
optionsObject<optional>
The options for the ticket. At least one option is required that isn't the access token.
Properties
NameTypeAttributesDescription
access_tokenstring<optional>
The access token to use.
namestring<optional>
The name for the type of ticket.
amountnumber<optional>
The amount for the ticket.
initial_quantitynumber<optional>
Limit the number of tickets available.
maximum_purchasenumber<optional>
Limit the number of tickets per purchase.
sales_endstring<optional>
The date in ISO 8601 format for sales to end.
Returns:
- The updated ticket.
Type: 
Promise.<TidyAPI_V1_Ticket>