Skip to content

Instantly share code, notes, and snippets.

@linusnorton
Last active October 6, 2016 08:54
Show Gist options
  • Save linusnorton/1b7c7687c67ffaf85440 to your computer and use it in GitHub Desktop.
Save linusnorton/1b7c7687c67ffaf85440 to your computer and use it in GitHub Desktop.

Order

"/order/123"
{
  "delivery": { 
    "type": "/data/delivery-types/123",
    "fulfilmentMethod": "/data/fulfilment-methods/00005",
  },
  "nlc": "/data/stations/H123",
  "purchaseDate": "2015-12-05T13:11:59Z",
  "collectionReference": "1234ABCD",
  "billingAddress": { },
  "products": [
    "/orders/123/trips/123",
    "/orders/123/trips/124",
    "/orders/123/trips/123",
    "/orders/123/sundries/123",
    "/orders/123/sundries/124"
  ],
  "payments": [
    "/orders/123/payments/230"
  ],
  "reservation" : "/orders/123/trips/123/reservations/5555",
  "customer": null
}

Trip/Journey Plan

"/orders/123/trips/123" / "/orders/123/journeyplan/123"
{
  "outwardJourney": "/orders/123/trips/123/journeys/56789",
  "returnJourney": null,
  "plusbus": null,
  "reservation": "/orders/123/trips/123/reservations/5555",
  "passengers": [
    {
      "type": "Adult",
      "ticket": "/orders/123/trips/123/journeys/56789/tickets/10000",
      "railcard": "/data/railcards/YNG"
    },
    {
      "type": "Adult",
      "ticket": "/orders/123/trips/123/journeys/56789/tickets/10001",
      "railcard": null
    }
  ]
}

Journey (Real Time to add)

"/orders/123/trips/123/journeys/56789"
{
  "outwardJourney": "/orders/123/trips/123/journeys/56789",
  "returnJourney": null,
  "plusbus": null,
  "reservation": "/orders/123/trips/123/reservations/5555",
  "legs": [
    "/orders/123/trips/123/journeys/56789/legs/123",
    "/orders/123/trips/123/journeys/56789/legs/124"
  ]
}

Reservation

"/orders/123/trips/123/reservations/5555"
{
  "nrsReference": "something",
  "created": "2015-12-05T13:11:59Z",
  "legs": [
    "/orders/123/trips/123/journeys/56789/legs/123",
    "/orders/123/trips/123/journeys/56789/legs/124"
  ]
}

Leg

"/orders/123/trips/123/journeys/56789/legs/123"
{
  "origin": {
    "name": "A to B",
    "nlc": 1027,
    "crs": "BTO",
    "latitude": 123,
    "longintude": 456,
    "address": "Liverpool St, London EC2M 7QH",
    "facilities": [],
    "categories": [
      "NationalRail",
      "LondonUnderground"
    ],
    "plusBusNlc": 1027,
    "gazetteer": {
      "londonZones":[],
      "westMidlandsZone": 12,
      "withinGoldcardArea": true,
      "smartcardsAvailable": true,
      "isZonalOrGroup": true,
      "isOpen": true,
      "isClosed": false, // ???
      "isOpeningSoon": false,
      "openingDate": "2015-12-05T13:11:59Z"
    },
    "detailedFacilities": "/facilities/123"
  },
  "destination": {
    "name": "A to B",
    "nlc": 1027,
    "crs": "BTO",
    "latitude": 123,
    "longintude": 456,
    "address": "Liverpool St, London EC2M 7QH",
    "facilities": [],
    "categories": [
      "NationalRail",
      "LondonUnderground"
    ],
    "plusBusNlc": 1027,
    "gazetteer": {
      "londonZones":[],
      "westMidlandsZone": 12,
      "withinGoldcardArea": true,
      "smartcardsAvailable": true,
      "isZonalOrGroup": true,
      "isOpen": true,
      "isClosed": false, // ???
      "isOpeningSoon": false,
      "openingDate": "2015-12-05T13:11:59Z"
    },
    "detailedFacilities": "/facilities/123"
  },
  "serviceDetails": {
    "mode": "Train",
    "retailServiceId": "abcdef",
    "trainUid": "abc",
    "iptisTripIdentifier": "abc",
    "toc": "/data/tocs/SE",
    "reservable": "Possible",
    "facilities": {
      "firstClass": true,
      "firstClassMeal": true,
      "firstClassRestaurant": true,
      "hotFood": true,
      "buffet": false,
      "restaurant": true,
      "trolley": true,
      "wheelchair": true
    },
    "isTemporaryTrain": false,
    "isCountedPlace": false,
    "transferAdvice": []
  },
  "callingPoints": "",
  "fixed": false,
  "transferTime": 0,
  "reservable": ["Recommended"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment