Hi!
I know that the session is returned, and I have looked at the returned session object previously and it appeared valid.
I have built a minimum scenario like you suggested. I added a new service called “test_class1”, and added a session to it through the calendar, then did a query to get the session to get the scheduleId.
After that i created a button in the home page and wrote the following code:
import {myCreateSession} from 'backend/bookingsFunctions.jsw'
$w.onReady(function () {
$w('#button5').onClick((click)=>{
console.log('adding to test class...');
let infoAbTestSession={
start:{
timestamp: new Date (2022, 1, 24, 1),
},
end:{
timestamp: new Date (2022, 1, 24, 2),
},
scheduleId: "bcaad087-c2b7-4158-a4c2-2afe5ab845c6",
type: "EVENT",
}
myCreateSession(infoAbTestSession, {supressAuth:true})
.then((res)=>{
console.log(res);
})
.catch((err)=>{
console.log('Something went wrong:', err);
})
});
});
The imported function from the backend looks like this:
import { sessions } from "wix-bookings-backend";
export function myCreateSession(sessionInfo, options){
return sessions.createSession(sessionInfo, options);
}
I published, then went into my test account and pressed the button, and got the following logs on the console:
adding to test class...
end:
timestamp:
notes: ""
scheduleId: "bcaad087-c2b7-4158-a4c2-2afe5ab845c6"
scheduleOwnerId: "a0ff213f-9e12-4ca8-b146-6f1f269e54aa"
start:
timestamp:
tags: ['GROUP']
type: "EVENT"
_id: "2mmoW0vwKcSFyxtOfCdMu78iJroqb0nmyRBamHuVEyPL7RXC0gXv6tQ8NhlojvnHQWlMQ8d8KgGRmrA4zoQ2T1zOE9C55GNLiMhh"
And still if i go to book this class when i click the circled button on the screenshot the same error occures
Can you help me what might be wrong with my code? Or if it’s a bug in the API is there anything I can do about it?

