Error :"Expected value not provided" when trying to create booking

Hi !

When I try to make a request I got this message error :

  1. code: “caligraph_invalid_payload”

  2. errors: Array(1)

  3. 0:

1. code: "ycbm_api_http_invalid_payload"
2. field: "numberOfSlots"
3. message: "Expected value not provided"
4. object: "Booking"
5. __proto__: Object
  1. length: 1

  2. proto: Array(0)

  3. httpStatusCode: 400

  4. message: “Invalid payload”

  5. status: “BAD_REQUEST”

  6. type: "CaligraphExc

I tried to fix it by adding the parameter but it still giving me same message
Here is my code for the request :

create_booking(emailAddress,firstName,lastName)
{
///v1/{accountId}/profiles/{profileId}/bookings

    fetch(info.BASE_URL+`/profiles/${get.profile_id}/bookings`,{
        method:info.POST_METHOD,
        //headers:this.getRequestHeaders('POST'),
        
        headers:{
            "Content-Type" : "application/json",
            
        },
        body:JSON.stringify({

                appointmentTypeIds: [
                  "jsid2126175"
                ],
                
                units: 1,
                numberOfSlots: 1,
                timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
                startsAt: "2021-07-07T09:00:00",
                //numberOfSlots: '1',
                answers: [
            {
                code: 'EMAIL',
                string: emailAddress
            }, {
                code: 'FNAME',
                string: firstName
            }, {
                code: 'LNAME',
                string: lastName
            }
        ]
        })
    })
    .then(response =>response.json())
    .then(json =>{
        console.log(json);
    })
    .catch(error =>{
        console.error(error);
    })
},

@Aladin Sorry I missed this post. were you able to get a booking to go through the API, or are you still struggling. checking on the above it could be your timeZone. Also if the key, values are not in " " then the payload would be invalid. Finally when passing in the email it must be a valid email address not just a string.