{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","properties":{"data":{"properties":{"accommodation_special_requests":{"anyOf":[{"description":"Guest's specific requests about this booking to be forwarded to the accommodation. This field should not be used to provide medical or otherwise sensitive information.","maxLength":1000,"type":"string"},{"type":"null"}]},"email":{"description":"Lead guest's email address","format":"email","type":"string","maxLength":16000},"guests":{"description":"List of guests that will stay on this booking. A minimum of one guest must be provided.\nFor bookings of more than one room, the reservation will be made under the name of the first guest provided. We recommend (though optional) that you pass an additional guest name per additional room.\n","items":{"properties":{"family_name":{"description":"Guest's family name","type":"string","maxLength":16000},"given_name":{"description":"Guest's given name","type":"string","maxLength":16000},"user_id":{"anyOf":[{"description":"Creates an association between the guest and a previously created user.\n\nThis is intended to allow guests the ability to manage their own bookings.\n","type":"string","maxLength":16000},{"type":"null"}]}},"required":["given_name","family_name"],"type":"object","maxProperties":100},"type":"array","maxItems":100},"loyalty_programme_account_number":{"anyOf":[{"description":"Loyalty programme account number to associate with this booking.\n\nUse this only when the quote has a [supported_loyalty_programme](/docs/api/v2/quotes/create-quote#quotes-schema-supported-loyalty-programme) indicated. Otherwise, this will result in an error.\n\nAccount number is relayed to the hotel on a best-effort basis, it is at the hotel's discretion to honour the loyalty programme.\n","type":"string","maxLength":16000},{"type":"null"}]},"metadata":{"anyOf":[{"description":"Metadata contains a set of key-value pairs that you can attach to an\nobject. It can be useful for storing additional information about the\nobject, in a structured format. Duffel does not use this information.\nYou should not store sensitive information in this field.\n\nThe metadata is a collection of key-value pairs, both of which are strings.\nYou can store a maximum of 50 key-value pairs, where each key has a maximum\nlength of 40 characters and each value has a maximum length of 500 characters.\n\nKeys must only contain numbers, letters, dashes, or underscores.\n","type":"object","maxProperties":100},{"type":"null"}]},"payment":{"anyOf":[{"description":"The payment details to use to pay for the booking.\n\nWhen you want to pay using the \"balance\" payment method, this must be omitted.\n\nWhen you want to pay using the \"card\" payment method, this object is required.\n","properties":{"three_d_secure_session_id":{"description":"The ID of the ThreeDSecureSession","type":"string","maxLength":16000}},"type":"object","maxProperties":100},{"type":"null"}]},"phone_number":{"description":"Lead guest's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) (international) format.","type":"string","maxLength":16000},"quote_id":{"description":"The `id` of the stay quote you want to book.","type":"string","maxLength":16000},"users":{"description":"The `id`s of customer users that would be allowed to manage the booking.\n","items":{"type":"string","maxLength":16000},"type":"array","maxItems":100}},"required":["quote_id","guests","email","phone_number"],"type":"object","maxProperties":100},"deviceIp":{"type":"string","maxLength":45},"deviceUserAgent":{"type":"string","maxLength":1000}},"required":["data"],"additionalProperties":false},"name":"Stays: Creating a booking","id":"duffel.api.stays.bookings.create","example":{"data":{"users":["icu_00009htyDGjIfajdNBZRlw"],"quote_id":"quo_0000AS0NZdKjjnnHZmSUbI","phone_number":"+442080160509","payment":{"three_d_secure_session_id":"3ds_0000AWr2XsTRIF1Vp34gh5"},"metadata":{"customer_reference_number":"DLXYYZ5"},"loyalty_programme_account_number":"201154908","guests":[{"user_id":"icu_00009htyDGjIfajdNBZRlw","given_name":"Amelia","family_name":"Earheart"}],"email":"amelia.earheart@duffel.com","accommodation_special_requests":"2:00 PM early check-in required"}},"maxRequests":1,"summary":false}}