maas-schemas

booking Schema

http://maasglobal.com/core/booking.json

The base booking object with all fields, to be inherited

Abstract Extensible Status Identifiable Custom Properties Additional Properties Defined In
Can be instantiated Yes Develop No Forbidden Permitted core/booking.json

Schema Hierarchy

booking Example

{
  "id": "12345678-ABCD-1234-ABCD-123456789ABC",
  "state": "EXPIRED",
  "leg": {
    "to": {
      "lat": 60.184333,
      "lon": 24.835972,
      "name": "Otaranta 6, Espoo",
      "address": "streetName:Otaranta|streetNumber:6|city:Espoo|zipCode:02150|country:Suomi"
    },
    "from": {
      "lat": 60.168442,
      "lon": 24.932205,
      "name": "Urho Kekkosen katu 1, Helsinki",
      "address": "streetName:Urho Kekkosen katu|streetNumber:1|city:Helsinki|zipCode:00100|country:Suomi"
    },
    "mode": "TAXI",
    "endTime": 1553092978009,
    "agencyId": "Valopilkku",
    "startTime": 1553092978009,
    "departureDelay": 123456
  },
  "token": {
    "type": "SECURITY_CODE",
    "value": "12345"
  },
  "terms": {
    "reusable": false,
    "validity": {
      "endTime": 1553092978009,
      "startTime": 1553092978009
    },
    "reconcilable": false
  },
  "meta": {
    "raw": {
      "data": {
        "lat": 60.168442,
        "lon": 24.932205,
        "vehicle_id": "123"
      },
      "order_id": 12345,
      "timestamp": "2019-03-20T10:10:12+00:00",
      "localized_description": "Tilaus on valmis."
    },
    "MODE_TAXI": {
      "vehicleId": "123",
      "taxiCenter": {
        "name": "Lähitaksi",
        "phone": "+3581007300"
      },
      "vehicleType": "any",
      "vehicleLocation": {
        "lat": 60.245254,
        "lon": 24.989604
      }
    },
    "timestamp": 1553092978009,
    "valopilkku": {
      "prepaid": true,
      "locations": [
        {
          "type": "pickup",
          "address": {
            "city": "Helsinki",
            "street_address": "Urho Kekkosen katu 1"
          },
          "contacts": [
            {
              "name": "John Doe",
              "passenger_count": 1,
              "provider_order_id": "MaaS-12345"
            }
          ],
          "coordinate": {
            "lat": 60.168442,
            "lon": 24.932205
          },
          "passenger_count": 1
        },
        {
          "type": "destination",
          "address": {
            "city": "Espoo",
            "street_address": "Otaranta 6"
          },
          "drop_off": ["MaaS-12345"],
          "coordinate": {
            "lat": 60.184333,
            "lon": 24.835972
          },
          "passenger_count": 1
        }
      ],
      "submitted": "2019-03-21T11:13:19.753Z"
    },
    "description": "Tilaus on valmis."
  },
  "created": "2019-03-20 10:10:12.123456",
  "modified": "2019-03-20 18:30:12.123456",
  "cost": {
    "amount": 0,
    "currency": "EUR"
  },
  "stateLog": [
    {
      "reason": {},
      "invalid": false,
      "newState": "PENDING",
      "oldState": "START",
      "timestamp": 1553092178009
    },
    {
      "reason": {},
      "invalid": false,
      "newState": "PAID",
      "oldState": "PENDING",
      "timestamp": 1553092278009
    },
    {
      "reason": {},
      "invalid": false,
      "newState": "RESERVED",
      "oldState": "PAID",
      "timestamp": 1553092378009
    },
    {
      "reason": {},
      "invalid": false,
      "newState": "CONFIRMED",
      "oldState": "RESERVED",
      "timestamp": 1553092478009
    },
    {
      "reason": {},
      "invalid": false,
      "newState": "ACTIVATED",
      "oldState": "CONFIRMED",
      "timestamp": 1553092578009
    },
    {
      "reason": {},
      "invalid": false,
      "newState": "EXPIRED",
      "oldState": "ACTIVATED",
      "timestamp": 1553092678009
    }
  ],
  "productId": "valopilkku-any",
  "fares": [
    {
      "type": "charge",
      "amount": 1000,
      "currency": "WMP",
      "productionAmount": 1234
    }
  ],
  "cancelling": false,
  "customer": {
    "identityId": "eu-west-1:4828507e-683f-41bf-9d87-689808fbf958"
  }
}

booking Definitions

Property Type Group
agencyId agencyId http://maasglobal.com/core/booking.json#/definitions/leg
arrivalDelay arrivalDelay http://maasglobal.com/core/booking.json#/definitions/leg
data object http://maasglobal.com/core/booking.json#/definitions/token
departureDelay departureDelay http://maasglobal.com/core/booking.json#/definitions/leg
distance distance http://maasglobal.com/core/booking.json#/definitions/leg
endTime endTime http://maasglobal.com/core/booking.json#/definitions/leg
from from http://maasglobal.com/core/booking.json#/definitions/leg
legGeometry legGeometry http://maasglobal.com/core/booking.json#/definitions/leg
mode mode http://maasglobal.com/core/booking.json#/definitions/leg
productOption productOption http://maasglobal.com/core/booking.json#/definitions/leg
route route http://maasglobal.com/core/booking.json#/definitions/leg
routeLongName routeLongName http://maasglobal.com/core/booking.json#/definitions/leg
routeShortName routeShortName http://maasglobal.com/core/booking.json#/definitions/leg
startTime startTime http://maasglobal.com/core/booking.json#/definitions/leg
stops stops http://maasglobal.com/core/booking.json#/definitions/leg
to to http://maasglobal.com/core/booking.json#/definitions/leg
tspProduct tspProduct http://maasglobal.com/core/booking.json#/definitions/leg
validityDuration object http://maasglobal.com/core/booking.json#/definitions/token

