{"command":{"effect":"write","timeoutSeconds":30,"inputSchema":{"type":"object","properties":{"data":{"properties":{"metadata":{"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},"passengers":{"description":"The personal details of the passengers, expanding on the information initially provided when creating the offer request","items":{"properties":{"born_on":{"description":"The passenger's date of birth","format":"date","type":"string","maxLength":16000},"email":{"description":"The passenger's email address","type":"string","maxLength":16000},"family_name":{"description":"The passenger's family name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `Ĳ`, `ĳ`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 or 2 characters, and the maximum, combined with `given_name`, is 40 characters. The requirements vary by airline. We recommend using a minimum length of","type":"string","maxLength":16000},"gender":{"description":"The passenger's gender","enum":["m","f"],"type":"string","maxLength":16000},"given_name":{"description":"The passenger's given name. Only `space`, `-`, `'`, and letters from the [`ASCII`](https://www.unicode.org/charts/PDF/U0000.pdf), [`Latin-1 Supplement`](https://www.unicode.org/charts/PDF/U0080.pdf) and [`Latin Extended-A`](https://www.unicode.org/charts/PDF/U0100.pdf) (with the exceptions of `Æ`, `æ`, `Ĳ`, `ĳ`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 or 2 characters, and the maximum, combined with `family_name`, is 40 characters. The requirements vary by airline. We recommend using a minimum length of","type":"string","maxLength":16000},"id":{"description":"The `id` of the passenger, returned when the [offer request](/docs/api/offer-requests) was created","type":"string","maxLength":16000},"identity_documents":{"anyOf":[{"description":"The passenger's identity documents. You may only provide one identity document per type per passenger.\nThe identity document's type supported by the airline can be found in the offer's `supported_passenger_identity_document_types`.\nIf the offer's `passenger_identity_documents_required` is set to `true`, then a passport document must be provided.","items":{"properties":{"expires_on":{"description":"Must only be provided for `passport` type. The date on which the identity document expires","format":"date","type":"string","maxLength":16000},"issuing_country_code":{"description":"Must only be provided for `passport`, `known_traveler_number`, and `passenger_redress_number` types. The [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code of the country that issued this identity document","type":"string","maxLength":16000},"type":{"description":"The type of the identity document. Currently, the only supported types are `passport`, `tax_id`, `known_traveler_number`, and `passenger_redress_number`.\nThe identity document's type supported by the airline can be found in the offer's `supported_passenger_identity_document_types`.","enum":["passport","tax_id","known_traveler_number","passenger_redress_number"],"type":"string","maxLength":16000},"unique_identifier":{"description":"The unique identifier of the identity document. e.g. the passport number. For `known_traveler_number`, spaces and hyphens are removed and the rest must be letters and digits only.","type":"string","maxLength":16000}},"required":["expires_on","issuing_country_code","type","unique_identifier"],"type":"object","maxProperties":100},"type":"array","maxItems":100},{"type":"null"}]},"infant_passenger_id":{"description":"Infant passengers, with an `age` of 0 or 1, must be associated with an adult passenger. This field should be used to make this association. It should contain the `id` of the infant passenger as returned in the [offer request](/docs/api/offer-requests).","type":"string","maxLength":16000},"phone_number":{"description":"The passenger's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) (international) format","type":"string","maxLength":16000},"title":{"description":"The passenger's title (the `dr` title is not supported by certain airlines, where a [`ValidationError`](/docs/api/overview/response-handling) will be returned instead if used)","enum":["mr","ms","mrs","miss","dr"],"type":"string","maxLength":16000},"user_id":{"description":"Creates an association between the passenger and a previously created user.\n\nThis is intended to allow passengers the ability to manage their own orders.\n","type":"string","maxLength":16000}},"required":["id","given_name","family_name","gender","title","born_on","email","phone_number"],"type":"object","maxProperties":100},"type":"array","maxItems":100},"payments":{"description":"The payment details to use to pay for the order. This key should be omitted when the order’s `type` is `hold`.","items":{"properties":{"amount":{"description":"The amount of the payment. This should be the same as the `total_amount` of the offer specified in `selected_offers`, plus the `total_amount` of all the services specified in `services`.","type":"string","maxLength":16000},"currency":{"description":"The currency of the `amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. This should be the same as the `total_currency` of the offer specified in `selected_offers`.","type":"string","maxLength":16000},"three_d_secure_session_id":{"description":"The `id` of the 3DSecure Session ID. This is the authentication when paying by [card](/docs/api/v2/card).","type":"string","maxLength":16000},"type":{"description":"The type of payment you want to apply to the order. If you are an IATA agent with your own agreements with airlines, in some cases, you can pay using ARC/BSP cash by specifying `arc_bsp_cash`.\nYou can pay using your Duffel account's balance by specifying `balance`. Otherwise, you can pay by [card](docs/api/v2/card). In [test mode](/docs/api/overview/test-mode), your balance is unlimited.\nIf you're not sure which of these options applies to you, get in touch with the Duffel support team at <help@duffel.com>.","enum":["arc_bsp_cash","balance","card"],"type":"string","maxLength":16000}},"required":["type","amount","currency"],"type":"object","maxProperties":100},"type":"array","maxItems":100},"selected_offers":{"description":"The `id`s of the offers you want to book. You must specify an array containing exactly one selected offer.\n\nNote that you can only book one offer per offer request.\n","items":{"type":"string","maxLength":16000},"type":"array","maxItems":100},"services":{"description":"The services you want to book along with the first selected offer.\n\nIf the offer was priced with `intended_services`, you must either send those same\nservices here or omit this key entirely. Any other set of services is rejected.\n","items":{"properties":{"id":{"description":"The `id` of the service from the offer's `available_services` that you want to book","type":"string","maxLength":16000},"quantity":{"description":"The quantity of the service to book. This will always be `1` for seat services.","minimum":1,"type":"integer"}},"required":["id","quantity"],"type":"object","maxProperties":100},"type":"array","maxItems":100},"type":{"description":"The type of order. You can only use `hold` with offers where `payment_requirements.requires_instant_payment` is `false`.\n\nWhen booking an offer with type `hold`, do not specify `payments` key.\n","enum":["instant","hold"],"type":"string","maxLength":16000},"users":{"description":"The `id`s of users that would be allowed to manage the order.\n","items":{"type":"string","maxLength":16000},"type":"array","maxItems":100}},"required":["selected_offers","passengers"],"type":"object","maxProperties":100,"allOf":[{"if":{"properties":{"type":{"const":"hold"}},"required":["type"]},"then":{"not":{"required":["payments"]}},"else":{"required":["payments"]}}]},"deviceIp":{"type":"string","maxLength":45},"deviceUserAgent":{"type":"string","maxLength":1000}},"required":["data"],"additionalProperties":false},"name":"Flights: Create an order","id":"duffel.api.air.orders.create","example":{"data":{"users":["icu_00009htyDGjIfajdNBZRlw"],"type":"instant","services":[{"quantity":1,"id":"ase_00009hj8USM7Ncg31cB123"}],"selected_offers":["off_00009htyDGjIfajdNBZRlw"],"payments":[{"type":"balance","three_d_secure_session_id":"3ds_0000AWr2XsTRIF1Vp34gh5","currency":"GBP","amount":"30.20"}],"passengers":[{"user_id":"icu_00009htyDGjIfajdNBZRlw","title":"mrs","phone_number":"+442080160509","infant_passenger_id":"pas_00009hj8USM8Ncg32aTGHL","identity_documents":[{"unique_identifier":"19KL56147","type":"passport","issuing_country_code":"GB","expires_on":"2025-04-25"}],"id":"pas_00009hj8USM7Ncg31cBCLL","given_name":"Amelia","gender":"f","family_name":"Earhart","email":"amelia@duffel.com","born_on":"1987-07-24"}],"metadata":{"payment_intent_id":"pit_00009htYpSCXrwaB9DnUm2"}}},"maxRequests":1,"summary":false}}