Waivers & Surveys Retrieve and submit digital waivers and post-booking surveys using the ResytechApi client.
The waiver API surface is under active development and may change. The endpoints and types documented here reflect the current implementation but are subject to breaking changes in future releases.
Waivers allow operators to collect digital signatures and liability agreements from guests before their booking. The flow is: load the waiver form, look up the reservation, then submit the signed waiver.
Retrieve a waiver form definition by location and waiver ID.
const result = await api.waiver. getWaiver ( 'location-uuid' , 'waiver-id' );
if (result.success) {
const waiver = result.waiver;
console. log ( 'Waiver:' , waiver.name);
console. log ( 'Fields:' , waiver.fields);
console. log ( 'Requires booking:' , waiver.requiresBooking);
}
Parameters
Parameter Type Required Description locationUuidstringYes Location UUID waiverIdstringYes Waiver ID
Field Type Description successbooleanWhether the request succeeded waiverWaiverWaiver form definition
Field Type Description idstringWaiver identifier namestringWaiver title fieldsanyForm field definitions (structure varies by waiver) contactEmailstringOperator contact email logoUristringCompany logo URL appendLogobooleanWhether to display the logo requiresBookingbooleanWhether a reservation lookup is required before signing themeWaiverThemeUI theme colors
Field Type Description primarystringPrimary color secondarystringSecondary color accentstringAccent color backgroundstringBackground color paperstringCard/paper background textstringText color textMutedstringMuted text color borderstringBorder color errorstringError state color successstringSuccess state color warningstringWarning state color
Look up a reservation so the guest can attach a waiver to their booking. The guest typically provides their confirmation number.
const result = await api.waiver. getReservation ({
lid: 'location-uuid' ,
wid: 'waiver-id' ,
type: 'confirmation' ,
value: 'ABC123'
});
if (result.success) {
console. log ( 'Reservation found:' , result.confirmationNumber);
console. log ( 'Customer:' , result.customerName);
console. log ( 'Date:' , result.date);
}
Field Type Required Description lidstringYes Location UUID widstringYes Waiver ID typestringNo Lookup type (e.g., "confirmation") valuestringNo Lookup value (e.g., confirmation number)
Field Type Description successbooleanWhether the lookup succeeded idstringReservation ID datestringBooking date customerNamestringCustomer name customerEmailstringCustomer email customerPhonestringCustomer phone statusstringReservation status confirmationNumberstringConfirmation number
Submit a completed waiver with all filled-in fields, a timestamp, and an integrity hash.
const result = await api.waiver. submitWaiver ({
waiverId: 'waiver-id' ,
locationId: 'location-uuid' ,
waiverName: 'Liability Waiver' ,
reservationId: 'reservation-id' ,
reservationConfirmationNumber: 'ABC123' ,
fields: [
{ fieldId: 'full_name' , value: 'Jane Smith' },
{ fieldId: 'signature' , value: 'data:image/png;base64,...' },
{ fieldId: 'agreed' , value: true }
],
submittedAt: new Date (). toISOString (),
dataHash: 'sha256-hash-of-field-data' ,
bfp: 'browser-fingerprint'
});
if (result.success) {
console. log ( 'Waiver submitted:' , result.submissionId);
console. log ( 'Confirmation:' , result.confirmationNumber);
}
Field Type Required Description waiverIdstringYes Waiver ID locationIdstringYes Location UUID waiverNamestringNo Waiver name reservationIdstringYes Reservation ID from getReservation reservationConfirmationNumberstringYes Confirmation number fieldsany[]Yes Completed form fields submittedAtstringYes ISO timestamp of submission dataHashstringYes SHA-256 hash of field data for integrity bfpstringYes Browser fingerprint for fraud prevention
Field Type Description successbooleanWhether submission succeeded submissionIdstringUnique submission ID submittedAtDateServer-recorded submission time confirmationNumberstringWaiver confirmation number
const api = new ResytechApi ();
await api.initialization. initialize ({ identifier: 'waiver-session' });
const locationUuid = 'location-uuid' ;
const waiverId = 'waiver-id' ;
// 1. Load the waiver form
const waiverResult = await api.waiver. getWaiver (locationUuid, waiverId);
if ( ! waiverResult.success) {
console. error ( 'Failed to load waiver:' , waiverResult.message);
return ;
}
const waiver = waiverResult.waiver;
console. log ( 'Rendering waiver:' , waiver.name);
// Render waiver.fields to your UI...
// 2. Look up reservation (if required)
if (waiver.requiresBooking) {
const reservation = await api.waiver. getReservation ({
lid: locationUuid,
wid: waiverId,
type: 'confirmation' ,
value: 'ABC123' // from user input
});
if ( ! reservation.success) {
console. error ( 'Reservation not found' );
return ;
}
console. log ( 'Found reservation for:' , reservation.customerName);
// 3. Submit the signed waiver
const fieldData = [
{ fieldId: 'full_name' , value: 'Jane Smith' },
{ fieldId: 'signature' , value: 'base64-signature-data' },
{ fieldId: 'agreed' , value: true }
];
const submission = await api.waiver. submitWaiver ({
waiverId: waiverId,
locationId: locationUuid,
waiverName: waiver.name,
reservationId: reservation.id,
reservationConfirmationNumber: reservation.confirmationNumber,
fields: fieldData,
submittedAt: new Date (). toISOString (),
dataHash: await computeSha256 ( JSON . stringify (fieldData)),
bfp: getBrowserFingerprint ()
});
if (submission.success) {
console. log ( 'Waiver signed! Confirmation:' , submission.confirmationNumber);
}
}
Post-booking surveys let operators collect feedback. Surveys are accessed via a unique token sent to the customer (typically via email).
Retrieve a survey by its access token. The response includes the survey definition, booking context, and operator branding.
const result = await api.survey. getSurvey ( 'survey-token-from-email' );
if (result.success) {
const survey = result.survey;
console. log ( 'Survey:' , survey.name);
console. log ( 'Questions:' , survey.questions. length );
// Booking context for personalization
const ctx = result.bookingContext;
console. log ( `Hi ${ ctx . customerName }, how was your ${ ctx . bookingDate } trip?` );
// Operator branding for styling
console. log ( 'Logo:' , result.branding.logoUrl);
}
Parameters
Parameter Type Required Description tokenstringYes Survey access token (URL-encoded automatically)
Field Type Description successbooleanWhether the request succeeded surveyPublicSurveySurvey definition bookingContextPublicBookingContextCustomer and booking info brandingBrandingOperator branding and colors
Field Type Description idstringSurvey identifier namestringSurvey title descriptionstringSurvey description questionsSurveyQuestion[]List of questions thankYouMessagestringMessage shown after submission
Field Type Description idstringQuestion identifier typestringQuestion type (e.g., "rating", "text", "select") labelstringQuestion text requiredbooleanWhether an answer is required ordernumberDisplay order maxStarsnumberMaximum stars (for rating questions) optionsSurveyQuestionOption[]Answer options (for select/choice questions)
Field Type Description idstringOption identifier labelstringOption text ordernumberDisplay order
Field Type Description customerNamestringCustomer name customerEmailstringCustomer email confirmationCodestringBooking confirmation code bookingDatestringBooking date
Field Type Description companyNamestringCompany name logoUrlstringLogo image URL locationNamestringLocation name primaryColorstringPrimary brand color secondaryColorstringSecondary color accentColorstringAccent color backgroundColorstringBackground color cardBackgroundColorstringCard background cardTextColorstringCard text color headerTextColorstringHeader text color
Submit the customer's survey responses.
const result = await api.survey. submitSurvey ({
token: 'survey-token-from-email' ,
name: 'Jane Smith' ,
email: 'jane@example.com' ,
responses: {
'question-id-1' : 5 , // star rating
'question-id-2' : 'Great!' , // text response
'question-id-3' : 'option-a' // select response
}
});
if (result.success) {
console. log (result.thankYouMessage);
}
Field Type Required Description tokenstringNo Survey access token responsesRecord<string, any>No Map of question ID to answer value namestringNo Respondent name emailstringNo Respondent email
Field Type Description successbooleanWhether submission succeeded thankYouMessagestringThank-you message to display
const api = new ResytechApi ();
// Token comes from the survey link (e.g., emailed to customer)
const token = 'eyJhbGciOiJIUzI1NiJ9...' ;
// 1. Load the survey
const surveyResult = await api.survey. getSurvey (token);
if ( ! surveyResult.success) {
console. error ( 'Survey not found or expired' );
return ;
}
const { survey , bookingContext , branding } = surveyResult;
// 2. Render the survey UI
// Use branding for colors, bookingContext for personalization
console. log ( `${ branding . companyName } - ${ survey . name }` );
console. log (survey.description);
// 3. Collect responses (from your UI)
const responses = {};
survey.questions. forEach ( q => {
switch (q.type) {
case 'rating' :
responses[q.id] = 5 ; // user's star rating
break ;
case 'text' :
responses[q.id] = 'Had a wonderful time!' ;
break ;
case 'select' :
responses[q.id] = q.options[ 0 ]?.id; // selected option
break ;
}
});
// 4. Submit
const submission = await api.survey. submitSurvey ({
token: token,
name: bookingContext.customerName,
email: bookingContext.customerEmail,
responses: responses
});
if (submission.success) {
// Show the operator's custom thank-you message
console. log (submission.thankYouMessage || survey.thankYouMessage);
}