agencyId

agencyId

agencyId Type

arrivalDelay

arrivalDelay

arrivalDelay Type

data

Arbitrary ticket data for the client

data

data Type

object with following properties:

| Property | Type | Required | | ——– | —- | ——– |

departureDelay

departureDelay

departureDelay Type

distance

distance

distance Type

endTime

endTime

endTime Type

from

from

from Type

legGeometry

legGeometry

legGeometry Type

mode

mode

mode Type

productOption

productOption

productOption Type

route

route

route Type

routeLongName

routeLongName

routeLongName Type

routeShortName

routeShortName

routeShortName Type

startTime

startTime

startTime Type

stops

stops

stops Type

to

to

to Type

tspProduct

tspProduct

tspProduct Type

validityDuration

The rules that MaaS will interpret to schedule, re-validate or cancel the booking.

validityDuration

validityDuration Type

object with following properties:

Property Type Required
endTime   Optional
startTime   Optional

endTime

The finishing time the ticket is valid for

endTime

endTime Type

startTime

The starting time from which the ticket is valid

startTime

startTime Type

booking Properties

Property Type Required Nullable Defined by
configurator configurator Optional No booking (this schema)
cost cost Optional No booking (this schema)
customer complex Required No booking (this schema)
customerSelection customerSelection Optional No booking (this schema)
fares fare Optional No booking (this schema)
id id Required No booking (this schema)
leg object Required No booking (this schema)
meta booking-meta Required No booking (this schema)
product product Optional No booking (this schema)
signature string Optional No booking (this schema)
state enum Required No booking (this schema)
stateLog state-log Optional No booking (this schema)
terms terms Required No booking (this schema)
token object Required No booking (this schema)
tspId string Optional No booking (this schema)
* any Additional Yes this schema allows additional properties

configurator

configurator

configurator Type

cost

cost

cost Type

customer

MaaS booking customer

customer

customer Type

All of the following requirements need to be fulfilled.

Requirement 1

Requirement 2

customerSelection

customerSelection

customerSelection Type

fares

fares

fares Type

Array type: fare

All items must be of the type:

id

id

id Type

leg

MaaS response may return any subset of legCore

leg

leg Type

object with following properties:

Property Type Required
agencyId   Optional
arrivalDelay   Optional
departureDelay   Optional
distance   Optional
endTime   Optional
from   Optional
legGeometry   Optional
mode   Optional
productOption   Optional
route   Optional
routeLongName   Optional
routeShortName   Optional
signature   Optional
startTime   Optional
state   Optional
stops   Optional
to   Optional
tspProduct   Optional

agencyId

agencyId

agencyId Type

arrivalDelay

arrivalDelay

arrivalDelay Type

departureDelay

departureDelay

departureDelay Type

distance

distance

distance Type

endTime

endTime

endTime Type

from

from

from Type

legGeometry

legGeometry

legGeometry Type

mode

mode

mode Type

productOption

productOption

productOption Type

route

route

route Type

routeLongName

routeLongName

routeLongName Type

routeShortName

routeShortName

routeShortName Type

signature

signature

signature Type

startTime

startTime

startTime Type

state

state

state Type

stops

stops

stops Type

to

to

to Type

tspProduct

tspProduct

tspProduct Type

meta

meta

meta Type

product

product

product Type

signature

Signature of a signed object

signature

signature Type

string

state

The life-cycle state of a booking

state

The value of this property must be equal to one of the known values below.

state Known Values

Value Description
START  
PENDING  
PAID  
RESERVED  
CONFIRMED  
ARRIVED  
ACTIVATED  
ON_HOLD  
CANCELLED  
EXPIRED  
REJECTED  
FINISHED  
UNKNOWN  

stateLog

stateLog

stateLog Type

terms

terms

terms Type

token

The validity token (such as booking ID, travel ticket etc.) that MaaS clients will display to validate the trip when starting the leg.

token

token Type

object with following properties:

Property Type Required
data object Optional
meta object Optional
validityDuration object Optional

data

Arbitrary ticket data for the client

data

data Type

object with following properties:

| Property | Type | Required | | ——– | —- | ——– |

meta

Arbitrary metadata the TSP may pass along the ticket to the client (e.g. a booking code, base64 encoded binary)

meta

meta Type

object with following properties:

| Property | Type | Required | | ——– | —- | ——– |

validityDuration

The rules that MaaS will interpret to schedule, re-validate or cancel the booking.

validityDuration

validityDuration Type

object with following properties:

Property Type Required
endTime   Optional
startTime   Optional

endTime

The finishing time the ticket is valid for

endTime

endTime Type

startTime

The starting time from which the ticket is valid

startTime

startTime Type

tspId

tspId

tspId Type

string