روش ایجاد رزرو

کلاینت پس از بررسی در دسترس بودن جایگاه درخواستی و دریافت اینکه در دسترس است، درخواست ایجاد رزرو می‌دهد. پشتیبان همکار، رزرو را برای جایگاه درخواستی انجام می‌دهد و در صورت موفقیت یا بروز خطای منطق کسب‌وکار (مثلاً اگر جایگاه در دسترس نباشد، یا اگر پرداخت نامعتبر باشد و غیره) در صورت عدم موفقیت، جایگاه را برمی‌گرداند.

اطلاعات مربوط به کاربر و پرداخت در این مرحله ارائه می‌شود.

اگر ایجاد رزرو به دلیل هرگونه خطای منطق کسب‌وکار با شکست مواجه شود، خطا باید در پاسخ ثبت شود. برای اطلاعات دقیق‌تر به بخش «شکست رزرو» مراجعه کنید.

درخواست

ایجاد درخواست رزرو

مقدار بازگشتی

ایجاد رزرو پاسخ

کدهای خطای gRPC کانونیکال

  • INVALID_ARGUMENT (اگر اطلاعات کاربری ارائه شده نامعتبر باشد، مثلاً به دلیل وجود فیلدهای ناقص)
// Request to create a [ext.maps.booking.partner.v2.Booking] for an inventory
// slot. Consumes the lease if provided.
message CreateBookingRequest {
  option features.(pb.java).nest_in_file_class = YES;

  // 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)
  Slot slot = 1;

  // The lease that is being confirmed to make this booking.
  // If lease_ref is provided, then create the booking using the lease.
  // (optional)
  LeaseReference lease_ref = 2;

  // Personal information of the user making the appointment (required)
  UserInformation user_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)
  PaymentInformation payment_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)
  PaymentProcessingParameters payment_processing_parameters = 5;

  // Idempotency token for [ext.maps.booking.partner.v2.CreateBooking] requests.
  // (required)
  string idempotency_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)
  string additional_request = 7;
}

// Response with the created [ext.maps.booking.partner.v2.Booking] for an
// inventory slot
message CreateBookingResponse {
  option features.(pb.java).nest_in_file_class = YES;

  // The created booking (required)
  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.
  // (optional)
  UserPaymentOption user_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)
  BookingFailure booking_failure = 3;
}