blob: 1c217bbdd1c0459a7f045f13a5e7fbd23934f328 [file] [log] [blame]
syntax = "proto3";
package v3;
// [START postaladdr_definition]
// The postal address for a merchant.
message PostalAddress {
// The country, e.g. "USA". (required)
string country = 1;
// The locality/city, e.g. "Mountain View". (required)
string locality = 2;
// The region/state/province, e.g. "CA". (required)
string region = 3;
// The postal code, e.g. "94043". (required)
string postal_code = 4;
// The street address, e.g. "1600 Amphitheatre Pkwy". (required)
string street_address = 5;
}
// [END postaladdr_definition]
// [START geocoord_definition]
// The Geo data of a location, including latitude, longitude, and address.
message GeoCoordinates {
double latitude = 1; // In degrees. (optional)
double longitude = 2; // In degrees. (optional)
PostalAddress address = 3; // (required)
}
// [END geocoord_definition]
// [START price_definition]
// The price of a service or a fee.
message Price {
// The price in micro-units of the currency.
// Fractions of smallest currency unit will be rounded using nearest even
// rounding. (e.g. For USD 2.5 cents rounded to 2 cents, 3.5 cents rounded to
// 4 cents, 0.5 cents rounded to 0 cents, 2.51 cents rounded to 3 cents).
// (required)
int64 price_micros = 1;
// The currency of the price that is defined in ISO 4217. (required)
string currency_code = 2;
// An optional and opaque string that identifies the pricing option that is
// associated with the extended price. (optional)
string pricing_option_tag = 3;
}
// [END price_definition]
// [START taxrate_definition]
// A tax rate applied when charging the user for a service, and which can be set
// on either a per merchant, or per service basis.
message TaxRate {
// A tax rate in millionths of one percent, effectively giving 6 decimals of
// precision. For example, if the tax rate is 7.253%, this field should be set
// to 7253000.
//
// If this field is left unset or set to 0, the total price charged to a user
// for any service provided by this merchant is the exact price specified by
// Service.price. The service price is assumed to be exempt from or already
// inclusive of applicable taxes. Taxes will not be shown to the user as a
// separate line item.
//
// If this field is set to any nonzero value, the total price charged to a
// user for any service provided by this merchant will include the service
// price plus the tax assessed using the tax rate provided here. Fractions of
// the smallest currency unit (for example, fractions of one cent) will be
// rounded using nearest even rounding. Taxes will be shown to the user as a
// separate line item. (required)
int32 micro_percent = 1;
}
// [END taxrate_definition]
// [START schedulingrules_definition]
// The scheduling rules for a service.
message SchedulingRules {
// The minimum advance notice in seconds required to book an appointment.
// (optional)
int64 min_advance_booking = 1;
// The minimum advance notice in seconds required to cancel a booked
// appointment online. (optional)
int64 min_advance_online_canceling = 2;
// The fee for canceling within the minimum advance notice period.
Price late_cancellation_fee = 3 [deprecated = true];
// The fee for no-show without canceling.
Price noshow_fee = 4 [deprecated = true];
}
// [END schedulingrules_definition]
// This defines the ingestion source type.
enum IngestionSource {
SOURCE_UNKNOWN = 0;
// This ingestion is from an uploaded feed file.
SOURCE_FEED = 1;
// This ingestion is from an API call.
SOURCE_API = 2;
}
// An empty boilplate proto for the Ingestion Queue in Spanner.
message IngestionQueuePayload {
}
// The types of content that we can ingest through feeds or APIs.
enum ContentType {
CONTENT_UNKNOWN = 0;
CONTENT_MERCHANT = 1;
CONTENT_SERVICE = 2;
CONTENT_AVAILABILITY = 3;
CONTENT_PAYMENT_OPTION = 4;
CONTENT_PAYMENT_OPTION_SERVICE = 5;
}
message IngestionStatus {
// The status code of an Ingestion event: a feed upload or an API call.
// Only used for logging the ingestion status in the IngestionMetadata
// table, do NOT use it in the code's control flow.
enum Code {
// An unknown status for Ingestion, shouldn't use it.
STATUS_UNKNOWN = 0;
// 1-99 for Feed upload.
// A feed has been uploaded.
STATUS_FEED_UPLOADED = 1;
// A feed has been added to the Ingestion Queue.
STATUS_FEED_ENQUEUED = 2;
// A feed has been picked up from the queue and started processing.
STATUS_FEED_PROCESSING_STARTED = 3;
// A feed has been processed successfully.
STATUS_FEED_PROCESSING_SUCCEEDED = 4;
// A feed has failed the processing.
STATUS_FEED_PROCESSING_FAILED = 5;
// A feed duplicate was uploaded.
STATUS_FEED_DUPLICATED = 6;
// 101-199 for API.
// An API has been called.
STATUS_API_CALLED = 101;
// An API has been processed successfully.
STATUS_API_PROCESSING_SUCCEEDED = 102;
// An API has failed the processing.
STATUS_API_PROCESSING_FAILED = 103;
}
// The code of the status.
Code code = 1;
// Microseconds since epoch when the ingestion updates its status code.
int64 timestamp_micros = 2;
// A human description of the error if any.
string internal_error_details = 3;
string partner_visible_error_details = 4;
}
// [START timerange_definition]
// A closed-open time range, i.e. [begin_sec, end_sec)
message TimeRange {
// Seconds of UTC time since Unix epoch (required)
int64 begin_sec = 1;
// Seconds of UTC time since Unix epoch (required)
int64 end_sec = 2;
}
// [END timerange_definition]
// [START pricetype_definition]
// Defines how a total price is determined from an availability.
enum PriceType {
// The price is for a fixed amount. This is the default value if the field is
// not set.
FIXED_RATE_DEFAULT = 0;
// The price specified is per person, and the total price is calculated
// according to the party size specified in Resources as
// price_micros * party_size. A PER_PERSON price must be accompanied by a
// party size in the availability resources. If it is not, a party size of one
// is used.
PER_PERSON = 1;
}
// [END pricetype_definition]
// [START noshowfee_definition]
// A fee that a user may be charged if they have made a booking but do not
// show up.
message NoShowFee {
// The amount the user may be charged if they do not show up for their
// reservation.
Price fee = 1;
// Defines how the fee is determined from the availability.
PriceType fee_type = 3;
}
// [END noshowfee_definition]
// [START deposit_definition]
// A deposit that the user may be charged or have a hold on their credit card
// for.
message Deposit {
// Deposit amount.
Price deposit = 1;
// Minimum advance cancellation for the deposit.
int64 min_advance_cancellation_sec = 2;
// Defines how the deposit is determined from the availability.
PriceType deposit_type = 3;
}
// [END deposit_definition]
// [START RequireCreditCard_definition]
// Defines whether a credit card is required in order to book an appointment.
enum RequireCreditCard {
// The credit card requirement is not explicitly specified and the
// behaviour is identical to the one specified for CONDITIONAL.
REQUIRE_CREDIT_CARD_UNSPECIFIED = 0;
// Google will require a credit card for the booking if any of the following
// conditions are met:
// * the availability has a price and the prepayment_type is REQUIRED
// * the no_show_fee is set
// * the deposit field is set.
REQUIRE_CREDIT_CARD_CONDITIONAL = 1;
// A credit card is always required in order to book this availability
// regardless of other field values.
REQUIRE_CREDIT_CARD_ALWAYS = 2;
}
// [END RequireCreditCard_definition]
// [START ActionLink_definition]
// An action URL with associated language and list of countries restricted to.
message ActionLink {
// The entry point URL for this action link.
string url = 1;
// The BCP-47 language tag identifying the language in which the content
// from this URI is available.
string language = 2;
// ISO 3166-1 alpha-2 country code. Leave empty for unrestricted visibility.
repeated string restricted_country = 3;
}
// [END ActionLink_definition]
// [START message_slot]
// An inventory slot
message Slot {
// ID of the merchant for the slot (required)
string merchant_id = 1;
// ID of the merchant service (required)
string service_id = 2;
// Start time of the appointment slot in seconds of UTC time since Unix epoch.
// (required)
int64 start_sec = 3;
// Duration of the appointment slot (required)
int64 duration_sec = 4;
// Opaque tag that identifies the availability slot and matches the value
// provided in the availability feed (optional)
string availability_tag = 5;
// The set of resources that disambiguates the appointment slot, e.g. by
// indicating the staff member and room selected by the user (optional)
ResourceIds resources = 6;
}
// [END message_slot]
// [START message_lease]
// Temporary lease for an inventory slot
message Lease {
// ID of the lease.
// Not populated in CreateLeaseRequest. The value is chosen by the partner and
// has to be returned in the response of CreateLease. (required)
string lease_id = 1;
// The appointment slot that the lease is created for. (required)
Slot slot = 2;
// Unique identifier for this lease, chosen by Reserve with Google. Serves as
// an idempotency token for CreateLease requests. (required)
string user_reference = 3;
// Expiration time of the lease in UTC Timestamp (required)
int64 lease_expiration_time_sec = 4;
}
// Reference to a Lease that has been created via CreateLease.
message LeaseReference {
// Lease ID (required)
string lease_id = 1;
}
// [END message_lease]
// [START message_booking]
// A booking for an inventory slot
message Booking {
// ID of this booking (required)
string booking_id = 1;
// The appointment slot of this booking (required)
Slot slot = 2;
// Personal information of the user making the appointment (required)
UserInformation user_information = 3;
// Status of the booking (required)
BookingStatus status = 4;
// Information about payment transactions that relate to the booking.
// (optional)
PaymentInformation payment_information = 5;
}
// [END message_booking]
// [START user_definition]
// Personal information about the person making a booking
message UserInformation {
// Unique ID of the user to the partner, chosen by Reserve with Google.
// (required)
string user_id = 1;
// Given name of the user (required)
string given_name = 2;
// Family name of the user (required)
string family_name = 3;
// Address of the user (optional)
PostalAddress address = 4;
// Phone number of the user (required)
string telephone = 5;
// Email address of the user (required)
string email = 6;
}
// [END user_definition]
// [START paymentprocessing_definition]
message PaymentProcessingParameters {
enum PaymentProcessor {
PAYMENT_PROCESSOR_UNSPECIFIED = 0;
PROCESSOR_STRIPE = 1;
PROCESSOR_BRAINTREE = 2;
}
// The payment processor used to process payment for a given booking.
// (required)
//
// Replaced by the payment_processor field.
PaymentProcessor processor = 1 [deprecated = true];
// The token representing the payment method that will be used to pay
// for this booking. This token can be only used once. This token can be
// only used for the merchant associated with this booking.
//
// Each processor may choose its own format for this field.
// An example of Stripe's token is "tok_1C3orL2eZvKYlo2CxReMgS4K".
//
// Replaced by unparsed_payment_method_token, which contains
// payment_method_token as one of its fields.
// For example, for Stripe, unparsed_payment_method_token is a serialized
// JSON object documented at https://stripe.com/docs/api#token_object.
// payment_method_token is the 'id' field parsed out of that.
string payment_method_token = 2 [deprecated = true];
// The full token received from Google Payments. This is typically a
// serialized JSON object. See documentation from Google Payments and your
// payment processor for the JSON format of the token for your processor.
// https://developers.google.com/pay/api/#participating-google-pay-processors
//
// This token can only be used once, and only for the merchant associated with
// this booking.
string unparsed_payment_method_token = 5;
// The payment processor API version that the given payment token is valid
// for.
//
// Each processor may choose its own format for this field.
// Stripe uses a date (e.g. "2017-06-15"). (required)
string version = 3;
// The payment processor whose configuration was used to generate this token.
// (required)
string payment_processor = 4;
}
// [END paymentprocessing_definition]
// [START paymentoption_definition]
enum PaymentOptionType {
PAYMENT_OPTION_TYPE_UNSPECIFIED = 0;
PAYMENT_OPTION_SINGLE_USE = 1;
PAYMENT_OPTION_MULTI_USE = 2;
PAYMENT_OPTION_UNLIMITED_USE = 3;
}
// [END paymentoption_definition]
// [START userpaymentoption_definition]
// This describes a payment option, such as a pack, membership, or
// single-session pass after it has been purchased by a user. It includes an
// identifier for the user payment option, as well as some information about
// the payment option with which it is associated.
message UserPaymentOption {
// A unique identifier for the user payment option. This Id MUST be unique
// for all UserPaymentOptions across all merchants and users. (required)
string user_payment_option_id = 1;
// The user payment option will be valid (usable) between start_time and
// end_time set in UTC. Attempts to use a user payment option to make a
// booking outside of this interval will fail. (both optional)
int64 valid_start_time_sec = 2;
int64 valid_end_time_sec = 3;
// The type of the payment option associated with this user payment option.
// This can be unlimited for a membership or subscription, multi-use for a
// pack, or single-use. (required)
PaymentOptionType type = 4;
// The original number of uses for this user payment option when it was
// purchased. This value is ignored for unlimited payment options. (required)
int32 original_count = 5;
// The number of uses remaining for this user payment option. If this number
// is 0 for a pack, attempts to use this payment option to make a booking will
// fail. (required)
int32 current_count = 6;
// The id of the payment option that has been used to purchase this user
// payment option. (required)
string payment_option_id = 7;
}
// [END userpaymentoption_definition]
// [START paymentinfo_definition]
// Payment details that are sent when creating a new booking.
message PaymentInformation {
// Prepayment status of the booking.
// If the prepayment_status is PREPAYMENT_PROVIDED, then
// payment_transaction_id contains the associated unique transaction id for
// the purchase.
// If the prepayment status is PREPAYMENT_REFUNDED, then
// payment_transaction_id contains the associated unique transaction id for
// the refund. (required)
PrepaymentStatus prepayment_status = 1;
// Unique identifier for a payment transaction associated with the booking.
// Empty if not applicable. (required)
string payment_transaction_id = 2;
// These fields must match the service price (specified in the Services feed)
// or the PaymentOption corresponding with this service.
// They are included in the booking request and response to verify that
// the price indicated in the feed has not changed since the last feed
// update.
//
// The price of the booking or order, exclusive of any taxes.
// Existence of price or taxes does not imply that they have been paid,
// prepayment_state should be used for that purpose. (required)
Price price = 3;
// Taxes that are calculated to be paid for this booking.
// This field can only be absent in one of the following cases:
// (1) the price is exempt from or already inclusive of applicable taxes; or
// (2) the break down between taxes and fees is not available.
// (required when neither of the above holds)
Price tax_amount = 4;
// Who handles payment processing?
// If payment is processed by the partner, CreateBooking request will
// include additional parameters (PaymentProcessingParameters) indicating
// the payment method to be used to process the payment.
enum PaymentProcessedBy {
PAYMENT_PROCESSED_BY_UNSPECIFIED = 0;
PROCESSED_BY_GOOGLE = 1;
PROCESSED_BY_PARTNER = 2;
}
// Whether the partner or Google processed the payment. (required)
PaymentProcessedBy payment_processed_by = 5;
// The id of the payment option or user payment option associated with the
// booking.
// If a payment option is purchased as part of a booking, payment_option_id
// will be set with the id of that payment option.
// If an already purchased user payment option is being used to pay for a
// booking, user_payment_option_id will be set with the id of that user
// payment option.
// When included as part of a response proto, the user_payment_option_id
// should be set and must match the UserPaymentOption that is returned in the
// RPC response (e.g. the user_payment_option returned in
// CreateBookingResponse). (one of these required)
oneof payment_id {
// The id of the payment option associated with this booking. If this field
// is populated, price (and tax_amount, if applicable) must be populated as
// well.
string payment_option_id = 6;
// The id of the user payment option used to pay for this booking.
string user_payment_option_id = 7;
}
// Defines how a deposit may be charged to the user. If there is a deposit,
// this field should be set. (optional)
Deposit deposit = 8;
// Defines a no show fee that may be charged to the user. If the user can be
// charged a no show fee, this field should be set. (optional)
NoShowFee no_show_fee = 9;
// Total processing fees & taxes that the user needs to pay for the order;
// only applicable to partners that handle order based booking (e.g., with
// CreateOrder method). (optional)
Price fees_and_taxes = 10;
}
// [END paymentinfo_definition]
// [START bookingstatus_definition]
// Status of a booking.
//
// Updating booking status does not change the status of the associated payment.
// Prepayment status updates should be done using the PrepaymentStatus enum.
//
// nextID: 6
enum BookingStatus {
// Not specified.
BOOKING_STATUS_UNSPECIFIED = 0;
// Booking has been confirmed
CONFIRMED = 1;
// Booking is awaiting confirmation by the merchant before it can transition
// into CONFIRMED status
PENDING_MERCHANT_CONFIRMATION = 2;
// Booking has been canceled on behalf of the user.
// The merchant can still trigger a manual refund.
CANCELED = 3;
// User did not show for the appointment
NO_SHOW = 4;
// User did not show for the appointment in violation of the cancellation
// policy.
NO_SHOW_PENALIZED = 5;
}
// [END bookingstatus_definition]
// [START creditcardtype_definition]
// Used when booking/order failure cause is PAYMENT_ERROR_CARD_TYPE_REJECTED to
// indicate the type of credit card that was rejected.
enum CreditCardType {
// Default value. Used if credit card type does not match to one below.
CREDIT_CARD_TYPE_UNSPECIFIED = 0;
VISA = 1;
MASTERCARD = 2;
AMERICAN_EXPRESS = 3;
DISCOVER = 4;
}
// [END creditcardtype_definition]
// [START bookingfailure_definition]
// Status data that conveys why (1) creating a lease or (2) creating or updating
// a booking fails.
// BookingFailure is intended to primarily capture business logic errors.
message BookingFailure {
enum Cause {
// Default value: Don't use; amounts to an "unknown error"
CAUSE_UNSPECIFIED = 0;
// The referenced availability slot is not available any longer.
SLOT_UNAVAILABLE = 1;
// The user has already booked an appointment for the referenced
// availability slot.
SLOT_ALREADY_BOOKED_BY_USER = 2;
// The lease (if provided) has expired and cannot be used any longer to
// complete the requested booking.
LEASE_EXPIRED = 3;
// The requested cancellation cannot be performed at the current time due
// to time restrictions in the merchant's cancellation policy.
OUTSIDE_CANCELLATION_WINDOW = 4;
// An error was encountered while processing the payment because the
// provided credit card type was not accepted by the merchant. The credit
// card type must be supplied in rejected_card_type.
PAYMENT_ERROR_CARD_TYPE_REJECTED = 5;
// An error was encountered while processing the payment because the
// provided credit card was declined.
PAYMENT_ERROR_CARD_DECLINED = 6;
// An error was encountered with the pack/membership used to pay for the
// booking. There could be no valid uses left, it could have expired, etc.
PAYMENT_OPTION_NOT_VALID = 7;
// An error was encountered while processing the payment for this booking.
// Use this value to indicate a general payment related error, only if the
// error does not match to a specific payment error above.
PAYMENT_ERROR = 8;
// User cannot use the given payment option (e.g. user trying to use a
// first time price for the second time).
USER_CANNOT_USE_PAYMENT_OPTION = 9;
// A booking that the user tried to cancel has already been cancelled.
BOOKING_ALREADY_CANCELLED = 10;
// A booking that the user tried to cancel is not cancellable.
BOOKING_NOT_CANCELLABLE = 11;
}
// The reason why the booking failed. (required)
Cause cause = 1;
// (required only if cause is PAYMENT_ERROR_CARD_TYPE_REJECTED)
CreditCardType rejected_card_type = 2;
// This optional field is used for the partner to include additional
// information for debugging purpose only. (optional)
string description = 3;
}
// [END bookingfailure_definition]
// [START prepaymentstatus_definition]
// Prepayment status of a booking.
// Updating payment status will trigger an update on the payment status of the
// associated booking (if applicable).
// Currently, the only supported transition is from PREPAYMENT_PROVIDED to
// PREPAYMENT_REFUNDED, which will initiate a non-reversible refund on the
// associated payment transaction.
enum PrepaymentStatus {
// Not specified, defaults to PREPAYMENT_NOT_PROVIDED.
PREPAYMENT_STATUS_UNSPECIFIED = 0;
// The fee for the booking has been paid in advance.
PREPAYMENT_PROVIDED = 1;
// The fee for the booking has not been paid in advance.
PREPAYMENT_NOT_PROVIDED = 2;
// The fee was previously PREPAYMENT_PROVIDED but has now been refunded.
PREPAYMENT_REFUNDED = 3;
// The fee was previously PREPAYMENT_PROVIDED but now has been credited
// (user given a UserPaymentOption as a voucher for the booking).
// If this is set, the response should also include the updated
// UserPaymentOption.
PREPAYMENT_CREDITED = 4;
}
// [END prepaymentstatus_definition]
// [START message_slot_availability]
// An inventory slot and associated count of open spots.
message SlotAvailability {
Slot slot = 1;
// Number of available spots.
// 0 indicates that the appointment slot is not available. (required)
int32 count_available = 2;
}
// [END message_slot_availability]
// [START message_availability_update]
// An update to one ore more slots indicating that the availability for the
// associated time has potentially changed.
message AvailabilityUpdate {
repeated SlotAvailability slot_availability = 1;
}
// [END message_availability_update]
// [START resources_definition]
// Resource specification that disambiguates an appointment slot
message ResourceIds {
// The staff ID as provided in the feed or empty if not applicable or no staff
// was selected. (optional)
string staff_id = 1;
// The room ID as provided in the feed or empty if not applicable or no room
// was selected. (optional)
string room_id = 2;
// For Dining Reservations only: the number of seats requested in the booking.
// (optional)
int32 party_size = 3;
}
// [END resources_definition]
// [START tickettype_definition]
// TicketType is used to differentiate among tickets (where a ticket can be a
// spot on a raft trip, an admission to a museum, etc.) with different prices
// and/or availabilities due to different user types or different service
// attributes.
message TicketType {
// The ticket id is used to differentiate among different ticket types of the
// same service, and is only expected to be unique within a service.
string ticket_type_id = 1;
// This can be user visible, e.g., “adult”, "child", “veteran”, “Row J”, etc.
string short_description = 2;
// The price of a single ticket of this type, exclusive of any taxes. The tax
// rate of Service is applied to its tickets.
Price price = 3;
}
// [END tickettype_definition]
// [START lineitem_definition]
// A single item in an order--the booking of a single service in a single time
// slot.
message LineItem {
// ID of the merchant service. (required)
string service_id = 1;
// Start time of the appointment slot in seconds of UTC time since Unix epoch.
// (required)
int64 start_sec = 2;
// Duration of the appointment slot in seconds. (required)
int64 duration_sec = 3;
message OrderedTickets {
string ticket_id = 1;
int32 count = 2;
}
// Number of tickets ordered by type.
repeated OrderedTickets tickets = 4;
// In handling CreateOrderRequest and CheckOrderFulfillabilityRequest,
// the total price (excluding taxes) of the item must be verified to guard
// against price changes. In CreateOrderResponse and
// CheckOrderFulfillabilityResponse, the price should be updated to the
// correct value if the value from the request was incorrect or outdated.
// (reqired)
Price price = 5;
// Status of the line item. (required in CreateOrderResponse and
// ListOrdersResponse; should not be set in requests)
BookingStatus status = 6;
}
// [END lineitem_definition]
// [START lineitemfulfillability_definition]
// Fulfillability of a line item.
message LineItemFulfillability {
// The line item of question. (required)
LineItem item = 1;
// The result of a line item fulfillability check.
enum ItemFulfillabilityResult {
// Default value: Don't use.
ITEM_FULFILLABILITY_RESULT_UNSPECIFIED = 0;
// This line item can be fulfilled.
CAN_FULFILL = 1;
// No adequate availability for the slot requested.
SLOT_UNAVAILABLE = 2;
// The combination of ticket types requested cannot be fulfilled.
UNFULFILLABLE_TICKET_COMBINATION = 3;
// The total price of this line item is not incorrect.
INCORRECT_PRICE = 4;
// The line item cannot be fulfilled for reasons that do not fall into
// the categories above.
ITEM_UNFULFILLABLE_OTHER_REASON = 5;
}
// (required)
ItemFulfillabilityResult result = 2;
// Additional description of the reason if the item is unfulfillable.
// (optional)
string unfulfillable_reason = 3;
// Updated availability for this slot can be piggybacked in
// CheckOrderFulfillabilityResponse. (optional)
int32 spots_open = 4;
// Updated ticket types can be piggybacked in
// CheckOrderFulfillabilityResponse. If non-empty, all available ticket types
// for this slot with up-to-date prices should be listed without omitting any.
// (optional)
repeated TicketType ticket_type = 5;
}
// [END lineitemfulfillability_definition]
// [START orderfulfillability_definition]
message OrderFulfillability {
// The result of an order fulfillability check.
enum OrderFulfillabilityResult {
// Default value: Don't use.
ORDER_FULFILLABILITY_RESULT_UNSPECIFIED = 0;
// The order can be fulfilled.
CAN_FULFILL = 1;
// The order cannot be fulfilled due to one or more unfulfillable line
// item(s).
UNFULFILLABLE_LINE_ITEM = 2;
// The combination of the line items requested cannot be fulfilled.
UNFULFILLABLE_SERVICE_COMBINATION = 3;
// The order cannot be fulfilled due to reasons that do not fall into the
// categories above.
ORDER_UNFULFILLABLE_OTHER_REASON = 4;
}
OrderFulfillabilityResult result = 1;
// Fulfillability results of all line items in this order (required).
repeated LineItemFulfillability item_fulfillability = 2;
// Additional description of the reason if the item is unfulfillable.
// (optional)
string unfulfillable_reason = 3;
}
// [END orderfulfillability_definition]
// [START order_definition]
// An order for service appointments with a merchant.
message Order {
// ID of this order, chosen by the booking partner who handles the order
// (required in CreateOrderResponse and ListOrdersResponse, must not be set in
// CreateOrderRequest)
string order_id = 1;
// Personal information of the user making the order (required)
UserInformation user_information = 2;
// Information about payment transactions that relate to the order.
// (optional)
PaymentInformation payment_information = 3;
// The merchant that all services in this order belong to.
string merchant_id = 4;
// Line items in this order.
repeated LineItem item = 5;
}
// [END order_definition]
// [START orderfailure_definition]
// Status data that conveys why creating an order fails.
// OrderFailure is intended to primarily capture business logic errors.
message OrderFailure {
enum Cause {
// Default value: Don't use; amounts to an "unknown error"
CAUSE_UNSPECIFIED = 0;
// The order is no longer fulfillable.
ORDER_UNFULFILLABLE = 1;
// An error was encountered while processing the payment because the
// provided credit card type was not accepted by the merchant. The credit
// card type must be supplied in rejected_card_type.
PAYMENT_ERROR_CARD_TYPE_REJECTED = 2;
// An error was encountered while processing the payment because the
// provided credit card was declined.
PAYMENT_ERROR_CARD_DECLINED = 3;
// An error was encountered while processing the payment for this order.
// Use this value to indicate a general payment related error, only if the
// error does not match to a specific payment error above.
PAYMENT_ERROR = 4;
}
// The reason why the order failed. (required)
Cause cause = 1;
// (required only if cause is ORDER_UNFULFILLABLE)
OrderFulfillability fulfillability = 2;
// (required only if cause is PAYMENT_ERROR_CARD_TYPE_REJECTED)
CreditCardType rejected_card_type = 3;
// This optional field is used for the partner to include additional
// information for debugging purpose only. (optional)
string description = 4;
}
// [END orderfailure_definition]
// [START method_check_availability]
// Request to check availability for a Slot.
message CheckAvailabilityRequest {
// The appointment slot that is being checked (required)
Slot slot = 1;
}
// Response for the CheckAvailability RPC with the availability of the
// appointment slot.
message CheckAvailabilityResponse {
// The requested slot. (required)
Slot slot = 1;
// Number of available spots.
// 0 indicates that the appointment slot is not available. (required)
int32 count_available = 2;
// This enum indicates what requirements exist for the user to acknowledge or
// view the requested slots duration/end time.
enum DurationRequirement {
// The handling of the end time is not specified. This is the default.
DURATION_REQUIREMENT_UNSPECIFIED = 0;
// The end time is not shown to the user.
DO_NOT_SHOW_DURATION = 1;
// The end time has to be shown to the user before an appointment can be
// made.
MUST_SHOW_DURATION = 2;
}
// The requirement to show the slots duration and/or endtime. This field will
// be ignored if the slot is unavailable. (optional)
DurationRequirement duration_requirement = 3;
// Optionally, the partner can return additional updated information about the
// availability for this merchant if this information is present when
// responding to the CheckAvailabilityRequest and if there is no negative
// impact on the CheckAvailability request latency.
// For instance an entire day of merchant availability for a superset of
// resources can be returned here.
AvailabilityUpdate availability_update = 4;
}
// [END method_check_availability]
// [START method_get_booking_status]
// Request to get booking status and prepayment status for a Booking.
message GetBookingStatusRequest {
// ID of the existing booking (required)
string booking_id = 1;
}
// Response for the GetBookingStatus RPC with booking status and prepayment
// status.
message GetBookingStatusResponse {
// ID of the booking (required)
string booking_id = 1;
// Status of the booking (required)
BookingStatus booking_status = 2;
// Prepayment status of the booking (required)
PrepaymentStatus prepayment_status = 3;
}
// [END method_get_booking_status]
// [START method_check_order_fulfillability]
// Request to check the fulfillability of an order.
message CheckOrderFulfillabilityRequest {
// The merchant that this order is intended for. (required)
string merchant_id = 1;
// The line items in this order. All services requested must belong to the
// specified merchant. (required)
repeated LineItem item = 2;
}
// Response for the CheckOrderfulfillabilityRequest.
message CheckOrderFulfillabilityResponse {
// Fulfillability status of the order, potentially contains updated
// availabilities and prices of the requested line item. (required)
OrderFulfillability fulfillability = 1;
// Total processing fees & taxes that need to be paid for this order.
// (required)
Price fees_and_taxes = 2;
}
// [END method_check_order_fulfillability]
// [START method_create_booking]
// Request to create a 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 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 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;
}
// [END method_create_booking]
// [START method_create_order]
// Request to create an order.
message CreateOrderRequest {
// The order to create. (required)
Order order = 1;
// The parameters to be used if the payment is processed by the partner
// (i.e. order.payment_information.payment_processed_by is equal to
// PROCESSED_BY_PARTNER). (required if payment is processed by the partner)
PaymentProcessingParameters payment_processing_parameters = 2;
// Idempotency token for CreateOrder requests. (required)
string idempotency_token = 3;
}
// Response for the CreateOrderRequest.
message CreateOrderResponse {
// The order created. (required)
Order order = 1;
// If creating an order fails, this field should reflect the business logic
// error (e.g., slot has become unavailable or price has changed) and all
// other fields in the CreateOrderResponse are expected to be unset. (required
// if failure occurs)
OrderFailure order_failure = 2;
}
// [END method_create_order]
// [START method_create_lease]
// Request to create a Leaese for a slot in the inventory. The expiration time
// in the returned Lease may be modified by the backend, e.g. if the requested
// lease period is too long.
message CreateLeaseRequest {
// The lease to be created with information about the appointment slot
// (required)
Lease lease = 1;
}
// Response for the CreateLease RPC with the created Lease.
message CreateLeaseResponse {
// The created Lease (required)
Lease lease = 1;
// If creating a lease fails, this field should reflect the business logic
// error (e.g., slot has become unavailable) and lease field is expected to be
// unset. (required if failure occurs)
BookingFailure booking_failure = 2;
}
// [END method_create_lease]
// [START method_list_bookings]
// Request to list all bookings for a user
message ListBookingsRequest {
// ID of the user (required)
string user_id = 1;
}
// Response for the ListBookings RPC with all bookings for the requested user.
message ListBookingsResponse {
// All bookings of the user (required)
repeated Booking bookings = 1;
}
// [END method_list_bookings]
// [START method_list_orders]
// Request to list orders.
message ListOrdersRequest {
// ID of the user (required only if order_id is not set).
string user_id = 1;
// If set, return only the specified orders; otherwise, return all orders of
// the user. (required only if user_id is not set).
repeated string order_id = 2;
}
// Response for the ListOrders RPC.
message ListOrdersResponse {
// All requested orders (required)
repeated Order order = 1;
}
// [END method_list_orders]
// [START method_update_booking]
// Request to update a Booking.
message UpdateBookingRequest {
// The booking to be updated
// The following fields can be set in a booking:
// - status, to cancel a booking.
// - start_time and duration in the slot, to reschedule a booking. (required)
Booking booking = 1;
}
// Response with the updated Booking.
message UpdateBookingResponse {
// The updated booking (required)
Booking booking = 1;
// The updated user payment option originally used to pay for this booking.
// This should be set if the UpdateBookingRequest results in a change to
// the UserPaymentOption.
// For instance, if the booking is canceled, the UserPaymentOption should
// reflect an additional credit to the user. In the case of a multi-use
// payment option, the current_count should be increased by one to
// allow the user to create another booking with this payment option. In the
// case of a single-use payment option, a new single-use user payment option
// should be returned. (required if altered in update)
UserPaymentOption user_payment_option = 2;
// If updating a booking fails, this field should reflect the business logic
// error (e.g., booking is not cancellable) (required if failure occurs)
BookingFailure booking_failure = 3;
}
// [END method_update_booking]