ParkingSession specification

The definition of a ParkingSession for use in CreateParkingSession and UpdateParkingSession.

Related Specifications

UserInformation
VehicleInformation

message ParkingSession {
  // Opaque identifier for the session, must be globally unique.
  // Required.
  string session_id = 1;

  // Human readable reference_number, to be used for example to identify a
  // session for customer support.
  // Required.
  string reference_number = 2;

  // Opaque identifier for the parking zone, must be globally unique.
  // Required.
  string zone_id = 3;

  // Personal information of the user making the parking session.
  // Required.
  UserInformation user_information = 4;

  // Optional, provided when the zone requires license plate info.
  VehicleInformation vehicle_information = 5;

  // Optional, provided when the zone requires space info.
  string space_code = 6;

  // Payment information associated with this parking session.
  // Required.
  PaymentInformation payment_information = 7;

  // Start time of the parking session in seconds since Unix epoch.
  // Required.
  int64 start_time_sec = 8;

  // Total duration of the parking session.
  // Required.
  int64 total_duration_sec = 9;
}
// Payment details that are sent when creating a new transaction (which could be
// a booking, order, or parking session).
message PaymentInformation {

  // Prepayment status of the transaction.
  // 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.
  // If the payment is PROCESSED_BY_GOOGLE, this field will be set by Google.
  // If the payment is PROCESSED_BY_PARTNER, this field will be left empty in
  // Google's CreateBooking or CreateOrder requests to the partner, and it must
  // be set by the partner in their responses.
  string payment_transaction_id = 2;

  // For bookings or orders, 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 transaction, exclusive of any taxes and fees.
  // 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 transaction.
  // 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;

  // Additional fees associated with this transaction, if any.
  //
  // The use of this field should be consistent with other pricing related
  // fields:
  //  - if a {price, tax, fees} breakdown is provided for service or
  //  availability, use the same breakdown {price, tax, fees} here.
  //  - if the price field for service or availability already includes taxes
  //  or fees, keep using price field to includes taxes or fees and avoid
  //  setting the tax_amount or fees fields here.
  // Note: this is only supported for non-order based transactions.
  Price fees = 14;

  // Total processing fees & taxes that the user needs to pay for the order;
  // only applicable to partners that handle order based transactions.
  // If the order would incur non-zero fees based on
  // the partner's response during CheckOrderFulfillability, Google would set
  // this field during CreateOrder; otherwise, the field would be unset.
  // The partner should verify this value, in addition to the `price` value,
  // before charging the user.
  Price fees_and_taxes = 10;

  // 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;

  // 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;
  }

  // Fraud signals that are sent to the partner as per agreement with Google.
  // The signals are sent via a serialized JSON blob.
  string fraud_signals = 11;

  // After we engage in a 3DS1 protocol gaining further authentication
  // information from a user, this payload is returned to us from an ACS
  // provider, and it should be used by the partner to complete the 3DS1
  // protocol.
  string pa_response = 12;

  // After we engage in a 3DS1 protocol gaining further authentication
  // information from a user, this payload may be returned to us from an ACS
  // provider, and if provided, it should be used by the partner to complete the
  // 3DS1 protocol.
  string md_merchant_data = 13;
}
// 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;
}