CreateBooking 메서드

고객이 요청된 시간대의 예약 가능 여부를 확인하고 가능하다는 응답을 받은 후 예약 생성을 요청합니다. 파트너 백엔드에서 요청된 시간대를 예약하고 성공 시 시간대를 반환하고 실패 시 비즈니스 로직 오류(예: 시간대를 예약할 수 없거나 결제가 잘못된 경우)를 반환합니다.

이 단계에서 사용자 및 결제에 대한 정보가 제공됩니다.

비즈니스 로직 오류로 인해 예약을 생성하지 못하면 응답에 오류가 채워집니다. 자세한 내용은 예약 실패를 참고하세요.

요청

CreateBookingRequest

반환값

CreateBookingResponse

표준 gRPC 오류 코드

  • INVALID_ARGUMENT: 제공된 UserInformation이 잘못된 경우(예: 필드 누락으로 인해)
// Request to create a [ext.maps.booking.partner.v2.Booking] for an inventory
// slot. Consumes the lease if provided.
message CreateBookingRequest {
  // 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 {
  // 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;
}