CreateParkingSession method

This endpoint creates a new parking session for a user.

Request

CreateParkingSessionRequest

Return value

CreateParkingSessionResponse

Related Specifications

ParkingSession
Price
VehicleInformation
ParkingSessionFailure
UserInformation

// Request to fetch zone information, given the zone_code.
message CreateParkingSessionRequest {
  // Opaque identifier of the parking zone, must be globally unique for the
  // partner.
  // Required.
  string zone_id = 1;

  // Start time of the availability in seconds since Unix epoch.
  // Required.
  int64 start_time_sec = 2;

  // Duration of the requested session, in seconds. The session will expire at
  // the end time in seconds (which is start_time_sec + duration_sec).
  // E.g. if the session starts at 2:00:00pm for 15min, it will expire at
  // 2:15:00pm.
  // Required.
  int64 duration_sec = 3;

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

  // Information about customer payment. See https://developers.google.com/maps
  // -booking/guides/payments/enabling-payments
  // Required.
  PaymentProcessingParameters payment_processing_parameters = 5;

  // Supplied when the zone requires license plate info.
  VehicleInformation vehicle_information = 6;

  // Supplied when the zone requires space info.
  string space_code = 7;

  // Amount the user is to be charged for this session. If fees or taxes is
  // unset, this amount includes any fees and taxes.
  // Required.
  Price amount = 8;

  // Fees associated with this session. If present, the total amount
  // to be charged to the user for this session is the sum of price,
  // fees, taxes.
  // Optional.
  Price fees = 9;

  // Taxes associated with this session. If present, the total amount
  // to be charged to the user for this session is the sum of price,
  // fees, taxes.
  // Optional.
  Price taxes = 10;

  // Idempotency token for CreateParkingSession requests.
  // Required.
  string idempotency_token = 11;
}

message CreateParkingSessionResponse {
  // The created parking session, if successful.
  ParkingSession session = 1;

  // If creating a session fails, this field should reflect the business logic
  // error (e.g. price has expired) and all other fields in the
  // response message are expected to be unset.
  // (required if failure occurs)
  ParkingSessionFailure failure = 2;
}

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
      [(datapol.semantic_type) = ST_PAYMENTS_INFO];

  // 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 if and only if the
  // payment processor has a tokenization parameter for version)
  // This is deprecated in favor of tokenization_parameters.
  string version = 3 [deprecated = true];

  // The payment processor whose configuration was used to generate this token.
  // (required)
  // This is deprecated in favor of tokenization_parameters.
  string payment_processor = 4 [deprecated = true];

  // The tokenization_config supplied in the Merchant feed that was used
  // to generate unparsed_payment_method_token.
  TokenizationConfig tokenization_config = 6;
}