{
	"$schema": "http://json-schema.org/draft-04/schema#",
	"description": "Hotel booking request JSON schema",
	"type": "object",
	"additionalProperties": false,
	"definitions": {
		"hotelBookingRequest": {
			"description": "Booking request",
			"type": "object",
			"properties": {
				"versionNumber": {
					"$ref": "commonTypes.json#/definitions/schemaVersion"
				},
				"booking": {
					"type": "object",
					"properties": {
						"currencyCode": {
							"$ref": "commonTypes.json#/definitions/currencyCodeType"
						},
						"languageCode": {
							"$ref": "commonTypes.json#/definitions/xs:language"
						},
						"paxNationality": {
							"$ref": "commonTypes.json#/definitions/countryCodeType"
						},
						"priceChangeTolerance": {
							"$ref": "commonTypes.json#/definitions/xs:decimal"
						},
						"clientRef": {
							"$ref": "bookingCommonTypes.json#/definitions/clientReferenceType",
							"description": "This field can be used to hold the client's reference for the booking"
						},
						"departureDate": {
							"additionalProperties": false,
							"description": "Passenger departure date",
							"$ref": "commonTypes.json#/definitions/xs:date"
						},
						"existingBookingReference": {
							"additionalProperties": false,
							"description": "Provide existing booking reference, if this booking is to add items to an existing booking.",
							"$ref": "commonTypes.json#/definitions/xs:string"
						},
						"items": {
							"description": "Main part of booking = booking details per item",
							"type": "array",
							"minItems": 1,
							"items": {
								"$ref": "#/definitions/bookingItemType"
							},
							"additionalProperties": false
						},
						"paymentCard": {
							"$ref": "bookingCommonTypes.json#/definitions/paymentRequestType",
							"description": "Details of the Creditcard/Debit card"
						}
					},
					"required": [
						"currencyCode",
						"paxNationality",
						"items"
					],
					"additionalProperties": false,
					"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.RequestBooking"
				},
				"requestAuditInfo": {
					"$ref": "commonTypes.json#/definitions/requestAuditInfo"
				}
			},
			"required": [
				"versionNumber",
				"booking",
				"requestAuditInfo"
			],
			"additionalProperties": false
		},
		"bookingItemType": {
			"description": "Booking details",
			"type": "object",
			"properties": {
				"itemNumber": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"agentMarkup": {
					"$ref": "commonTypes.json#/definitions/agentMarkupType",
					"description": "Agent markup. Only for Miki internal use"
				},
				"giataCode": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"hotel": {
					"$ref": "#/definitions/hotelReservationItemType"
				},
				"immediateConfirmationRequired": {
					"additionalProperties": false,
					"description": "false=Booking can be made on request, true=Booking must be confirmed immediately",
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				},
				"returnRateDetails": {
					"additionalProperties": false,
					"description": "Controls whether response xml returns the rate details information. Default value is false",
					"$ref": "commonTypes.json#/definitions/xs:boolean"
				},
				"leadPaxName": {
					"$ref": "bookingCommonTypes.json#/definitions/paxNameType"
				},
				"payNow": {
					"additionalProperties": false,
					"description": "Set the value as '1' for paying now, '0' for not paying for this booking item",
					"$ref": "#/definitions/payNowType"
				},
				"productCode": {
					"$ref": "commonTypes.json#/definitions/productCodeType",
					"description": "Unique reference to product"
				},
				"specialRequest": {
					"additionalProperties": false,
					"description": "Specify the any special requests in text format.",
					"$ref": "commonTypes.json#/definitions/xs:string"
				}
			},
			"required": [
				"itemNumber",
				"hotel",
				"immediateConfirmationRequired",
				"leadPaxName"
			],
			"oneOf": [
				{
					"required": [
						"productCode"
					]
				},
				{
					"required": [
						"giataCode"
					]
				}
			],
			"additionalProperties": false
		},
		"hotelReservationItemType": {
			"description": "Detail information of the hotel",
			"type": "object",
			"properties": {
				"preferences": {
					"$ref": "bookingCommonTypes.json#/definitions/preferencesType"
				},
				"rooms": {
					"description": "This element indicates the number of rooms required",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "#/definitions/bookingRoomType",
						"description": "Specify the each room details."
					},
					"additionalProperties": false
				},
				"stayPeriod": {
					"$ref": "commonTypes.json#/definitions/stayPeriodRequestType"
				}
			},
			"required": [
				"rooms",
				"stayPeriod"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingRequestHotel"
		},
		"bookingRoomType": {
			"description": "The sub product information required is simple - code names per room for every room booked",
			"type": "object",
			"properties": {
				"roomNo": {
					"$ref": "commonTypes.json#/definitions/xs:positiveInteger"
				},
				"roomTypeCode": {
					"$ref": "commonTypes.json#/definitions/subproductCodeType"
				},
				"guests": {
					"description": "Collection of room stay candidate.",
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "bookingCommonTypes.json#/definitions/bookingGuestCountType",
						"description": "Each roomBasis needs to be specified with a sequence, number of adults and number of children."
					},
					"additionalProperties": false
				},
				"rateIdentifier": {
					"additionalProperties": false,
					"$ref": "commonTypes.json#/definitions/xs:string"
				},
				"roomTotalPrice": {
					"additionalProperties": false,
					"description": "Total price for this room and for all nights. This does not include the cost for any optional or upgrade requests.",
					"$ref": "commonTypes.json#/definitions/xs:decimal"
				}
			},
			"required": [
				"roomNo",
				"roomTypeCode",
				"guests",
				"rateIdentifier",
				"roomTotalPrice"
			],
			"additionalProperties": false,
			"javaType": "uk.co.miki.eBiz.msi.service.json70.schema.BookingRequestRoom"
		},		
		"payNowType": {
			"description": "Set the value as '1' for paying now, '0' for pay later",
			"type": "string",
			"enum": [
				"0",
				"1"
			]
		}
	},
	"$ref": "#/definitions/hotelBookingRequest"
}