Create Event Ticket Type
POST /events/:eventId/ticket-types
You can add a ticket type to an event by providing the following fields:
| Property | Type | Description |
|---|---|---|
name* | string | Name of the ticket type |
description | string | Description of the ticket type, as plain text (unlike an event's, which is rich text). May be null |
masterLanguage | string | The language name and description are written in, as a lowercase ISO 639-1 code. Defaults to the event's language |
translations | array of EventTicketTypeTranslation | The ticket type in other languages, each as { "language": "da", "name": "…", "description": "…" }. name and description may be null |
price | number | The price of one ticket in the smallest unit of your currency, such as cents for EUR or øre for DKK: 15000 is 150.00. A whole number of 0 or more. 0 or null, the default, is free |
maxQuantity | number | The most tickets of this type: a whole number of 1 or more. null, the default, is no limit of its own, so the ticket type shares the event's places (maxTickets) |
addOn | boolean | Whether the ticket type is an add-on, which can't be used as admittance to the event. Defaults to false |
published | boolean | Whether the ticket type is publicly visible. Defaults to true |
Like a ticket type created in the back office, it is sold online and in the point of sale, gets your museum's default VAT for event tickets, and comes after the event's other ticket types. The response is the Event Ticket Type, the same object List Event Ticket Types returns.
To add a ticket type to the event 5c1f8e2a-3b4d-4e6f-9a7b-8c9d0e1f2a3b, send POST /events/5c1f8e2a-3b4d-4e6f-9a7b-8c9d0e1f2a3b/ticket-types with:
{ "name": "Adult", "description": "Ages 18 and up", "translations": [ { "language": "da", "name": "Voksen", "description": "Fra 18 år" } ], "price": 15000, "maxQuantity": 100 }
Response:
{ "id": "e3a1c9f4-7b2d-4c8e-a5f6-1d2e3f4a5b6c", "name": "Adult", "description": "Ages 18 and up", "price": 15000, "masterLanguage": "en", "translations": [ { "language": "da", "name": "Voksen", "description": "Fra 18 år" } ], "maxQuantity": 100, "availableQuantity": 100, "soldOut": false, "addOn": false, "published": true, "numberOfIssuedTickets": 0, "totalNumberOfReservedTickets": 0, "remainingTickets": 100 }
Series
In a series, ticket types belong to the main event: create them there, and they are copied to each of its dates, also to dates added later. Each copy has its own id and counts its own tickets: List Event Ticket Types on a date shows them. Creating a ticket type on a date gives SET_ON_MAIN_EVENT.
Errors
Errors are returned as { "errors": [{ "message": "EVENT_TICKET_TYPE_NAME_REQUIRED" }] }.
| Status | Message | When |
|---|---|---|
400 | EVENT_TICKET_TYPE_NAME_REQUIRED | name is missing or blank |
400 | EVENT_TICKET_TYPE_INVALID_PRICE | price is below 0 |
400 | EVENT_TICKET_TYPE_INVALID_MAX_QUANTITY | maxQuantity is below 1 |
400 | SET_ON_MAIN_EVENT | The event is a date in a series: create the ticket type on its main event |
400 | LANGUAGE_NOT_SUPPORTED | masterLanguage or the language of a translation isn't a language Loby supports |
400 | FIELD_NOT_ALLOWED: <field> | The body holds a field that isn't listed above. For a field in a translation, <field> is translations.<field> |
400 | INVALID_BODY | The body isn't a JSON object, a translation has no language, a field has the wrong JSON type (price and maxQuantity are whole numbers), or a field that may not be null is null |
403 | NO_ACCESS | Your API key may not create ticket types |
404 | EVENT_NOT_FOUND | The event in the path doesn't exist, was deleted, belongs to another museum, or has the other mode (live or test) than your API key |