REST Resource: transitobject

Resource: TransitObject

JSON representation
{
  "classReference": {
    object (TransitClass)
  },
  "ticketNumber": string,
  "passengerType": enum (PassengerType),
  "passengerNames": string,
  "tripId": string,
  "ticketStatus": enum (TicketStatus),
  "customTicketStatus": {
    object (LocalizedString)
  },
  "concessionCategory": enum (ConcessionCategory),
  "customConcessionCategory": {
    object (LocalizedString)
  },
  "ticketRestrictions": {
    object (TicketRestrictions)
  },
  "purchaseDetails": {
    object (PurchaseDetails)
  },
  "ticketLeg": {
    object (TicketLeg)
  },
  "ticketLegs": [
    {
      object (TicketLeg)
    }
  ],
  "hexBackgroundColor": string,
  "tripType": enum (TripType),
  "id": string,
  "classId": string,
  "version": string,
  "state": enum (State),
  "barcode": {
    object (Barcode)
  },
  "messages": [
    {
      object (Message)
    }
  ],
  "validTimeInterval": {
    object (TimeInterval)
  },
  "locations": [
    {
      object (LatLongPoint)
    }
  ],
  "hasUsers": boolean,
  "smartTapRedemptionValue": string,
  "hasLinkedDevice": boolean,
  "disableExpirationNotification": boolean,
  "infoModuleData": {
    object (InfoModuleData)
  },
  "imageModulesData": [
    {
      object (ImageModuleData)
    }
  ],
  "textModulesData": [
    {
      object (TextModuleData)
    }
  ],
  "linksModuleData": {
    object (LinksModuleData)
  },
  "appLinkData": {
    object (AppLinkData)
  }
}
Fields
classReference

object (TransitClass)

A copy of the inherited fields of the parent class. These fields are retrieved during a GET.

ticketNumber

string

The number of the ticket. This is a unique identifier for the ticket in the transit operator's system.

passengerType

enum (PassengerType)

The number of passengers.

passengerNames

string

The name(s) of the passengers the ticket is assigned to. The above passengerType field is meant to give Google context on this field.

tripId

string

This id is used to group tickets together if the user has saved multiple tickets for the same trip.

ticketStatus

enum (TicketStatus)

The status of the ticket. For states which affect display, use the state field instead.

customTicketStatus

object (LocalizedString)

A custom status to use for the ticket status value when ticketStatus does not provide the right option. Both ticketStatus and customTicketStatus may not be set.

concessionCategory

enum (ConcessionCategory)

The concession category for the ticket.

customConcessionCategory

object (LocalizedString)

A custom concession category to use when concessionCategory does not provide the right option. Both concessionCategory and customConcessionCategory may not be set.

ticketRestrictions

object (TicketRestrictions)

Information about what kind of restrictions there are on using this ticket. For example, which days of the week it must be used, or which routes are allowed to be taken.

purchaseDetails

object (PurchaseDetails)

Purchase details for this ticket.

ticketLeg

object (TicketLeg)

A single ticket leg contains departure and arrival information along with boarding and seating information. If more than one leg is to be specified then use the ticketLegs field instead. Both ticketLeg and ticketLegs may not be set.

ticketLegs[]

object (TicketLeg)

Each ticket may contain one or more legs. Each leg contains departure and arrival information along with boarding and seating information. If only one leg is to be specified then use the ticketLeg field instead. Both ticketLeg and ticketLegs may not be set.

hexBackgroundColor

string

The background color for the card. If not set the dominant color of the hero image is used, and if no hero image is set, the dominant color of the logo is used. The format is #rrggbb where rrggbb is a hex RGB triplet, such as #ffcc00. You can also use the shorthand version of the RGB triplet which is #rgb, such as #fc0.

tripType

enum (TripType)

Required. The type of trip this transit object represents. Used to determine which symbol to use between the origin and destination.

id

string

Required. The unique identifier for an object. This ID must be unique across all objects from an issuer. This value should follow the format issuer ID.identifier where the former is issued by Google and latter is chosen by you. The unique identifier should only include alphanumeric characters, '.', '_', or '-'.

classId

string

Required. The class associated with this object. The class must be of the same type as this object, must already exist, and must be approved.

Class IDs should follow the format issuer ID.identifier where the former is issued by Google and latter is chosen by you.

version
(deprecated)

string (int64 format)

Deprecated

state

enum (State)

Required. The state of the object. This field is used to determine how an object is displayed in the app. For example, an inactive object is no longer displayed in the Google Pay app.

barcode

object (Barcode)

The barcode type and value.

messages[]

object (Message)

An array of messages displayed in the app. All users of this object will receive its associated messages. The maximum number of these fields is 10.

validTimeInterval

object (TimeInterval)

The time period this object will be active and object can be used. An object's state will be changed to expired when this time period has passed.

locations[]

object (LatLongPoint)

