// Request to create a [ext.maps.booking.partner.v2.Booking] for an inventory// slot. Consumes the lease if provided.messageCreateBookingRequest{// The inventory slot that is being requested to make this booking.// If lease_ref is provided, slot must match the lease; slot is provided for// the partner to verify the lease information.// If lease_ref is absent, then create the booking for the slot. (required)Slotslot=1;// The lease that is being confirmed to make this booking.// If lease_ref is provided, then create the booking using the lease.// (optional)LeaseReferencelease_ref=2;// Personal information of the user making the appointment (required)UserInformationuser_information=3;// Information about payments. When payment authorizations are handled by// Google, if the booking request does not succeed, payment authorizations are// automatically canceled. (optional)PaymentInformationpayment_information=4;// 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). (optional)PaymentProcessingParameterspayment_processing_parameters=5;// Idempotency token for [ext.maps.booking.partner.v2.CreateBooking] requests.// (required)stringidempotency_token=6;// A string from the user which contains any special requests or additional// information that they would like to notify the merchant about. (optional)stringadditional_request=7;}// Response with the created [ext.maps.booking.partner.v2.Booking] for an// inventory slotmessageCreateBookingResponse{// The created booking (required)Bookingbooking=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.// (optional)UserPaymentOptionuser_payment_option=2;// If creating a booking fails, this field should reflect the business logic// error (e.g., slot has become unavailable) and all other fields in the// CreateBookingResponse message are expected to be unset. (required if// failure occurs)BookingFailurebooking_failure=3;}
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eThe \u003ccode\u003eCreateBooking\u003c/code\u003e API enables clients to book an available inventory slot, providing user and payment details.\u003c/p\u003e\n"],["\u003cp\u003ePartners handle the booking request, returning the confirmed booking or a business logic error if unsuccessful.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eINVALID_ARGUMENT\u003c/code\u003e errors occur if the \u003ccode\u003eUserInformation\u003c/code\u003e is invalid, for instance, due to missing fields.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003elease_ref\u003c/code\u003e field in the request should be omitted; refer to the lease specification for further information.\u003c/p\u003e\n"],["\u003cp\u003eUpon booking failure, the response includes a \u003ccode\u003eBookingFailure\u003c/code\u003e object detailing the reason.\u003c/p\u003e\n"]]],["The client initiates booking creation for an available slot. The partner's backend processes this request, utilizing user and payment information. Upon success, the backend returns the booking; otherwise, it returns a business logic error, like slot unavailability or payment issues. If a failure occurs, the `BookingFailure` field should be populated. The `lease_ref` should be absent in the request. An idempotency token and optional additional user requests are included in the `CreateBookingRequest`. A successful response includes the `Booking` and optionally a `UserPaymentOption`.\n"],null,["# CreateBooking method\n\nThe client requests to create a booking after checking availability of the\nrequested slot and receiving that it is available. The partner backend makes a\nbooking for the requested slot, and returns the slot upon success, or business\nlogic error (e.g. if the slot has become unavailable, or if payment is invalid,\netc.) upon failure.\n\nInformation about the user and payment is provided in this step.\n\nIf creating a booking fails due to any business logic error, the error should be\npopulated in the response. See [Booking\nFailure](/actions-center/reference/grpc-api-v2/booking-failure-specification) for\ndetailed information.\n| **Note:** lease_ref in CreateBookingRequest is expected to be absent. See [lease\n| specification](/actions-center/reference/grpc-api-v2/lease-specification) for additional information.\n\n**Request**\n\nCreateBookingRequest\n\n**Return value**\n\nCreateBookingResponse\n\n**Canonical gRPC error codes**\n\n- `INVALID_ARGUMENT` (if the provided UserInformation is invalid, e.g. due to missing fields)\n\n```scilab\n// Request to create a [ext.maps.booking.partner.v2.Booking] for an inventory\n// slot. Consumes the lease if provided.\nmessage CreateBookingRequest {\n // The inventory slot that is being requested to make this booking.\n // If lease_ref is provided, slot must match the lease; slot is provided for\n // the partner to verify the lease information.\n // If lease_ref is absent, then create the booking for the slot. (required)\n Slot slot = 1;\n\n // The lease that is being confirmed to make this booking.\n // If lease_ref is provided, then create the booking using the lease.\n // (optional)\n LeaseReference lease_ref = 2;\n\n // Personal information of the user making the appointment (required)\n UserInformation user_information = 3;\n\n // Information about payments. When payment authorizations are handled by\n // Google, if the booking request does not succeed, payment authorizations are\n // automatically canceled. (optional)\n PaymentInformation payment_information = 4;\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). (optional)\n PaymentProcessingParameters payment_processing_parameters = 5;\n\n // Idempotency token for [ext.maps.booking.partner.v2.CreateBooking] requests.\n // (required)\n string idempotency_token = 6;\n\n // A string from the user which contains any special requests or additional\n // information that they would like to notify the merchant about. (optional)\n string additional_request = 7;\n}\n\n// Response with the created [ext.maps.booking.partner.v2.Booking] for an\n// inventory slot\nmessage CreateBookingResponse {\n // The created booking (required)\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 // (optional)\n UserPaymentOption user_payment_option = 2;\n\n // If creating a booking fails, this field should reflect the business logic\n // error (e.g., slot has become unavailable) and all other fields in the\n // CreateBookingResponse message are expected to be unset. (required if\n // failure occurs)\n BookingFailure booking_failure = 3;\n}\n```"]]