ResytechResytech Docs

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

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.

getWaiver

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

ParameterTypeRequiredDescription
locationUuidstringYesLocation UUID
waiverIdstringYesWaiver ID

GetWaiverResponse

FieldTypeDescription
successbooleanWhether the request succeeded
waiverWaiverWaiver form definition

Waiver

FieldTypeDescription
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

WaiverTheme

FieldTypeDescription
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

getReservation

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);
}

GetReservationRequest

FieldTypeRequiredDescription
lidstringYesLocation UUID
widstringYesWaiver ID
typestringNoLookup type (e.g., "confirmation")
valuestringNoLookup value (e.g., confirmation number)

GetReservationResponse

FieldTypeDescription
successbooleanWhether the lookup succeeded
idstringReservation ID
datestringBooking date
customerNamestringCustomer name
customerEmailstringCustomer email
customerPhonestringCustomer phone
statusstringReservation status
confirmationNumberstringConfirmation number

submitWaiver

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);
}

SubmitWaiverRequest

FieldTypeRequiredDescription
waiverIdstringYesWaiver ID
locationIdstringYesLocation UUID
waiverNamestringNoWaiver name
reservationIdstringYesReservation ID from getReservation
reservationConfirmationNumberstringYesConfirmation number
fieldsany[]YesCompleted form fields
submittedAtstringYesISO timestamp of submission
dataHashstringYesSHA-256 hash of field data for integrity
bfpstringYesBrowser fingerprint for fraud prevention

SubmitWaiverResponse

FieldTypeDescription
successbooleanWhether submission succeeded
submissionIdstringUnique submission ID
submittedAtDateServer-recorded submission time
confirmationNumberstringWaiver confirmation number

Full Waiver Example

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);
  }
}

Surveys

Post-booking surveys let operators collect feedback. Surveys are accessed via a unique token sent to the customer (typically via email).

getSurvey

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

ParameterTypeRequiredDescription
tokenstringYesSurvey access token (URL-encoded automatically)

GetPublicSurveyResponse

FieldTypeDescription
successbooleanWhether the request succeeded
surveyPublicSurveySurvey definition
bookingContextPublicBookingContextCustomer and booking info
brandingBrandingOperator branding and colors

PublicSurvey

FieldTypeDescription
idstringSurvey identifier
namestringSurvey title
descriptionstringSurvey description
questionsSurveyQuestion[]List of questions
thankYouMessagestringMessage shown after submission

SurveyQuestion

FieldTypeDescription
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)

SurveyQuestionOption

FieldTypeDescription
idstringOption identifier
labelstringOption text
ordernumberDisplay order

PublicBookingContext

FieldTypeDescription
customerNamestringCustomer name
customerEmailstringCustomer email
confirmationCodestringBooking confirmation code
bookingDatestringBooking date

Branding

FieldTypeDescription
companyNamestringCompany name
logoUrlstringLogo image URL
locationNamestringLocation name
primaryColorstringPrimary brand color
secondaryColorstringSecondary color
accentColorstringAccent color
backgroundColorstringBackground color
cardBackgroundColorstringCard background
cardTextColorstringCard text color
headerTextColorstringHeader text color

submitSurvey

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);
}

SubmitSurveyRequest

FieldTypeRequiredDescription
tokenstringNoSurvey access token
responsesRecord<string, any>NoMap of question ID to answer value
namestringNoRespondent name
emailstringNoRespondent email

SubmitSurveyResponse

FieldTypeDescription
successbooleanWhether submission succeeded
thankYouMessagestringThank-you message to display

Full Survey Example

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);
}

On this page