The list of locations where the object can be used. The platform uses this information to trigger geolocated notifications to users. Note that locations in the object override locations in the class which override locations in the Google Places ID.

hasUsers

boolean

Indicates if the object has users. This field is set by the platform.

smartTapRedemptionValue

string

Available only to Smart Tap enabled partners. Contact support for additional guidance.

hasLinkedDevice

boolean

Whether this object is currently linked to a single device. This field is set by the platform when a user saves the object, linking it to their device. Intended for use by select partners. Contact support for additional information.

disableExpirationNotification

boolean

Indicates if notifications should explicitly be suppressed. If this field is set to true, regardless of the messages field, expiration notifications to the user will be suppressed. By default, this field is set to false.

Currently, this can only be set for offers.

infoModuleData

object (InfoModuleData)

Deprecated. Use textModulesData instead.

imageModulesData[]

object (ImageModuleData)

Image module data. If image modules data is also defined on the class, those will be merged with the image data defined on the object. The maximum number of these fields (combined with the class) is 1.

textModulesData[]

object (TextModuleData)

Text module data. If text module data is also defined on the class, both will be displayed. The maximum number of these fields (combined with the class) is 10.

PassengerType

Enums
PASSENGER_TYPE_UNSPECIFIED
SINGLE_PASSENGER
singlePassenger

Legacy alias for SINGLE_PASSENGER. Deprecated.

MULTIPLE_PASSENGERS
multiplePassengers

Legacy alias for MULTIPLE_PASSENGERS. Deprecated.

TicketStatus

Enums
TICKET_STATUS_UNSPECIFIED
USED
used

Legacy alias for USED. Deprecated.

REFUNDED
refunded

Legacy alias for REFUNDED. Deprecated.

EXCHANGED
exchanged

Legacy alias for EXCHANGED. Deprecated.

ConcessionCategory

Enums
CONCESSION_CATEGORY_UNSPECIFIED
ADULT
adult

Legacy alias for ADULT. Deprecated.

CHILD
child

Legacy alias for CHILD. Deprecated.

SENIOR
senior

Legacy alias for SENIOR. Deprecated.

TicketRestrictions

JSON representation
{
  "routeRestrictions": {
    object (LocalizedString)
  },
  "routeRestrictionsDetails": {
    object (LocalizedString)
  },
  "timeRestrictions": {
    object (LocalizedString)
  },
  "otherRestrictions": {
    object (LocalizedString)
  }
}
Fields
routeRestrictions

object (LocalizedString)

Restrictions about routes that may be taken. For example, this may be the string "Reserved CrossCountry trains only".

routeRestrictionsDetails

object (LocalizedString)

More details about the above routeRestrictions.

timeRestrictions

object (LocalizedString)

Restrictions about times this ticket may be used.

otherRestrictions

object (LocalizedString)

Extra restrictions that don't fall under the "route" or "time" categories.

PurchaseDetails

JSON representation
{
  "purchaseReceiptNumber": string,
  "purchaseDateTime": string,
  "accountId": string,
  "confirmationCode": string,
  "ticketCost": {
    object (TicketCost)
  }
}
Fields
purchaseReceiptNumber

string

Receipt number/identifier for tracking the ticket purchase via the body that sold the ticket.

purchaseDateTime

string

The purchase date/time of the ticket.

This is an ISO 8601 extended format date/time, with or without an offset. Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601).

For example:

1985-04-12T23:20:50.52Z would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.

1985-04-12T19:20:50.52-04:00 would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the event were in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year.

1985-04-12T19:20:50.52 would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985 with no offset information.

Without offset information, some rich features may not be available.

accountId

string

ID of the account used to purchase the ticket.

confirmationCode

string

The confirmation code for the purchase. This may be the same for multiple different tickets and is used to group tickets together.

ticketCost

object (TicketCost)

The cost of the ticket.

TicketCost

JSON representation
{
  "faceValue": {
    object (Money)
  },
  "purchasePrice": {
    object (Money)
  },
  "discountMessage": {
    object (LocalizedString)
  }
}
Fields
faceValue

object (Money)

The face value of the ticket.

purchasePrice

object (Money)

The actual purchase price of the ticket, after tax and/or discounts.

discountMessage

object (LocalizedString)

A message describing any kind of discount that was applied.

TicketLeg

JSON representation
{
  "originStationCode": string,
  "originName": {
    object (LocalizedString)
  },
  "destinationStationCode": string,
  "destinationName": {
    object (LocalizedString)
  },
  "departureDateTime": string,
  "arrivalDateTime": string,
  "fareName": {
    object (LocalizedString)
  },
  "carriage": string,
  "platform": string,
  "zone": string,
  "ticketSeat": {
    object (TicketSeat)
  },
  "ticketSeats": [
    {
      object (TicketSeat)
    }
  ],
  "transitOperatorName": {
    object (LocalizedString)
  },
  "transitTerminusName": {
    object (LocalizedString)
  }
}
Fields
originStationCode

