maas-schemas

response Schema

http://maasglobal.com/tsp/booking-create/response.json

Response schema for creating a booking through a TSP adapter

Abstract Extensible Status Identifiable Custom Properties Additional Properties Defined In
Can be instantiated No Develop No Forbidden Forbidden tsp/booking-create/response.json

Schema Hierarchy

response Example

{
  "leg": {
    "from": {
      "name": "Siltasaarenkatu 1, Helsinki",
      "address": "streetName:Siltasaarenkatu|streetNumber:1|city:Helsinki|zipCode:00530|country:Suomi",
      "lat": 60.177252,
      "lon": 24.950388
    },
    "to": {
      "name": "Ida Aalbergin tie 3, Helsinki",
      "address": "streetName:Ida%20Aalbergin%20tie|streetNumber:1|city:Helsinki|zipCode:00400|country:Suomi",
      "lat": 60.231538,
      "lon": 24.892568
    },
    "startTime": 1572440451838,
    "endTime": 1572441571838,
    "mode": "TAXI",
    "departureDelay": 900000
  },
  "customer": {
    "email": "test@example.com",
    "phone": "+358400001010",
    "locale": "en",
    "clientId": "whim",
    "lastName": "Tester",
    "opaqueId": "cafecaca",
    "firstName": "Test"
  },
  "state": "RESERVED",
  "tspId": "deadbeefdeadbeefdeadcafebeef",
  "terms": {
    "reusable": false,
    "validity": {
      "endTime": 1572355249017,
      "startTime": 1572355193128
    },
    "reconcilable": false
  },
  "tspProduct": {
    "id": "testtaxi1-product1"
  },
  "meta": {
    "MODE_TAXI": {
      "driver": {},
      "taxiCenter": {
        "name": "Taksi Test1",
        "phone": "+358400001010"
      },
      "vehicleType": "any"
    }
  },
  "cost": {
    "amount": 22,
    "currency": "EUR"
  },
  "tspProductId": "testtaxi1-product1",
  "token": {}
}

response Properties

Property Type Required Nullable Defined by
configurator configurator Optional No response (this schema)
cost cost Optional No response (this schema)
customer customer Optional No response (this schema)
customerSelection customerSelection Optional No response (this schema)
leg object Optional No response (this schema)
meta booking-meta Required No response (this schema)
state enum Required No response (this schema)
terms terms Required No response (this schema)
token object Required No response (this schema)
tspId string Required No response (this schema)
tspProduct object Required No response (this schema)

configurator

configurator

configurator Type

cost

cost

cost Type

customer

MaaS booking customer

customer

customer Type

customerSelection

customerSelection

customerSelection Type

leg

A subset of the standard leg (../core/leg.json)

leg

leg Type

object with following properties:

Property Type Required
agencyId   Optional
departureDelay   Optional
endTime   Required
from   Required
mode   Required
startTime   Required
to   Required

agencyId

agencyId

agencyId Type

departureDelay

departureDelay

departureDelay Type

endTime

endTime

endTime Type

from

Starting location’s lat and lon pair of this request

from

from Type

mode

mode

mode Type

startTime

startTime

startTime Type

to

to

to Type

meta

meta

meta Type

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  

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

tspProduct

Defines what kind of TSP product the booking option represents.

tspProduct

tspProduct Type

object with following properties:

Property Type Required
id string Required

id

Unique identifier for the product

id

id Type

string