Wix Rentals: Sample Flows

This article presents possible use cases and corresponding sample flows that you can support. This can be a helpful jumping off point as you plan your implementation.

Set up a rental service

Create a service that customers can book for a flexible number of hours or days. A service supports a single unit type, so create a separate service for each.

To set up a rental service:

  1. Call Create Resource Type to define the category of bookable resources, such as conference rooms. Save the resource type ID.
  2. Call Create Resource for each bookable resource, such as Room A and Room B. Set the resource type ID from step 1 and leave working hours undefined, because rental resources are available 24/7. Save each resource ID.
  3. Call Create Service, specifying the following parameters:
    • type: APPOINTMENT.
    • appId: ff5d6eb1-65e4-4f9a-8b14-64d34c12cc2e.
    • serviceResources: An array with 1 entry per resource type the service requires. Each entry sets resourceType.id to the resource type ID from step 1, and can set resourceIds.values to specific resource IDs from step 2.
    • primaryResourceType: The resource type ID from step 1. It must be 1 of the types listed in serviceResources.
    • form: Optional. To use the Wix Rentals default booking form, set { "id": "3a2ea2ce-91f4-4617-ab24-629933c0c31a" }. Installing the Wix Rentals app provisions that form on the site, and its ID is the same on every site.
    • payment.rateType: FIXED, with payment.fixed.price set to the price per unit.
    • The duration range parameters for the unit type you want, as described in the following table.
  4. Save the service ID from the response.
  5. Optionally, call Create Booking Policy to configure cancellation and rescheduling rules.

The following table shows the duration range parameters for each unit type. All parameters are nested under schedule.availabilityConstraints.durationRange:

Unit typeParametersAllowed valuesExample
HOURhourOptions.minDurationInMinutes, hourOptions.maxDurationInMinutes30 to 1440 minutes60 and 480 for 1 to 8 hours
DAYdayOptions.minDurationInDays, dayOptions.maxDurationInDays1 to 8 days1 and 5 for 1 to 5 days

The minimum must be less than or equal to the maximum.

Set up resource attributes

Define custom properties for your rental resources and display them on the public site. For example, a vacation rentals business can add Capacity (number), Bed Type (string), and Has WiFi (boolean) attributes to each room.

To set up resource attributes:

  1. Call Create Attribute Definition for each property. Specify a unique name, a valueType, type-specific configuration (stringConfig.allowedValues for strings, numberConfig.min/max for numbers), and a defaultValue. Save the returned attribute definition ID. Definitions are created once per site.
  2. Call Bulk Upsert Attribute Values with the resource ID as entityId and the list of values. Each entry is matched by attributeDefinitionId, so only the listed attributes are created or updated.
  3. To display attributes on the public site, call List Entity Attributes with the resource ID as entityId. Filter the results to attributes where attributeDefinition.visibility is true, because the API doesn't enforce visibility on the backend.

Find available rental services

Display only the rental services that a customer can book in a specified date range. This is useful for building a rental catalog page that shows only services with current availability.

To find available rental services:

  1. Call Query Services by Filters with the Wix Rentals app ID in query.filter and an availability window in serviceFilters. Specify localStartDate, localEndDate, and timeZone. Leave exactMatch unset so a service is returned when it has at least 1 bookable slot anywhere in the window.
  2. Render the returned results. Each result contains the full service entity and an available flag set to true.
  3. If the response contains pagingMetadata.cursors.next, request the next page by passing it unchanged as query.cursorPaging.cursor. Repeat until next is absent.

To also show services that have no availability in the window, set serviceFilters.includeUnavailable to true. Each unavailable service is returned with available set to false, so you can display it as greyed out. Learn more about catalog-wide availability.

Filter rental services by location and resource attributes

Narrow the rental catalog to services at a specific business location whose resources match certain attributes, such as capacity or amenities.

To filter rental services by location and attributes:

  1. Call Query Services by Filters with the Wix Rentals app ID in query.filter and the location, resource type, and attribute filters in serviceFilters. Specify locationIds with IDs from List Locations, resourceTypes with the resource type ID from Create Resource Type, and attributes entries for each attribute condition, using attribute definition IDs from Query Attribute Definitions. Values for the same attribute are "match any". Values for different attributes are "match all".
  2. Because no date range is specified, no availability check runs. All pre-filtered rental services are returned with available set to true.

You can combine these filters with a date range in serviceFilters to return only services that also have availability in a specified window. Learn more about catalog search.

Preview the price for a rental

