I’ve created a custom wixBookings flow in Corvid for two service options, both free appointments - no payment options required. My code from the submitButton.onClick:
/// prerequisite imports and other page code functioning as expected //
$w('#submitButton').onClick(async () => {
const firstName = $w('#firstNameInput').value;
const email = $w('#emailInput').value;
const phone = $w('#phoneInput').value;
const formFields = [{
"_id": "00000000-0000-0000-0000-000000000001",
"value": firstName
},
{
"_id": "00000000-0000-0000-0000-000000000002",
"value": email
},
{
"_id": "00000000-0000-0000-0000-000000000003",
"value": phone
}];
const bookingInfo = {
"slot": selectedSlot[0],
"formFields": formFields
};
await wixBookings.checkoutBooking(bookingInfo)
.then((results) => {
$w('#bookingStatebox').changeState("state4");
console.log("bookingId", results.bookingId);
})
.catch(err => console.log(err));
});
I have checked that the bookingInfo parameter for checkoutBooking is correct; the selectedSlot is initially retrieved as an array with a single slot object (as I was using array.filter to filter slots based on date and time selections) so selectedSlot[0] is correctly passing the slot object to bookingInfo.
In the Preview console, my .catch is logging:
code: -10009
message: "no premium package"
It was my understanding that booking free appointments did not require a Business Premium plan. From the API reference for wix-bookings:
You can check out bookings for appointments from any type of Wix account. To check out bookings for classes or courses you need toupgrade to a Business Premium Plan.
To reiterate, both of the services in my Booking/Services collection are free appointments, 15 minutes in length with 15 minutes block time.
Do I require a Business Premium plan, and if I do, how can I test my booking flow prior to purchasing a plan?
Thanks in advance.