Discussions

Ask a Question
Back to All

Why does the notes field always return a null value when creating a booking, even though I include a value in the payload? How can I ensure that the notes field is properly populated during the booking creation process?

const payload = {
source_text: data.source_text || "Website Form Submission",
notes: data.note || "Default reservation note",
arrival: data.checkin || "",
departure: data.checkout || "",
property_id: 631930,
status: "Open",
rooms: [
{
room_type_id: 698887,
guest_breakdown: {
adults: data.adult || 0,
children: data.children || 0,
infants: 0,
pets: 0,
},
key_code: "",
},
],
guest: {
guest_name: {
first_name: data.first_name || "Unknown",
last_name: data.last_name || "Unknown",
},
email: data.email || "[email protected]",
phone: data.phone_number || "No phone provided",
},
messages: [
{
subject: "Reservation Confirmation",
message: Thank you for your reservation, ${data.first_name}! Your stay is confirmed from ${data.checkin} to ${data.checkout}.,
type: "Owner",
send_notification: true,
},
],
bookability: "InstantBooking",
totalAmount: 0.0,
currency_code: "USD",
};