Creating a New Waitlist Visit
When using the API to add a person to a Waitlist via the Visits Endpoint, the information that must be provided in the request payload is dependent on a variety of factors:
- what information is being gathered (data-fields) from a customer and what information is required
- if Services and/or Resources are in use, and if they are required
- If Party Size is being used
- If customer is new or already exists in the customer database
Below is an example of a request payload to add a new customer to the waitlist, on a location that is using Party Size as well as both Services and Resources.
POST /v2/visits
{
"locationId": "FejxZ0WWpXTjzIScVEq0",
"name": "John Doe",
"phone": "+15554443333",
"email": "[email protected]",
"partySize": 2,
"state": "WAITING",
"serviceIds": ["4B2fr4W7lu2In9NfG2HF"],
"resourceIds": ["2WOnhrVPunroHWX1B4Kh"],
"dataFields": [
{
"id": "Cu7HUgTbPvQScHE4NvCO",
"values": ["Input field answer"]
}
]
}
If no customerId has been provided and the email or phone number (if provided) cannot be matched to an existing customer, a new customer will be created and automatically generating a new unique customerId that will be listed in the response.
Here is the resulting response from the request shown above:
{
"id": "sgshK8SsLw0As2GnuPyy",
"locationId": "FejxZ0WWpXTjzIScVEq0",
"state": "WAITING",
"customerId": "8PwVvCvwMIo086KpcjQMTb",
"firstName": "John",
"lastName": "Doe",
"name": "John Doe",
"phone": "+15554443333",
"email": "[email protected]",
"publicId": "sgshK9",
"isAnonymized": false,
"created": "2023-03-07T19:55:11.708Z",
"createdBy": "RUlfUPgKD3NVd7YFIc8sYImlZIf1",
"updated": "2023-03-07T19:55:11.708Z",
"updatedBy": "RUlfUPgKD3NVd7YFIc8sYImlZIf1",
"pendingExpireTime": null,
"remoteIp": "33.222.11.000",
"country": "US",
"region": "ny",
"city": "new york",
"isBlock": false,
"source": "API",
"locale": "en-US",
"partySize": 2,
"resources": {
"2WOnhrVPunroHWX1B4Kh": 1
},
"resourceIds": [
"2WOnhrVPunroHWX1B4Kh"
],
"services": {
"4B2fr4W7lu2In9NfG2HF": 1
},
"serviceIds": [
"4B2fr4W7lu2In9NfG2HF"
],
"fields": {
"Cu7HUgTbPvQScHE4NvCO": [
"Input field answer"
]
},
"dataFields": [
{
"id": "Cu7HUgTbPvQScHE4NvCO",
"values": [
"Input field answer"
]
}
],
"tags": [],
"waitlistTime": "2023-03-07T19:55:11.708Z",
"bookingReminderSmsTime": null,
"bookingReminderEmailTime": null,
"bookingReminderAppTime": null,
"followUpSmsTime": null,
"followUpEmailTime": null,
"followUpAppTime": null,
"estWaitDuration": 0,
"position": 1,
"lastWaitingPosition": 1,
"originalPosition": 1,
"ticket": "A038",
"numVisits": 1,
"originalEstWaitDuration": 0,
"accountId": "BeixZ5HHpXSjzIScVTq2"
}
Updated over 1 year ago