Skip to main content

Setting up events

Creating events

An event is created through the /location endpoint rather than the /event endpoint. This ensures that an event is only created when a valid location is available. The location created in the previous section can be used for this purpose. The following information is required:

  • locationGUID: GUID of the location where the event will take place.
  • name: the name for the event.
  • type: the type of the event. This is legacy, but still needs to be provided. Possible values are once or recurring.
  • locale: the locale used for the event, for example, NL_nl.
  • currency: the currency used for the event, for example, EUR.

It is also possible to add the following information to the request:

  • start: the start date and time of the event, in standard date-time format with time zone.
  • end: the end date and time of the event, in standard date-time format with time zone.

More information can be added to an event later, as described in updating an event. Using this information, create a POST request to

https://api.weeztix.com/location/:locationGUID/event. See the following code blocks for examples of such requests and the expected response to the requests.

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => [
"name" => "Festival",
"type" => "once",
"currency" => "EUR",
"locale" => "nl_NL"
],
CURLOPT_URL => "https://api.weeztix.com/location/$locationGUID/event"
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
Response
{
"status": "normal",
"name": "Festival",
"type": "once",
"currency": "EUR",
"locale": "nl_NL",
"location_id": "157f3024-20ff-4353-859d-22ee5bc6b791",
"company_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"guid": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"updated_at": "2023-10-02T13:07:43+02:00",
"created_at": "2023-10-02T13:07:43+02:00"
}

The start and end fields indicate the beginning and ending dates of an event. When selling tickets for this event, these times determine when entry is permitted. For situations requiring more precise control over start and end times, event dates should be used. When using eventDate resources, the start and end fields for the overall event convey the communicated start and end dates. Meanwhile, each eventDate resource specifies the actual entry times for attendees. If an event does not have defined start and end times, these values will be inferred from the associated eventDate resources whenever possible.

Getting events

After you created an event, you can retrieve the information stored in this resource. To do this, make a GET request to https://api.weeztix.com/event/:GUID. You can also make a GET request to

https://api.weeztix.com/event to list all event resources currently stored in the Weeztix system.

Updating an event

The response to the GET request shows the information of the created event. After its creation, you can add additional information to or update existing information of the event. You can, for example, update the following information:

  • description: a description for the event.
  • start: the start date and time of the event, in standard date-time form with time zone.
  • end: the end date and time of the event, in standard date-time form with time zone.

If you want to update information of a specific event, you need its unique identifier:

  • GUID: the GUID of the event.

Use the unique identifier to make a PUT-request to

https://api.weeztix.com/event/:GUID. The payload of the request should contain the information that needs to be updated. Any information that can be associated with an event but that is not contained in the payload is left unchanged. See the following code blocks for examples of such requests and the expected response to the requests.

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => http_build_query([
"description" => "Summer festival.",
"start" => "2030-08-29T09 =>00 =>00+02 =>00",
"end" => "2030-08-30T13 =>00 =>00+02 =>00"
]),
CURLOPT_URL => "https://api.weeztix.com/event/$GUID"
]);

$response = curl_exec($curl);
curl_close($curl);

echo $response;
Response
{
"guid": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"company_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"location_id": "157f3024-20ff-4353-859d-22ee5bc6b791",
"payout_profile_id": null,
"event_refund_setting_id": null,
"name": "Festival",
"description": "Summer festival.",
"start": "2030-08-29T09:00:00+02:00",
"end": "2030-08-30T13:00:00+02:00",
"email_info": null,
"gui_mode": null,
"type": "once",
"status": "normal",
"visitor_contact_email": "",
"visitor_contact_phone": "",
"visitor_contact_url": "",
"contact_name": "",
"contact_email": "",
"contact_phone": "",
"website": "https://www.example.com",
"locale": "en_GB",
"currency": "GBP",
"category": "other",
"subcategories": [
"other"
],
"auto_prune": true,
"retrievable_after": null,
"created_at": "2023-10-02T13:07:43+02:00",
"updated_at": "2023-10-02T13:08:21+02:00"
}