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)
  },
  "activationStatus": {
    object (ActivationStatus)
  },
  "rotatingBarcode": {
    object (RotatingBarcode)
  },
  "deviceContext": {
    object (DeviceContext)
  },
  "heroImage": {
    object (Image)
  },
  "groupingInfo": {
    object (GroupingInfo)
  },
  "passConstraints": {
    object (PassConstraints)
  },
  "saveRestrictions": {
    object (SaveRestrictions)
  },
  "linkedObjectIds": [
    string
  ],
  "notifyPreference": enum (NotificationSettingsForUpdates),
  "valueAddedModuleData": [
    {
      object (ValueAddedModuleData)
    }
  ]
}
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 the pass title and/or 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 moved to the "Expired passes" section.

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[]
(deprecated)

object (LatLongPoint)

Note: This field is currently not supported to trigger geo notifications.

hasUsers

boolean

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

smartTapRedemptionValue

string

The value that will be transmitted to a Smart Tap certified terminal over NFC for this object. The class level fields enableSmartTap and redemptionIssuers must also be set up correctly in order for the pass to support Smart Tap. Only ASCII characters are supported.

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. The maximum number of these fields displayed is 1 from object level and 1 for class object level.

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 displayed is 10 from the object and 10 from the class.

activationStatus

object (ActivationStatus)

The activation status for the object. Required if the class has activationOptions set.

rotatingBarcode

object (RotatingBarcode)

The rotating barcode type and value.

deviceContext

object (DeviceContext)

Device context associated with the object.

heroImage

object (Image)

Optional banner image displayed on the front of the card. If none is present, hero image of the class, if present, will be displayed. If hero image of the class is also not present, nothing will be displayed.

groupingInfo

object (GroupingInfo)

Information that controls how passes are grouped together.

passConstraints

object (PassConstraints)

Pass constraints for the object. Includes limiting NFC and screenshot behaviors.

saveRestrictions

object (SaveRestrictions)

Restrictions on the object that needs to be verified before the user tries to save the pass. Note that this restrictions will only be applied during save time. If the restrictions changed after a user saves the pass, the new restrictions will not be applied to an already saved pass.

linkedObjectIds[]

string

linkedObjectIds are a list of other objects such as event ticket, loyalty, offer, generic, giftcard, transit and boarding pass that should be automatically attached to this transit object. If a user had saved this transit card, then these linkedObjectIds would be automatically pushed to the user's wallet (unless they turned off the setting to receive such linked passes).

Make sure that objects present in linkedObjectIds are already inserted - if not, calls would fail. Once linked, the linked objects cannot be unlinked. You cannot link objects belonging to another issuer. There is a limit to the number of objects that can be linked to a single object. After the limit is reached, new linked objects in the call will be ignored silently.

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

notifyPreference

enum (NotificationSettingsForUpdates)

Whether or not field updates to this object should trigger notifications. When set to NOTIFY, we will attempt to trigger a field update notification to users. These notifications will only be sent to users if the field is part of an allowlist. If set to DO_NOT_NOTIFY or NOTIFICATION_SETTINGS_UNSPECIFIED, no notification will be triggered. This setting is ephemeral and needs to be set with each PATCH or UPDATE request, otherwise a notification will not be triggered.

valueAddedModuleData[]

object (ValueAddedModuleData)

Optional value added module data. Maximum of ten on the object.

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.

ActivationStatus

The activation status of the object. This field includes activation status if valuable supports activation.

JSON representation
{
  "state": enum (State)
}
Fields
state

enum (State)

State

Enums
UNKNOWN_STATE
NOT_ACTIVATED Not-Activated, this is the default status
not_activated

Legacy alias for NOT_ACTIVATED. Deprecated.

ACTIVATED Activated
activated

Legacy alias for ACTIVATED. Deprecated.

DeviceContext

Device context associated with the object.

JSON representation
{
  "deviceToken": string
}
Fields
deviceToken

string

If set, redemption information will only be returned to the given device upon activation of the object. This should not be used as a stable identifier to trace a user's device. It can change across different passes for the same device or even across different activations for the same device. When setting this, callers must also set hasLinkedDevice on the object being activated.

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.