Skip to main content

Creating a waiting list

Creating a waiting list​

The previous section of the documentation describes how to create an event. In this part of the documentation, you will create a waiting list for this event.

For this, you need the following information:

  • eventGUID: GUID of the event for which the waiting list will be created.
  • companyGUID: GUID of the company for which the waiting list will be created.
  • type: the type of behavior the waiting list has and when it should be shown

When created a waiting list has its property enabled set to false by default.

Also the waiting list has a type, this will determine when it should show up in the shop of the event:

  1. one_or_more_tickets_sold_out
  2. all_tickets_sold_out
  3. show_always

The combination of the enabled and type properties mean the waiting list can have four distinct states:

  1. Disabled: the waiting list will not return when fetched and will never be shown to a customer
  2. Show when one or more tickets are sold-out - a customer should only be able to signup when one or more tickets are sold out
  3. Show when all tickets sold-out - a customer should only be able to signup when all tickets are sold out
  4. Show always - a customer should always be able to signup

First, use the required information to create a POST request to https://waiting_list_api.weeztix.com/waiting_list. 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 => [
"company_id" => "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id" => "68096ad5-2eb7-45fb-977d-931b3485fe30",
"type" => "one_or_more_tickets_sold_out"
],
CURLOPT_URL => "https://waiting_list_api.weeztix.com/waiting_list"
]);

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

echo $response;
Response
[
{
"guid": "1b3760ca-c999-4b24-8e51-ea4ab4552957",
"company_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"enabled": true,
"allow_quantity": false,
"allow_reseller_ticketswap": false,
"allow_reseller_tixel": false,
"type": "one_or_more_tickets_sold_out",
"created_at": "2023-10-02T13:19:32+02:00",
"updated_at": "2023-10-02T13:19:32+02:00",
"deleted_at": null
}
]

Getting waiting list​

After you have created a waiting list, you can retrieve the information stored in this resource. To do this, make a GET request to https://waiting_list_api.weeztix.com/waiting_list/:GUID. You can also make a GET request to https://waiting_list_api.weeztix.com/waiting_list to list all ticket resources currently stored in the Weeztix system.

Getting a waiting list from event​

To simplify retrieving a waiting list for a certain event you need the following information:

  • eventGUID: the GUID of an event.

This is a public route that will treat a disabled waiting list as non existent and return a 404.

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_URL => "https://waiting_list_api.weeztix.com/event/$eventGUID/waiting_list"
]);

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

echo $response;
Response
[
{
"guid": "1b3760ca-c999-4b24-8e51-ea4ab4552957",
"company_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"enabled": true,
"allow_quantity": false,
"allow_reseller_ticketswap": false,
"allow_reseller_tixel": false,
"type": "one_or_more_tickets_sold_out",
"created_at": "2023-10-02T13:19:32+02:00",
"updated_at": "2023-10-02T13:19:32+02:00",
"deleted_at": null
}
]

Updating a waiting list​

To update a waiting list, you need to following information:

  • GUID: the GUID of the waiting list.

Use the required information to make a PUT request to

https://api.weeztix.com/waiting_list/:GUID. This request should contain a payload containing the information that should be updated. Any information that can be associated with a waiting list 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. In these example request, the description and swappable of a ticket are updated.

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer $accessToken"
],
CURLOPT_POSTFIELDS => http_build_query([
"type" => "show_always",
"allow_quantity" => true
]),
CURLOPT_URL => "https://api.weeztix.com/waiting_list/$GUID"
]);

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

echo $response;
Response
{
"guid": "1b3760ca-c999-4b24-8e51-ea4ab4552957",
"company_id": "d0a3f370-cd43-11ed-9c9c-bbcffde24a48",
"event_id": "68096ad5-2eb7-45fb-977d-931b3485fe30",
"enabled": false,
"allow_quantity": true,
"allow_reseller_ticketswap": false,
"allow_reseller_tixel": false,
"type": "show_always",
"created_at": "2023-10-02T13:19:32+02:00",
"updated_at": "2023-10-02T13:19:32+02:00",
"deleted_at": null
}