Метод CreateBooking
Оптимизируйте свои подборки
Сохраняйте и классифицируйте контент в соответствии со своими настройками.
Запрос
Создать запрос на бронирование
Возвращаемое значение
CreateBookingResponse
Побочные эффекты
CreateBooking использует аренду, что делает ее недействительной для дальнейших бронирований.
Канонические коды ошибок gRPC
-
INVALID_ARGUMENT
если предоставленная информация о клиенте недействительна, например, из-за отсутствия полей. -
NOT_FOUND
если предоставленный идентификатор аренды недействителен. -
RESOURCE_EXHAUSTED
(если слот стал недоступен с момента создания аренды, например, из-за конфликтующего бронирования) -
ALREADY_EXISTS
(если у клиента уже есть бронирование слота)
// Request to create a [ext.maps.booking.partner.v0.Booking] for an inventory
// slot. Consumes the lease.
message CreateBookingRequest {
// The lease that is being confirmed to make this booking
LeaseReference lease_ref = 1;
// Personal information of the client making the appointment
ClientInformation client_information = 2;
// Information about payments. If the booking request does not succeed,
// payment authorizations are automatically canceled.
PaymentInformation payment_information = 3;
// The parameters to be used if the payment is processed by the partner
// (i.e. payment_information.payment_processed_by is equal to
// PROCESSED_BY_PARTNER).
PaymentProcessingParameters payment_processing_parameters = 4;
}
// Response with the created [ext.maps.booking.partner.v0.Booking] for an
// inventory slot
message CreateBookingResponse {
// The created booking
Booking booking = 1;
// The updated user payment option used in this booking.
// If a new payment option was purchased to pay for the booking, this should
// be a newly created user payment option.
// If an already purchased user payment option was used for this booking,
// this should reflect an updated version of that user payment option.
UserPaymentOption user_payment_option = 2;
}
Если не указано иное, контент на этой странице предоставляется по лицензии Creative Commons "С указанием авторства 4.0", а примеры кода – по лицензии Apache 2.0. Подробнее об этом написано в правилах сайта. Java – это зарегистрированный товарный знак корпорации Oracle и ее аффилированных лиц.
Последнее обновление: 2025-07-24 UTC.
[null,null,["Последнее обновление: 2025-07-24 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCreateBooking\u003c/code\u003e API creates a booking for an inventory slot using a provided lease, client, payment, and payment processing information.\u003c/p\u003e\n"],["\u003cp\u003eIf successful, it returns the created booking and potentially updated user payment information, consuming the initial lease.\u003c/p\u003e\n"],["\u003cp\u003ePotential errors include invalid client data, invalid lease ID, slot unavailability due to conflict or if the client already has a booking for the given slot.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eCreateBookingRequest\u003c/code\u003e contains lease, client, payment, and processing details, while \u003ccode\u003eCreateBookingResponse\u003c/code\u003e returns the booking and user payment information.\u003c/p\u003e\n"]]],["The `CreateBookingRequest` message initiates a booking, consuming a lease and requiring `LeaseReference`, `ClientInformation`, and `PaymentInformation`. A successful request returns a `CreateBookingResponse` containing the `Booking` details and potentially an updated `UserPaymentOption`. Side effects include lease invalidation. Errors include `INVALID_ARGUMENT` (invalid client info), `NOT_FOUND` (invalid lease), `RESOURCE_EXHAUSTED` (slot unavailable), and `ALREADY_EXISTS` (existing booking). The request also includes optional `PaymentProcessingParameters` for partner-processed payments.\n"],null,["# CreateBooking method\n\n**Request**\n\nCreateBookingRequest\n\n**Return value**\n\nCreateBookingResponse\n\n**Side effects**\n\nCreateBooking consumes a Lease, rendering it invalid for any further bookings.\n\n**Canonical gRPC error codes**\n\n- `INVALID_ARGUMENT` if the provided ClientInformation is invalid, e.g. due to missing fields\n- `NOT_FOUND` if the provided lease ID is not valid.\n- `RESOURCE_EXHAUSTED` (if the slot has become unavailable since creating the lease, e.g. due to a conflicting booking)\n- `ALREADY_EXISTS` (if the client already has a booking for the slot)\n\n```scilab\n// Request to create a [ext.maps.booking.partner.v0.Booking] for an inventory\n// slot. Consumes the lease.\nmessage CreateBookingRequest {\n // The lease that is being confirmed to make this booking\n LeaseReference lease_ref = 1;\n\n // Personal information of the client making the appointment\n ClientInformation client_information = 2;\n\n // Information about payments. If the booking request does not succeed,\n // payment authorizations are automatically canceled.\n PaymentInformation payment_information = 3;\n\n // The parameters to be used if the payment is processed by the partner\n // (i.e. payment_information.payment_processed_by is equal to\n // PROCESSED_BY_PARTNER).\n PaymentProcessingParameters payment_processing_parameters = 4;\n}\n\n// Response with the created [ext.maps.booking.partner.v0.Booking] for an\n// inventory slot\nmessage CreateBookingResponse {\n // The created booking\n Booking booking = 1;\n\n // The updated user payment option used in this booking.\n // If a new payment option was purchased to pay for the booking, this should\n // be a newly created user payment option.\n // If an already purchased user payment option was used for this booking,\n // this should reflect an updated version of that user payment option.\n UserPaymentOption user_payment_option = 2;\n}\n```"]]