string

The origin station code. This is required if destinationStationCode is present or if originName is not present.

originName

object (LocalizedString)

The name of the origin station. This is required if desinationName is present or if originStationCode is not present.

destinationStationCode

string

The destination station code.

destinationName

object (LocalizedString)

The destination name.

departureDateTime

string

The date/time of departure. This is required if there is no validity time interval set on the transit object.

This is an ISO 8601 extended format date/time, with or without an offset. Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601).

For example:

1985-04-12T23:20:50.52Z would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.

1985-04-12T19:20:50.52-04:00 would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the event were in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year.

1985-04-12T19:20:50.52 would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985 with no offset information.

The portion of the date/time without the offset is considered the "local date/time". This should be the local date/time at the origin station. For example, if the departure occurs at the 20th hour of June 5th, 2018 at the origin station, the local date/time portion should be 2018-06-05T20:00:00. If the local date/time at the origin station is 4 hours before UTC, an offset of -04:00 may be appended.

Without offset information, some rich features may not be available.

arrivalDateTime

string

The date/time of arrival.

This is an ISO 8601 extended format date/time, with or without an offset. Time may be specified up to nanosecond precision. Offsets may be specified with seconds precision (even though offset seconds is not part of ISO 8601).

For example:

1985-04-12T23:20:50.52Z would be 20 minutes and 50.52 seconds after the 23rd hour of April 12th, 1985 in UTC.

1985-04-12T19:20:50.52-04:00 would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985, 4 hours before UTC (same instant in time as the above example). If the event were in New York, this would be the equivalent of Eastern Daylight Time (EDT). Remember that offset varies in regions that observe Daylight Saving Time (or Summer Time), depending on the time of the year.

1985-04-12T19:20:50.52 would be 20 minutes and 50.52 seconds after the 19th hour of April 12th, 1985 with no offset information.

The portion of the date/time without the offset is considered the "local date/time". This should be the local date/time at the destination station. For example, if the event occurs at the 20th hour of June 5th, 2018 at the destination station, the local date/time portion should be 2018-06-05T20:00:00. If the local date/time at the destination station is 4 hours before UTC, an offset of -04:00 may be appended.

Without offset information, some rich features may not be available.

fareName

object (LocalizedString)

Short description/name of the fare for this leg of travel. Eg "Anytime Single Use".

carriage

string

The train or ship name/number that the passsenger needs to board.

platform

string

The platform or gate where the passenger can board the carriage.

zone

string

The zone of boarding within the platform.

ticketSeat

object (TicketSeat)

The reserved seat for the passenger(s). If more than one seat is to be specified then use the ticketSeats field instead. Both ticketSeat and ticketSeats may not be set.

ticketSeats[]

object (TicketSeat)

The reserved seat for the passenger(s). If only one seat is to be specified then use the ticketSeat field instead. Both ticketSeat and ticketSeats may not be set.

transitOperatorName

object (LocalizedString)

The name of the transit operator that is operating this leg of a trip.

transitTerminusName

object (LocalizedString)

Terminus station or destination of the train/bus/etc.

TicketSeat

JSON representation
{
  "fareClass": enum (FareClass),
  "customFareClass": {
    object (LocalizedString)
  },
  "coach": string,
  "seat": string,
  "seatAssignment": {
    object (LocalizedString)
  }
}
Fields
fareClass

enum (FareClass)

The fare class of the ticketed seat.

customFareClass

object (LocalizedString)

A custome fare class to be used if no fareClass applies. Both fareClass and customFareClass may not be set.

coach

string

The identifier of the train car or coach in which the ticketed seat is located. Eg. "10"

seat

string

The identifier of where the ticketed seat is located. Eg. "42". If there is no specific identifier, use seatAssigment instead.

seatAssignment

object (LocalizedString)

The passenger's seat assignment. Eg. "no specific seat". To be used when there is no specific identifier to use in seat.

FareClass

Enums
FARE_CLASS_UNSPECIFIED
ECONOMY
economy

Legacy alias for ECONOMY. Deprecated.

FIRST
first

Legacy alias for FIRST. Deprecated.

BUSINESS
business

Legacy alias for BUSINESS. Deprecated.

TripType

Enums
TRIP_TYPE_UNSPECIFIED
ROUND_TRIP
roundTrip

Legacy alias for ROUND_TRIP. Deprecated.

ONE_WAY
oneWay

Legacy alias for ONE_WAY. Deprecated.

Methods

addmessage

Adds a message to the transit object referenced by the given object ID.

get

Returns the transit object with the given object ID.

insert

Inserts an transit object with the given ID and properties.

list

Returns a list of all transit objects for a given issuer ID.

patch

Updates the transit object referenced by the given object ID.

update

Updates the transit object referenced by the given object ID.