Table of contents
Overview
Version information
Version : v1
URI scheme
Host : schemas.mobileticket.se
BasePath : /api/v1
Schemes : HTTPS
Paths
Issue tickets
POST /ticket
Description
Issue tickets from supplied manifest. The manifest should come from the
product server for a matching participant id. Manifests from an unknown
participants, expired manifest or with an illegal signature will be
rejected.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Body | manifestCall | Manifest to issue tickets from |
Responses
HTTP Code | Description | Schema |
---|---|---|
201 | Successful operation, return identifiers for issued tickets location (string) : URL of created ticket bundle. | |
400 | Manifest is invalid or from unknown participant | No Content |
401 | Unauthorised | No Content |
Produces
application/json
Tags
- ticket
Get issued tickets
GET /ticket
Description
Get all issued tickets that meets the requirements specified by the
parameters. Which parameters you can filter on are described below.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Query | active | Filter on active tickets | boolean |
Query | pid | Filter on participant ID requesting the ticket | integer (int64) |
Query | refundable | Filter on refundable tickets | boolean |
Query | refunded | Filter on refunded tickets | boolean |
Query | requestId | Filter on request ID | string |
Query | travellerId | Filter on travellers ID | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation, return list of tickets. If filter doesn't | < ticket > array |
401 | Unauthorised | No Content |
Produces
application/json
Tags
- ticket
Example
Get ticket data and information
GET /ticket/{ticketId}
Description
Get data and information about ticket with specified ticket identifier,
issued by this server.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket identifier | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation | |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Get ticket active status
GET /ticket/{ticketId}/active
Description
Get active status for ticket with specified ticket identifier.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket id | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation | |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Freeze or thaw ticket
PUT /ticket/{ticketId}/active
Description
Freeze or thaw ticket with specified ticket identifier.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket identifier | string |
Body | activeStatus | Set to true to thaw ticket, false to freeze. A ticket must be active to be able |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation, ticket is now inactive | No Content |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Get ticket events
GET /ticket/{ticketId}/event
Description
Get all ticket events for specified ticket identifier. If no
events are available an empty list will be returned.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket identifier | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation, list of all events for specified ticket identifier. | < ticketEventResult > array |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Get ticket event
GET /ticket/{ticketId}/event/{eventId}
Description
Get ticket event specified with event identifier and ticket identifier.
Note! this is the server event identifier and not the local event identfier.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | eventId | Event identifier | string |
Path | ticketId | Ticket identifier | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation | |
401 | Unauthorised | No Content |
404 | Ticket and event combination not found | No Content |
Produces
application/json
Tags
- ticket
Get ticket recover status
GET /ticket/{ticketId}/recoverStatus
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket identifier | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Recover ticket
PUT /ticket/{ticketId}/recoverStatus
Description
Recover ticket specified with ticket identifier.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket id | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation, ticket recovered | No Content |
400 | Ticket could not be recovered | No Content |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Get ticket recoverable status
GET /ticket/{ticketId}/recoverableStatus
Description
Get information if ticket specified with ticket identifier is
recoverable. If ticket is refundable also supply information
about recoverable amount and VAT.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket identifier | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Get ticket refund status
GET /ticket/{ticketId}/refundStatus
Description
Get information if ticket specified with ticket identifier has
been refunded or not. If ticket was refunded also supply information
about refunded amount and VAT.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket id | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation | |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Refund ticket
PUT /ticket/{ticketId}/refundStatus
Description
Refund ticket specified with ticket identifier.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket id | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation, ticket was refunded | No Content |
400 | Ticket could not be refunded | No Content |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Get ticket refundable status
GET /ticket/{ticketId}/refundableStatus
Description
Get information if ticket specified with ticket identifier is
refundable. If ticket is refundable also supply information
about refundable amount and VAT.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket id | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | successful operation | |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Revoke ticket
PUT /ticket/{ticketId}/revoke
Description
Set the ticket specified with ticket identifier in revoked state.
When a ticket is in revoked state it can.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketId | Ticket identifier | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation, ticket in revoved state. | No Content |
401 | Unauthorised | No Content |
404 | Ticket not found | No Content |
Produces
application/json
Tags
- ticket
Create new ticket bundle
POST /ticketbundle
Description
Create a new ticket bundle containing that is a subset of another ticket bundle.
The tickets are specified in the request payload as a list of ticket identfiers.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Body | ticketBundleRequest | List of ticket identifiers of tickets to be included in ticket bundle |
Responses
HTTP Code | Description | Schema |
---|---|---|
201 | Successful operation location (string) : URL of created ticket bundle. | |
400 | All the ticket didn't come from the same ticket bundle | No Content |
401 | Unauthorised | No Content |
Produces
application/json
Tags
- ticket
Get ticket bundle
GET /ticketbundle/{ticketBundleId}
Description
Get ticket bundle specified by the ticket bundle identifier
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header | X-BoB-AuthToken | JWT authentication token | string |
Path | ticketBundleId | Ticket bundle id | string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 | Successful operation | |
401 | Unauthorised | No Content |
404 | Ticket bundle not found | No Content |
Produces
application/json
Tags
- ticket
Definitions
deviceReference
Device Reference, unique reference for device that creates device signed tickets
Name | Description | Schema |
---|---|---|
did | Device identifier | string (base64url) |
pid | Participant identifier | integer (int64) |
fare
Fare information, amount, currency and VAT
Name | Description | Schema |
---|---|---|
amount | Fare cost excluding VAT | number (float) |
currency | Currency code (ISO 4217) | string |
vatAmount | VAT amount | number (float) |
vatPercent | VAT percent | number (float) |
geoPosition
Geographical position (WGS84 decimal)
Name | Description | Schema |
---|---|---|
alt | Altitude | number (double) |
lat | Latitude | number (double) |
long | Longitude | number (double) |
manifestCall
Manifest with parameter to be used for issuing tickets
Name | Description | Schema |
---|---|---|
bookingId | Booking identifier from Booking API | string |
issueMtb | Set to true to return MTB when tickets are issued | boolean |
manifestMtbTemplate | Signed manifest with MTB template | string (base64url) |
recoverTicketId | ID of ticket in recover state to be recovered in operation | string |
requestId | Request identifier allocated by manifest requestor | string |
startOfValidity | Request start of validity set in the future (must be within the validity time of the manifest). Time stamp in ISO 8601 format. | string (date-time) |
ticketHolder | Traveller to register as ticket holder |
mtbReference
MTB reference
Name | Description | Schema |
---|---|---|
issuerSignature | MTB issuer signature | string (base64url) |
pid | Participant identifier | integer (int64) |
recoverStatus
Recover status
Name | Description | Schema |
---|---|---|
recovered | True if ticket is in recovered state | boolean |
recoveredAmount | Fare recovered |
recoverableStatus
Tells if ticket is recoverable and amount recoverable
Name | Description | Schema |
---|---|---|
recoverable | Is ticket recoverable | boolean |
recoverableAmount | Recovereable fare |
refundStatus
Refund status
Name | Description | Schema |
---|---|---|
refunded | True if ticket is in refunded state | boolean |
refundedAmount | Fare refunded |
refundableStatus
Tells if ticket is refundable and amount refundable
Name | Description | Schema |
---|---|---|
refundable | Is ticket refundable | boolean |
refundableAmount | Refundable fare |
ticket
Ticket data and status
Name | Description | Schema |
---|---|---|
activeStatus | Ticket active status | |
issuedAt | Time stamp in ISO 8601 format | string (date-time) |
mtb | Signed MTB container | string (base64url) |
recoverStatus | Ticket recover status | |
refundStatus | Ticket refund status | |
refundableStatus | Ticket refundable status | |
ticketHolder | Ticket holder | |
ticketId | Unique identifier for ticket | string |
ticketPayload | Ticket payload as base64url encoded JSON | string (base64url) |
ticketActiveStatus
True if ticket is active and ready to use, otherwise false.
Type : boolean
ticketBundle
A group of tickets. All tickets must come from the same manifest
used to issue the tickets.
Name | Description | Schema |
---|---|---|
manifestId | Unique manifest identifier for issued tickets | string |
mtb | Signed MTB container | string (base64url) |
settlementId | Unique settlement identifier for tickets in bundle | string |
ticketBundleId | Unique ticket bundle identifier | string |
ticketIds | Array of identifiers to tickets in bundle | < string > array |
ticketBundleRequest
List of ticket identifiers of tickets to be included in ticket bundle
Name | Description | Schema |
---|---|---|
ticketIds | List ticket identifiers | < string > array |
ticketEvent
Ticket event data from inspection or validator device
Name | Description | Schema |
---|---|---|
deviceReference | Device Reference, unique reference for device that creates device signed tickets | |
eventId | Event identifier (allocated at event creation) | string |
eventReason | Reason for failure/success | string |
eventResult | 0 = success | integer |
eventType | Type of event, inspection or validation | enum (inspection, validation) |
geo | Geographical position (WGS84 decimal) | |
localEventId | Event identifier (allocated at validation/inspection) | string |
modeOfTransport | Mode of transport. Ex. bus, train or tram. | string |
mtbReference | MTB reference | |
operatingDayDate | Date of the operating day | string (date) |
service | Service information | |
stopArea | Stop area information | |
ticketId | Unique identifier for ticket | string |
time | Time stamp in ISO 8601 format | string (date-time) |
validator | ||
zone | Zone information |
service
Name | Description | Schema |
---|---|---|
blockId | Block identifier | string |
pid | Participant identifier associated with service, trip and block | integer (int64) |
serviceId | Service identifier | string |
tripId | Trip identifier | string |
stopArea
Name | Description | Schema |
---|---|---|
nextStopAreaId | Identifier for next stop area | string |
pid | Participant identifier associated with stop area | integer (int64) |
stopAreaId | Identifier for current stop area | string |
validator
Name | Description | Schema |
---|---|---|
location | Where is validator mounted (vehicle, platform, camel) | string |
sublocation | More specific location information (e.g., door) | string |
validatorId | What validator originated the event | string |
zone
Name | Description | Schema |
---|---|---|
pid | Participant identifier associated with zone | integer (int64) |
zoneId | Zone identifier | string |
ticketEventResult
The result of a ticket inspection or validation operation registration
Name | Description | Schema |
---|---|---|
ticketEvent | ||
ticketEventInspectMessage | Message to be presented to inspector when registering an inspection event | string |
ticketEventPassengerMessage | Message to be presented to passenger when registering an inspection | string |
ticketEventStatus | Status code for inspection or validation event. This is normally the same | integer (int32) |
ticketMetadata |
ticketHolder
Ticket holders name and identifier
Name | Description | Schema |
---|---|---|
travellerId | Unique traveller identifier | string |
travellerName | Display name of traveller | string |
ticketIssueResponse
Name | Description | Schema |
---|---|---|
settlementId | Unique settlement identifier for issued tickets | string |
ticketBundle | ||
ticketIds | Array of identifiers to issued tickets | < string > array |
ticketMetadata
Metadata associated with a ticket
Name | Description | Schema |
---|---|---|
relativeValidityStart | Start of ticket validity period in ISO 8601 format | string (date-time) |
ticketEventIds | List of all event identifiers associated with this ticket | < string > array |
travellerPhotoURL | URL to photo of traveller | string |