CreateBooking 方法

要求

CreateBookingRequest

傳回值

CreateBookingResponse

連帶影響

CreateBooking 會占用保留名額,導致該名額無法供其他預訂使用。

標準 gRPC 錯誤代碼

  • INVALID_ARGUMENT:因為漏填欄位之類的原因,導致提供的 ClientInformation 無效。
  • NOT_FOUND:提供的保留 ID 無效。
  • 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;
}