השיטה CreateBooking
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
בקשה
CreateBookingRequest
ערך המוחזר
CreateBookingResponse
תופעות לוואי
הקריאה ל-CreateBooking צורכת זיכיון, כך שהוא לא תקף להזמנות נוספות.
קודי שגיאה קנונים של gRPC
INVALID_ARGUMENT
אם ה-ClientInformation שסופק לא תקין, למשל בגלל שדות חסרים
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 Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון 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```"]]