Show the customer the estimated price for a rental before creating the booking. Because a rental's price depends on its duration, you must specify the start and end times so Wix can calculate the duration-based price.

To preview the price:

  1. Call Preview Price with a bookingLineItems entry that includes the following fields:
    • serviceId: The rental service ID.
    • resourceId: The resource ID. Required for appointment-based services.
    • localStartDate: The customer's selected start date and time, for example "2024-03-25T09:00:00".
    • localEndDate: The customer's selected end date and time, for example "2024-03-25T14:00:00".
    • timeZone: The time zone, for example "America/New_York". Required when localStartDate and localEndDate are specified.
  2. Read priceInfo.calculatedPrice from the response. For an hourly service, Wix calculates the price at per-minute granularity: the duration in minutes multiplied by the service's base price divided by 60. For a daily service, Wix multiplies the base price by the number of days.

If localStartDate, localEndDate, and timeZone aren't specified, Wix can't calculate duration-based pricing and falls back to participant-based pricing only, which charges a flat rate based on the number of participants instead of the rental's duration.

Book an hourly rental

Display the available time slots, let the customer select a start and end time, and create the booking. Learn more about hourly availability.

Part 1: Select a time slot

To let the customer select when the rental starts and ends:

  1. Call List Availability Time Slots with the serviceId, timeZone, fromLocalDate, toLocalDate, and includeResourceTypeIds with the service's resource type ID. Each slot then carries the resource to book in availableResources. Display the available start times to the customer and save the one they select.
  2. Call List Availability Time Slot End Options with the serviceId and the selected start time as localStartDate. The service's maximum duration caps the response, so you don't need to specify maxLocalEndDate. Display the available end times to the customer and save the one they select.

Part 2: Create the booking

To reserve the selected time range:

  1. Call Create Booking. Specify the slot's serviceId, scheduleId, startDate, endDate, timezone, resource, and location in booking.bookedEntity.slot, and the customer's contactDetails.
  2. Save the booking ID from the response. Wix creates the booking with status CREATED.

If the slot was taken between selection and booking, the call fails with SLOT_NOT_AVAILABLE. If the chosen duration falls outside the service's duration range, it fails with INVALID_DURATION_PROVIDED, and the response includes the allowed range so you can display a useful message. Handle both errors by returning the customer to the slot picker.

Then handle payment for the rental.

Book a daily rental

Book a multi-day rental. Consecutive days form 1 unbroken block, so the whole range becomes a single booking.

To book a daily rental:

  1. Call List Availability Time Slots with the serviceId, timeZone, fromLocalDate, toLocalDate, timeSlotsPerDay set to 1, and includeResourceTypeIds with the service's resource type ID. Each slot then carries the resource to book in availableResources. Display the available days to the customer and save the slot list.
  2. After the customer selects a start date, iterate forward through the slot list to find the consecutive available days. Stop at the first gap or when you reach the service's maximum duration. Display the valid end dates to the customer.
  3. Call Create Booking. Specify the slot's serviceId, scheduleId, timezone, resource, and location in booking.bookedEntity.slot, and the customer's contactDetails. Set the rental's boundaries:
    • bookedEntity.slot.startDate: Midnight on the first day of the rental.
    • bookedEntity.slot.endDate: Midnight on the day after the last day of the rental. For a rental from Monday to Wednesday inclusive, this is midnight on Thursday.
  4. Save the booking ID from the response.

Wix derives bookedEntity.slot.allDay and sets it to true. Don't set this field yourself.

Then handle payment for the rental.

Handle payment for a rental

Charge the customer for a rental booking through Wix eCommerce. This flow is the same for hourly and daily rentals.

To charge the customer:

  1. Call Create Checkout, specifying the following parameters:
    • catalogReference.appId: The Wix Rentals app ID, ff5d6eb1-65e4-4f9a-8b14-64d34c12cc2e.
    • catalogReference.catalogItemId: The booking ID.
  2. Call Get Checkout URL and redirect the customer to the returned URL.
  3. After checkout, Wix eCommerce creates an order and updates the booking status to CONFIRMED.

Cancel a single rental booking

Cancel an hourly or daily rental. Each rental is stored as a single booking.

To cancel a single rental booking:

  1. Call Query Extended Bookings to retrieve the booking and verify that its status allows cancellation. Save the booking ID and current revision.
  2. Call Cancel Booking with the booking ID and the revision from step 1.
  3. For rentals paid through Wix eCommerce, issue a refund with the eCommerce Orders API. Learn more about order billing sample flows.

See also

Last updated: 29 October 2026

Did this help?