Assertis APIs

Rail, it's in our DNA

WebTis API
Documentation

Introduction

The Assertis WebTIS (AWT) API is a RESTful JSON API that enables customers to plan rail journeys and buy rail tickets for travel on the British rail network.

Using the API, customers can plan a journey from any National Rail station to any other. The API also enables customers to buy any ticket - Advance, Off-Peak, Anytime as well as group tickets, carnets, packages and season tickets - to and from any station up to three months before travel. Travelcards, zonal tickets, other TfL and metro products and Plusbus are also supported, as are all railcard discounts, reservations and child fares. Fares and journey planning can be delivered separately, as well as together.

The API supports basket functionality and secure payment with Visa, MasterCard, Amex and other payment cards, PayPal and payment on account. Customers can have their tickets printed and posted; collect them from stations; or print them at home / send them to their phone for some routes.

The API also offers order management, comprehensive rail reference data and refunds through the customer administration service.

All the data that the API uses is from rail-industry approved sources, updated daily in the case of fares and train schedules, and fully in line with industry best practice. The API is accredited by the Rail Delivery Group (RDG), which represents all of the Train Operating Companies (TOCs) and Network Rail (the infrastructure provider) in Britain.

Getting started

Your account manager will provide you with a URL for your dedicated test environment. The test environment will be a fully functional system integrated with test versions of all rail systems except LENNON.

Test card numbers will be provided that can be used to complete purchases. After a successful payment fulfilment will be completed.

Support queries and service issues can be sent via your account manager or to techsupport@assertis.co.uk.

If you wish to perform load testing please provide 24 hours notice.

Protocols

The API itself is a collection of microservices grouped together under a single domain using HAProxy. It is built using REST principles which ensures predictable URLs that makes writing applications easy. This API follows HTTP rules, enabling a wide range of HTTP clients can be used to interact with the API.

Every resource is exposed as a URL. The URL of each resource can be obtained by accessing the API Root Endpoint.

All requests and responses are in JSON. The structure of each request and response is outlined with examples and a JSON-Schema. In general the responses are similar to the standard JSON API design but links are condensed.

For example:

  
    GET /customer/1
  

Would return:

  
    {
      "status": "success",
      "data": {
        "title": "Mr",
        "firstNames": "John",
        "surname": "Smith",
        "email": "john.smith@example.org",
        "emailMarketing": false,
        "smsMarketing": false,
        "telephoneNumber": "+447754000000",
        "created": "2015-05-06T09:54:06Z",
        "login": "2015-05-06T09:54:06Z",
        "updated": "2015-05-06T09:54:06Z",
        "firstPurchase": "2015-05-06T09:54:06Z",
        "addresses": [
          "/address/2"
        ]
      },
      "links": {
        "/address/2": {
          "title": "Mr",
          "firstNames": "John",
          "surname": "Smith",
          "address1": "123 Test Street",
          "address2": "Another Street",
          "address3": null,
          "town": "Town",
          "county": null,
          "country": "United Kingdom",
          "postCode": "TE57 1NG",
          "telephoneNumber": "+447754000000"
        }
      }
    }
  

Any properties that contain a link to another entity (in this case /address/2) are automatically populated in the links section of the response.

Callbacks

There are additional call backs from the AWT that are not documented here as they usually contain a bespoke payload.

The available callbacks are:

Security

The API is only available via HTTPS. Certificates are signed by Let's Encrypt.

Some parts of the API may be publically available and may be used by end clients (SPA applications / Mobile devices), other parts are restricted by IP. In addition to this some resources are restricted by access token.

Where an access token is required it must be provided by HTTP header. For example

  
    X-Auth-Token: "a1b2c3d4e5f6g7h8i9j0"
  

Reference data

Reference data is provided inline in the API responses as part of the links section. If there is a need to cache it on the client it can be cached for 24 hours.

Reference data is updated nightly between 03:00am and 04:00am.

Expiry headers

You should pay attention to Expires headers returned when order is created or modified. Various rules are in place to ensure basket validity conforms to industry standards.

Auth

Auth Service API

Auth service generates tokens to be used in authorization / authentication in other services.

POST /auth

Request schema (show)
{
    "description": "Auth service token generation request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "vendor",
        "text",
        "signature"
    ],
    "properties": {
        "vendor": {
            "type": "string",
            "description": "Vendor name that exchanged with us its public key"
        },
        "text": {
            "type": "string",
            "description": "Text to be verified against signature"
        },
        "signature": {
            "type": "string",
            "description": "Base64 of signature to verify"
        },
        "userId": {
            "type": "string",
            "description": "Optional user id that match some of our customers e.g. /users/{id}"
        },
        "username": {
            "type": "string",
            "description": "Optional username"
        },
        "password": {
            "type": "string",
            "description": "Optional password"
        },
        "twoFactorCode": {
            "type": "string",
            "description": "Optional 2factor code"
        },
        "expiry": {
            "type": "number",
            "description": "Optional expiry time in hours"
        }
    }
}
Request example (show)
{
    "vendor": "vendor",
    "text": "1561b543-ec80-461b-b55b-43b9ff2a03a8",
    "signature": "rLMwGb6mEAEBimzg0+f7Mi//s6ypkLvAhJ2C99u6OS0+iQ6t==",
    "userId": "/users/14"
}
200 application/json
Response schema (show)
{
    "description": "Auth Serivce token response",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "token": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "token"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "token": "eyJhbGciOiJIUzI1NiI.eyJzZXNzaW9uSWQiOiIiwidGVuYW5.niCtFnxnL-Z5jUYafohiN7SSO2coL"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "vendor": "must not be empty"
    }
}
401 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Error occured during signature validation. Check your vendor and tenent header"
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Passed vendor / user / token does not match with the token"
    }
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

Reference Data

Introduction

Welcome to the Reference Data API Documentation. The API allows you to fetch information about entities common for all parts of TIS. This service agreggate data supplied by external providers.

GET /railcard

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "code": {
                                "$oneOf": [
                                    {
                                        "type": "string",
                                        "pattern": "^[A-Z0-9]{3}$"
                                    },
                                    {
                                        "type": "string",
                                        "pattern": "^$"
                                    }
                                ]
                            },
                            "description": {
                                "type": "string"
                            },
                            "name": {
                                "type": "object",
                                "properties": {
                                    "display": {
                                        "type": "string"
                                    },
                                    "print": {
                                        "type": "string"
                                    }
                                }
                            },
                            "status": {
                                "type": "object",
                                "properties": {
                                    "adult": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "child": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                }
                            },
                            "minPassengers": {
                                "type": "integer"
                            },
                            "maxPassengers": {
                                "type": "integer"
                            },
                            "minHolders": {
                                "type": "integer"
                            },
                            "maxHolders": {
                                "type": "integer"
                            },
                            "minAdults": {
                                "type": "integer"
                            },
                            "maxAdults": {
                                "type": "integer"
                            },
                            "minChildren": {
                                "type": "integer"
                            },
                            "maxChildren": {
                                "type": "integer"
                            },
                            "minAccAdults": {
                                "type": "integer"
                            },
                            "maxAccAdults": {
                                "type": "integer"
                            },
                            "quoteDate": {
                                "type": "string"
                            },
                            "startDate": {
                                "type": "string"
                            },
                            "endDate": {
                                "type": "string"
                            },
                            "lastValidDate": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        },
                        "required": [
                            "code",
                            "description",
                            "name",
                            "minPassengers",
                            "maxPassengers",
                            "minHolders",
                            "maxHolders",
                            "minAdults",
                            "maxAdults",
                            "minChildren",
                            "maxChildren",
                            "minAccAdults",
                            "maxAccAdults",
                            "quoteDate",
                            "startDate",
                            "endDate",
                            "lastValidDate"
                        ]
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        {
            "code": "",
            "description": "PUBLIC",
            "name": {
                "display": "PUBLIC",
                "print": "PUBLIC"
            },
            "status": {
                "adult": "000",
                "child": "001"
            },
            "minPassengers": 0,
            "maxPassengers": 8,
            "minHolders": 0,
            "maxHolders": 8,
            "minAdults": 0,
            "maxAdults": 8,
            "minChildren": 0,
            "maxChildren": 8,
            "minAccAdults": 0,
            "maxAccAdults": 8,
            "quoteDate": "2020-12-01",
            "startDate": "2020-12-01",
            "endDate": "2020-12-01",
            "lastValidDate": null
        },
        {
            "code": "AT1",
            "description": "1YR DISABLED PERSONS",
            "name": {
                "display": "1YR DISABLED PERSONS.",
                "print": "1YR DISABLED PERSONS."
            },
            "status": {
                "adult": "003",
                "child": null
            },
            "minPassengers": 1,
            "maxPassengers": 2,
            "minHolders": 1,
            "maxHolders": 2,
            "minAdults": 1,
            "maxAdults": 2,
            "minChildren": 0,
            "maxChildren": 8,
            "minAccAdults": 0,
            "maxAccAdults": 0,
            "quoteDate": "2020-12-01",
            "startDate": "2020-12-01",
            "endDate": "2020-12-01",
            "lastValidDate": "2020-12-04"
        }
    ]
}
URI parameters

string id (required)

Pattern: ^[A-Z0-9]{3}$

GET /railcard/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "code": {
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^[A-Z0-9]{3}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^$"
                                }
                            ]
                        },
                        "description": {
                            "type": "string"
                        },
                        "name": {
                            "type": "object",
                            "properties": {
                                "display": {
                                    "type": "string"
                                },
                                "print": {
                                    "type": "string"
                                }
                            }
                        },
                        "status": {
                            "type": "object",
                            "properties": {
                                "adult": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "child": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        },
                        "minPassengers": {
                            "type": "integer"
                        },
                        "maxPassengers": {
                            "type": "integer"
                        },
                        "minHolders": {
                            "type": "integer"
                        },
                        "maxHolders": {
                            "type": "integer"
                        },
                        "minAdults": {
                            "type": "integer"
                        },
                        "maxAdults": {
                            "type": "integer"
                        },
                        "minChildren": {
                            "type": "integer"
                        },
                        "maxChildren": {
                            "type": "integer"
                        },
                        "minAccAdults": {
                            "type": "integer"
                        },
                        "maxAccAdults": {
                            "type": "integer"
                        },
                        "quoteDate": {
                            "type": "string"
                        },
                        "startDate": {
                            "type": "string"
                        },
                        "endDate": {
                            "type": "string"
                        },
                        "lastValidDate": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "code",
                        "description",
                        "name",
                        "minPassengers",
                        "maxPassengers",
                        "minHolders",
                        "maxHolders",
                        "minAdults",
                        "maxAdults",
                        "minChildren",
                        "maxChildren",
                        "minAccAdults",
                        "maxAccAdults",
                        "quoteDate",
                        "startDate",
                        "endDate",
                        "lastValidDate"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "code": "AT1",
        "description": "1YR DISABLED PERSONS",
        "name": {
            "display": "1YR DISABLED PERSONS.",
            "print": "1YR DISABLED PERSONS."
        },
        "status": {
            "adult": "003",
            "child": null
        },
        "minPassengers": 1,
        "maxPassengers": 2,
        "minHolders": 1,
        "maxHolders": 2,
        "minAdults": 1,
        "maxAdults": 2,
        "minChildren": 0,
        "maxChildren": 8,
        "minAccAdults": 0,
        "maxAccAdults": 0,
        "quoteDate": "2020-12-01",
        "startDate": "2020-12-01",
        "endDate": "2020-12-01",
        "lastValidDate": "2020-12-04"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Railcard ABC was not found"
}
URI parameters

string id (required)

Pattern: ^[0-9]{5}$

GET /route/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "required": [
                        "name",
                        "code",
                        "included",
                        "excluded",
                        "lul"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "type": "object",
                            "properties": {
                                "description": {
                                    "type": "string"
                                },
                                "aaaDescription": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "print": {
                                    "type": "string"
                                },
                                "display": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "description",
                                "print",
                                "display"
                            ]
                        },
                        "code": {
                            "type": "string",
                            "pattern": "^\\d{5}$"
                        },
                        "included": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/station/[0-9A-Z]{4}$"
                            }
                        },
                        "excluded": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/station/[0-9A-Z]{4}$"
                            }
                        },
                        "lul": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "code": "00000",
        "name": {
            "description": "ANY PERMITTED",
            "aaaDescription": null,
            "print": "Valid via any permitted route",
            "display": "Travel is allowed via any permitted route."
        },
        "included": [],
        "excluded": [
            "/station/0362"
        ],
        "lul": "NNNNNN-000000000000-_"
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Route 12345 was not found"
}
URI parameters

string code (required)

Pattern: ^[\d\w]{3}$

GET /rover-type/{code}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "required": [
                        "code",
                        "names"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "code": {
                            "type": "string",
                            "pattern": "^[\\d\\w]{3}$"
                        },
                        "names": {
                            "type": "object",
                            "required": [
                                "description",
                                "display"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "description": {
                                    "type": "string"
                                },
                                "display": {
                                    "type": "string"
                                }
                            }
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "code": "14R",
        "names": {
            "description": "ALL LINE ROVER 14DAY",
            "display": "All Line Rover 14 Days"
        }
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Rover XXX was not found"
}

GET /station

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "properties": {
                            "name": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "station": {
                                        "type": "string"
                                    },
                                    "location": {
                                        "type": "string"
                                    },
                                    "display": {
                                        "type": "string"
                                    },
                                    "print": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "station",
                                    "location",
                                    "display",
                                    "print"
                                ]
                            },
                            "code": {
                                "type": "object",
                                "additionalProperties": false,
                                "properties": {
                                    "nlc": {
                                        "type": "string",
                                        "pattern": "^[0-9A-Z]{4}$",
                                        "example": "5595"
                                    },
                                    "uic": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "crs": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{3}$",
                                        "example": "CLJ"
                                    },
                                    "tiploc": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^[0-9A-Z]+$",
                                                "example": "CLPHMJW"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ]
                                    },
                                    "tiploc_alternatives": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "pattern": "^[0-9A-Z]+$",
                                            "example": "CLPHMJW"
                                        }
                                    },
                                    "atco": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "nlc",
                                    "uic",
                                    "crs",
                                    "tiploc",
                                    "atco"
                                ]
                            },
                            "latitude": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "longitude": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            },
                            "facilities": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "groups": {
                                "oneOf": [
                                    {
                                        "type": "string",
                                        "pattern": "^/station/[0-9A-Z]{4}/groups$"
                                    },
                                    {
                                        "type": "array"
                                    }
                                ]
                            },
                            "members": {
                                "oneOf": [
                                    {
                                        "type": "string",
                                        "pattern": "^/station/[0-9A-Z]{4}$"
                                    },
                                    {
                                        "type": "array"
                                    }
                                ]
                            },
                            "londonTerminals": {
                                "oneOf": [
                                    {
                                        "type": "string",
                                        "pattern": "^/station/[0-9A-Z]{4}/london-terminals$"
                                    },
                                    {
                                        "type": "array"
                                    }
                                ]
                            },
                            "isGoldCardLocation": {
                                "type": "boolean"
                            },
                            "lul": {
                                "type": "string"
                            },
                            "zoneNo": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "zoneInd": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "locIdTypes": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                }
                            },
                            "fareGroup": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "code",
                            "latitude",
                            "longitude",
                            "facilities",
                            "groups",
                            "members",
                            "londonTerminals",
                            "isGoldCardLocation",
                            "lul",
                            "locIdTypes",
                            "fareGroup"
                        ]
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        {
            "name": {
                "station": "LONDON EUSTON",
                "location": "LONDON EUSTON",
                "display": "London Euston",
                "print": "London Euston"
            },
            "code": {
                "nlc": "1444",
                "uic": "7014440",
                "crs": "EUS",
                "tiploc": "EUSTON",
                "tiploc_alternatives": [
                    "EUSTON"
                ],
                "atco": "9100EUSTON"
            },
            "latitude": 51.528136,
            "longitude": -0.133924,
            "facilities": [
                "TVM"
            ],
            "groups": "/station/1444/groups",
            "members": [],
            "londonTerminals": "/station/1444/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-169000000000-_-0N006009S0",
            "zoneNo": "0027",
            "zoneInd": "1 ",
            "locIdTypes": [],
            "fareGroup": "1072"
        },
        {
            "name": {
                "station": "BESCOT STADIUM",
                "location": "BESCOT STADIUM",
                "display": "Bescot Stadium",
                "print": "Bescot Stadium"
            },
            "code": {
                "nlc": "1003",
                "uic": "7010030",
                "crs": "BSC",
                "tiploc": "BSCTSTA",
                "tiploc_alternatives": [
                    "BSCTSTA"
                ],
                "atco": "9100BSCTSTA"
            },
            "latitude": 52.563093,
            "longitude": -1.991105,
            "facilities": [
                "BO",
                "TVM"
            ],
            "groups": "/station/1003/groups",
            "members": [
                "/station/0011",
                "/station/0012"
            ],
            "londonTerminals": "/station/1003/london-terminals",
            "isGoldCardLocation": true,
            "lul": "NNNNNN-000000000000-_-0N009003S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "O"
            ],
            "fareGroup": "1003"
        }
    ]
}
URI parameters

string id (required)

NLC or CRS

Pattern: ^[0-9A-Z]{3,4}$

GET /station/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "name": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "station": {
                                    "type": "string"
                                },
                                "location": {
                                    "type": "string"
                                },
                                "display": {
                                    "type": "string"
                                },
                                "print": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "station",
                                "location",
                                "display",
                                "print"
                            ]
                        },
                        "code": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "nlc": {
                                    "type": "string",
                                    "pattern": "^[0-9A-Z]{4}$",
                                    "example": "5595"
                                },
                                "uic": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "crs": {
                                    "type": "string",
                                    "pattern": "^[A-Z]{3}$",
                                    "example": "CLJ"
                                },
                                "tiploc": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[0-9A-Z]+$",
                                            "example": "CLPHMJW"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "tiploc_alternatives": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "^[0-9A-Z]+$",
                                        "example": "CLPHMJW"
                                    }
                                },
                                "atco": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            },
                            "required": [
                                "nlc",
                                "uic",
                                "crs",
                                "tiploc",
                                "atco"
                            ]
                        },
                        "latitude": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "longitude": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "facilities": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "groups": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/station/[0-9A-Z]{4}/groups$"
                                },
                                {
                                    "type": "array"
                                }
                            ]
                        },
                        "members": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/station/[0-9A-Z]{4}$"
                                },
                                {
                                    "type": "array"
                                }
                            ]
                        },
                        "londonTerminals": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/station/[0-9A-Z]{4}/london-terminals$"
                                },
                                {
                                    "type": "array"
                                }
                            ]
                        },
                        "isGoldCardLocation": {
                            "type": "boolean"
                        },
                        "lul": {
                            "type": "string"
                        },
                        "zoneNo": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "zoneInd": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "locIdTypes": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "fareGroup": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "name",
                        "code",
                        "latitude",
                        "longitude",
                        "facilities",
                        "groups",
                        "members",
                        "londonTerminals",
                        "isGoldCardLocation",
                        "lul",
                        "locIdTypes",
                        "fareGroup"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "name": {
            "station": "LONDON EUSTON",
            "location": "LONDON EUSTON",
            "display": "London Euston",
            "print": "London Euston"
        },
        "code": {
            "nlc": "1444",
            "uic": "7014440",
            "crs": "EUS",
            "tiploc": "EUSTON",
            "tiploc_alternatives": [
                "EUSTON"
            ],
            "atco": "9100EUSTON"
        },
        "latitude": 51.528136,
        "longitude": -0.133924,
        "facilities": [
            "TVM"
        ],
        "groups": "/station/1444/groups",
        "members": [
            "/station/0011",
            "/station/0012"
        ],
        "londonTerminals": "/station/1444/london-terminals",
        "isGoldCardLocation": false,
        "lul": "NNNNNN-169000000000-_-0N006009S0",
        "zoneNo": "0027",
        "zoneInd": "1 ",
        "locIdTypes": [
            "S",
            "N"
        ],
        "fareGroup": "1072"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Station 1234 was not found"
}
URI parameters

string id (required)

NLC or CRS

Pattern: ^[0-9A-Z]{3,4}$

GET /station/{id}/london-terminals

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "londonTerminals": {
                        "type": [
                            "array",
                            "object"
                        ]
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "londonTerminals": {
            "00000": [
                "/station/1444",
                "/station/1475",
                "/station/3087"
            ],
            "00042": [
                "/station/1444"
            ],
            "00081": [
                "/station/1444"
            ],
            "00305": [
                "/station/1475",
                "/station/3087"
            ]
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Station 1234 was not found"
}
URI parameters

string id (required)

NLC or CRS or UIC

Pattern: ^[0-9A-Z]{3,7}$

GET /station/{id}/fulfilment-locations

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array"
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "633597013A05A4",
        "633597600905A4",
        "633597012205A4"
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Station 1234 was not found"
}
URI parameters

string id (required)

NLC or CRS

Pattern: ^[0-9A-Z]{3,4}$

GET /station/{id}/groups

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "groups": {
                        "type": [
                            "array"
                        ]
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "groups": [
            "/station/0032",
            "/station/0033",
            "/station/0034",
            "/station/0035",
            "/station/0051",
            "/station/0060",
            "/station/0064",
            "/station/0065",
            "/station/0785",
            "/station/0786",
            "/station/0790",
            "/station/0791",
            "/station/0792",
            "/station/1072",
            "/station/H107",
            "/station/K269"
        ]
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Station 1234 was not found"
}
URI parameters

string id (required)

NLC or CRS

Pattern: ^[0-9A-Z]{3,4}$

string secondId (required)

NLC or CRS

Pattern: ^[0-9A-Z]{3,4}$

string route (required)

Pattern: ^[0-9]{5}$

GET /station/{id}/permitted-stations/{secondId}/{route}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "members": {
                        "type": [
                            "array"
                        ]
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "members": [
            "/station/0032",
            "/station/0033",
            "/station/0034"
        ]
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Station 1234 was not found"
}
URI parameters

string id (required)

Pattern: ^[0-9A-Z]{3}$

GET /supplement-type/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "required": [
                        "code",
                        "type",
                        "capriCode",
                        "description",
                        "shortDescription",
                        "price",
                        "minGroup",
                        "maxGroup",
                        "class",
                        "isSeparateTicket",
                        "sundryCode",
                        "packageDirections"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "code": {
                            "type": "string",
                            "pattern": "^[A-Z0-9]{3}$"
                        },
                        "type": [],
                        "capriCode": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "description": {
                            "type": "string"
                        },
                        "shortDescription": {
                            "type": "string"
                        },
                        "price": {
                            "type": "integer"
                        },
                        "minGroup": {
                            "type": "integer"
                        },
                        "maxGroup": {
                            "type": "integer"
                        },
                        "class": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "isSeparateTicket": {
                            "type": "boolean"
                        },
                        "sundryCode": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        },
                        "packageDirections": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "code": "BIK",
        "type": "EXA",
        "capriCode": "ZAX",
        "description": "BICYCLE RESERVATION",
        "shortDescription": "CYCLE RES",
        "price": 500,
        "minGroup": 1,
        "maxGroup": 1,
        "class": 1,
        "isSeparateTicket": true,
        "sundryCode": 96094,
        "packageDirections": {
            "1SA": "E",
            "1SB": "O"
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string code (required)

Pattern: ^[A-Z0-9]{3}$

GET /ticket-type/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "name": {
                            "type": "object",
                            "properties": {
                                "display": {
                                    "type": "string"
                                },
                                "print": {
                                    "type": "string"
                                },
                                "description": {
                                    "type": "string"
                                }
                            }
                        },
                        "ccstFormat": {
                            "type": "string"
                        },
                        "code": {
                            "type": "string",
                            "pattern": "^[A-Z0-9]{3}$"
                        },
                        "isReturn": {
                            "type": "boolean"
                        },
                        "isSeason": {
                            "type": "boolean"
                        },
                        "isAdvance": {
                            "type": "boolean"
                        },
                        "isPackage": {
                            "type": "boolean"
                        },
                        "isCarnet": {
                            "type": "boolean"
                        },
                        "isFirstClass": {
                            "type": "boolean"
                        },
                        "reservationType": {
                            "type": "string",
                            "enum": [
                                "N",
                                "B",
                                "O",
                                "R",
                                "E"
                            ],
                            "description": "N = 'no' ; O = 'reservation required on outward journey' ; R = 'reservation required on inward journey ; B = 'reservation required on both outward and return journey' ; E = 'reservation required either outward or return journey'"
                        },
                        "validity": {
                            "type": "string",
                            "pattern": "^/validity\\-type/[0-9A-Z]{2}$"
                        },
                        "minPassengers": {
                            "type": "integer"
                        },
                        "maxPassengers": {
                            "type": "integer"
                        },
                        "minAdults": {
                            "type": "integer"
                        },
                        "maxAdults": {
                            "type": "integer"
                        },
                        "minChildren": {
                            "type": "integer"
                        },
                        "maxChildren": {
                            "type": "integer"
                        },
                        "utsCode": {
                            "type": "integer"
                        },
                        "timeRestriction": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 3
                        },
                        "capriCode": {
                            "type": "string",
                            "pattern": "^[A-Z]{3}$"
                        },
                        "canBeRetailed": {
                            "type": "boolean"
                        },
                        "ticketCategory": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "reservationSupplement": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "name",
                        "code",
                        "utsCode",
                        "timeRestriction",
                        "capriCode",
                        "canBeRetailed",
                        "ticketCategory"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "name": {
            "display": "Standard Open Single",
            "print": "standard open single",
            "description": "ANYTIME S"
        },
        "ccstFormat": "X01",
        "code": "SOS",
        "isReturn": false,
        "isSeason": true,
        "isAdvance": false,
        "isPackage": true,
        "isCarnet": false,
        "isFirstClass": false,
        "reservationType": "B",
        "validity": "/validity-type/AA",
        "minPassengers": 1,
        "maxPassengers": 1,
        "minAdults": 1,
        "maxAdults": 1,
        "minChildren": 0,
        "maxChildren": 0,
        "utsCode": 99,
        "timeRestriction": 0,
        "capriCode": "UAB",
        "canBeRetailed": true,
        "ticketCategory": "advance",
        "reservationSupplement": "CAX"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Ticket ABC was not found"
}
URI parameters

string id (required)

Pattern: ^[A-Z0-9]{2}$

GET /validity-type/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "additionalProperties": false,
                    "required": [
                        "code",
                        "outward",
                        "return",
                        "returnMustBeAfter"
                    ],
                    "properties": {
                        "code": {
                            "type": "string",
                            "pattern": "^[A-Z0-9]{2}$"
                        },
                        "outward": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "days",
                                "months",
                                "break",
                                "description"
                            ],
                            "properties": {
                                "days": {
                                    "type": "integer"
                                },
                                "months": {
                                    "type": "integer"
                                },
                                "break": {
                                    "type": "boolean"
                                },
                                "description": {
                                    "type": "string"
                                }
                            }
                        },
                        "return": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "days",
                                "months",
                                "break",
                                "description"
                            ],
                            "properties": {
                                "days": {
                                    "type": "integer"
                                },
                                "months": {
                                    "type": "integer"
                                },
                                "break": {
                                    "type": "boolean"
                                },
                                "description": {
                                    "type": "string"
                                }
                            }
                        },
                        "returnMustBeAfter": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "days",
                                "months",
                                "dayOfWeek"
                            ],
                            "properties": {
                                "days": {
                                    "type": "integer"
                                },
                                "months": {
                                    "type": "integer"
                                },
                                "dayOfWeek": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "code": "3E",
        "outward": {
            "days": 5,
            "months": 0,
            "break": true,
            "description": "FIVE DAYS"
        },
        "return": {
            "days": 0,
            "months": 1,
            "break": false,
            "description": "ONE MONTH"
        },
        "returnMustBeAfter": {
            "days": 1,
            "months": 0,
            "dayOfWeek": "Tuesday"
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Ticket Validity AA was not found"
}
URI parameters

string code (required)

Pattern: ^[A-Z\\*]{2}$

GET /toc/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "required": [
                        "code",
                        "name",
                        "description",
                        "active"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "code": {
                            "type": "string",
                            "pattern": "^[A-Z\\*]{2}$"
                        },
                        "name": {
                            "type": "string"
                        },
                        "description": {
                            "type": "string"
                        },
                        "active": {
                            "type": "boolean"
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "code": "AW",
        "name": "Transport For Wales Rail",
        "description": "Transport for Wales",
        "active": true
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Toc AA was not found"
}

Accepts two formats, late/123 and late/123/at/TIPLOC.

GET /darwin-reason/{data}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "code",
                        "text"
                    ],
                    "properties": {
                        "type": {
                            "type": "string",
                            "enum": [
                                "cancel",
                                "late"
                            ]
                        },
                        "code": {
                            "type": "string"
                        },
                        "range": {
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "type": "string",
                                    "enum": [
                                        "at",
                                        "near"
                                    ]
                                }
                            ]
                        },
                        "station": {
                            "oneOf": [
                                {
                                    "type": "null"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^/station/[0-9A-Z]{4}$"
                                }
                            ]
                        },
                        "text": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "late",
        "code": "100",
        "range": "at",
        "station": "/station/3813",
        "text": "This train has been delayed by a broken down train"
    },
    "links": {
        "/station/3813": []
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string code (required)

Pattern: ^[0-9A-Za-z]{3}$

GET /restriction/{code}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "required": [
                        "restrictionHeader",
                        "restrictionRailcard",
                        "restrictionTime",
                        "restrictionTimeDate",
                        "restrictionTimeToc",
                        "restrictionTrain",
                        "restrictionTrainDate",
                        "restrictionTrainQuota"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "restrictionHeader": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "description",
                                            "descOut",
                                            "descRtn",
                                            "typeOut",
                                            "typeRtn",
                                            "changeInd"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "description": {
                                                "type": "string"
                                            },
                                            "descOut": {
                                                "type": "string"
                                            },
                                            "descRtn": {
                                                "type": "string"
                                            },
                                            "typeOut": {
                                                "type": "string"
                                            },
                                            "typeRtn": {
                                                "type": "string"
                                            },
                                            "changeInd": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        },
                        "restrictionRailcard": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "railcardCode",
                                            "restrictionSequence",
                                            "ticketCode",
                                            "routeCode",
                                            "locationCrs",
                                            "totalBan",
                                            "startDate",
                                            "endDate"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "railcardCode": {
                                                "type": "string"
                                            },
                                            "restrictionSequence": {
                                                "type": "string"
                                            },
                                            "ticketCode": {
                                                "type": "string"
                                            },
                                            "routeCode": {
                                                "type": "string"
                                            },
                                            "locationCrs": {
                                                "type": "string"
                                            },
                                            "totalBan": {
                                                "type": "integer"
                                            },
                                            "startDate": {
                                                "type": "string"
                                            },
                                            "endDate": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        },
                        "restrictionTime": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "sequenceNo",
                                            "outRet",
                                            "timeFrom",
                                            "timeTo",
                                            "arrDepVia",
                                            "location",
                                            "rstrType",
                                            "trainType",
                                            "minFareFlag",
                                            "startDate",
                                            "endDate"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "sequenceNo": {
                                                "type": "string"
                                            },
                                            "outRet": {
                                                "type": "string"
                                            },
                                            "timeFrom": {
                                                "type": "string"
                                            },
                                            "timeTo": {
                                                "type": "string"
                                            },
                                            "arrDepVia": {
                                                "type": "string"
                                            },
                                            "location": {
                                                "type": "string"
                                            },
                                            "rstrType": {
                                                "type": "string"
                                            },
                                            "trainType": {
                                                "type": "string"
                                            },
                                            "minFareFlag": {
                                                "type": "string"
                                            },
                                            "startDate": {
                                                "type": "string"
                                            },
                                            "endDate": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        },
                        "restrictionTimeDate": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "sequenceNo",
                                            "outRet",
                                            "monday",
                                            "tuesday",
                                            "wednesday",
                                            "thursday",
                                            "friday",
                                            "saturday",
                                            "sunday",
                                            "startDate",
                                            "endDate"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "sequenceNo": {
                                                "type": "string"
                                            },
                                            "outRet": {
                                                "type": "string"
                                            },
                                            "monday": {
                                                "type": "integer"
                                            },
                                            "tuesday": {
                                                "type": "integer"
                                            },
                                            "wednesday": {
                                                "type": "integer"
                                            },
                                            "thursday": {
                                                "type": "integer"
                                            },
                                            "friday": {
                                                "type": "integer"
                                            },
                                            "saturday": {
                                                "type": "integer"
                                            },
                                            "sunday": {
                                                "type": "integer"
                                            },
                                            "startDate": {
                                                "type": "string"
                                            },
                                            "endDate": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        },
                        "restrictionTimeToc": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "sequenceNo",
                                            "outRet",
                                            "tocCode"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "sequenceNo": {
                                                "type": "string"
                                            },
                                            "outRet": {
                                                "type": "string"
                                            },
                                            "tocCode": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        },
                        "restrictionTrain": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "trainNo",
                                            "outRet",
                                            "location",
                                            "quotaInd",
                                            "arrDep",
                                            "sleeperInd",
                                            "startDate",
                                            "endDate"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "trainNo": {
                                                "type": "string"
                                            },
                                            "outRet": {
                                                "type": "string"
                                            },
                                            "location": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            },
                                            "quotaInd": {
                                                "type": "string"
                                            },
                                            "arrDep": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            },
                                            "sleeperInd": {
                                                "type": "string"
                                            },
                                            "startDate": {
                                                "type": "string"
                                            },
                                            "endDate": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        },
                        "restrictionTrainDate": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "trainNo",
                                            "outRet",
                                            "monday",
                                            "tuesday",
                                            "wednesday",
                                            "thursday",
                                            "friday",
                                            "saturday",
                                            "sunday",
                                            "startDate",
                                            "endDate"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "trainNo": {
                                                "type": "string"
                                            },
                                            "outRet": {
                                                "type": "string"
                                            },
                                            "monday": {
                                                "type": "integer"
                                            },
                                            "tuesday": {
                                                "type": "integer"
                                            },
                                            "wednesday": {
                                                "type": "integer"
                                            },
                                            "thursday": {
                                                "type": "integer"
                                            },
                                            "friday": {
                                                "type": "integer"
                                            },
                                            "saturday": {
                                                "type": "integer"
                                            },
                                            "sunday": {
                                                "type": "integer"
                                            },
                                            "startDate": {
                                                "type": "string"
                                            },
                                            "endDate": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        },
                        "restrictionTrainQuota": {
                            "type": "array",
                            "items": {
                                "allOf": [
                                    {
                                        "required": [
                                            "timeMarker",
                                            "restrictionCode",
                                            "trainNo",
                                            "outRet",
                                            "location",
                                            "quotaInd",
                                            "arrDep",
                                            "sleeperInd",
                                            "startDate",
                                            "endDate"
                                        ],
                                        "additionalProperties": false,
                                        "properties": {
                                            "timeMarker": {
                                                "type": "string"
                                            },
                                            "restrictionCode": {
                                                "type": "string"
                                            },
                                            "trainNo": {
                                                "type": "string"
                                            },
                                            "outRet": {
                                                "type": "string"
                                            },
                                            "location": {
                                                "type": "string"
                                            },
                                            "quotaInd": {
                                                "type": "string"
                                            },
                                            "arrDep": {
                                                "type": "string"
                                            },
                                            "sleeperInd": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            },
                                            "startDate": {
                                                "type": "string"
                                            },
                                            "endDate": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "restrictionHeader": [
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "description": "IEC OFF-PEAK",
                "descOut": "NOT VALID ARRIVING INTO LONDON BEFORE 1008 M-F",
                "descRtn": "NOT VALID FROM LONDON 0645-0759 M-F&1559-1745 M-TH",
                "typeOut": "P",
                "typeRtn": "N",
                "changeInd": "1"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "description": "IEC OFF-PEAK",
                "descOut": "NOT VALID ARRIVING INTO LONDON BEFORE 1008 M-F",
                "descRtn": "NOT VALID FROM LONDON 0645-0759 M-F&1559-1745 M-TH",
                "typeOut": "P",
                "typeRtn": "N",
                "changeInd": "1"
            }
        ],
        "restrictionRailcard": [
            {
                "timeMarker": "C",
                "restrictionCode": "BU",
                "railcardCode": "BUD",
                "restrictionSequence": "0001",
                "ticketCode": "",
                "routeCode": "",
                "locationCrs": "   ",
                "totalBan": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "BU",
                "railcardCode": "BUD",
                "restrictionSequence": "0001",
                "ticketCode": "",
                "routeCode": "",
                "locationCrs": "   ",
                "totalBan": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            }
        ],
        "restrictionTime": [
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "D",
                "location": "",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "D",
                "location": "",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0002",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "ZFD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0002",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "ZFD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "O",
                "timeFrom": "00:06:39",
                "timeTo": "00:10:47",
                "arrDepVia": "A",
                "location": "MKC",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "ZFD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0004",
                "outRet": "O",
                "timeFrom": "00:06:44",
                "timeTo": "00:10:44",
                "arrDepVia": "A",
                "location": "WFJ",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0004",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:50",
                "arrDepVia": "D",
                "location": "MKC",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "timeFrom": "00:07:20",
                "timeTo": "00:11:29",
                "arrDepVia": "A",
                "location": "EUS",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:37",
                "arrDepVia": "D",
                "location": "WFJ",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0006",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "A",
                "location": "BDM",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0006",
                "outRet": "R",
                "timeFrom": "00:14:39",
                "timeTo": "00:18:37",
                "arrDepVia": "D",
                "location": "WFJ",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0007",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:03",
                "arrDepVia": "A",
                "location": "LUT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0007",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:25",
                "arrDepVia": "D",
                "location": "EUS",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0008",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:02",
                "arrDepVia": "A",
                "location": "STP",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0008",
                "outRet": "R",
                "timeFrom": "00:15:01",
                "timeTo": "00:18:44",
                "arrDepVia": "D",
                "location": "EUS",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0009",
                "outRet": "O",
                "timeFrom": "00:01:00",
                "timeTo": "00:10:04",
                "arrDepVia": "A",
                "location": "PAD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0009",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:00",
                "arrDepVia": "D",
                "location": "BDM",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0010",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:56",
                "arrDepVia": "D",
                "location": "BTH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0010",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:00",
                "arrDepVia": "D",
                "location": "LUT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0011",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:03",
                "arrDepVia": "A",
                "location": "LTN",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0011",
                "outRet": "R",
                "timeFrom": "00:16:30",
                "timeTo": "00:18:58",
                "arrDepVia": "D",
                "location": "LUT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0012",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "BFR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0012",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:46",
                "arrDepVia": "D",
                "location": "STP",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0013",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "CTK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0013",
                "outRet": "R",
                "timeFrom": "00:16:35",
                "timeTo": "00:18:46",
                "arrDepVia": "D",
                "location": "STP",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0014",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "LBG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0014",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:56",
                "arrDepVia": "D",
                "location": "BTH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0015",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "EPH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0015",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:00",
                "arrDepVia": "D",
                "location": "LTN",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0016",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:02",
                "arrDepVia": "A",
                "location": "ECR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0016",
                "outRet": "R",
                "timeFrom": "00:16:30",
                "timeTo": "00:18:58",
                "arrDepVia": "D",
                "location": "LTN",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0017",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:02",
                "arrDepVia": "A",
                "location": "NWD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0017",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "BFR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "HHY",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "BFR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "timeFrom": "00:04:00",
                "timeTo": "00:09:56",
                "arrDepVia": "A",
                "location": "SVG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "CTK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "FPK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "CTK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "KGX",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "LBG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:59",
                "arrDepVia": "A",
                "location": "LST",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "LBG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0023",
                "outRet": "O",
                "timeFrom": "00:04:00",
                "timeTo": "00:07:20",
                "arrDepVia": "D",
                "location": "TTF",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0023",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "EPH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0024",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "EPH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0025",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:46",
                "arrDepVia": "D",
                "location": "ECR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0026",
                "outRet": "R",
                "timeFrom": "00:16:35",
                "timeTo": "00:18:46",
                "arrDepVia": "D",
                "location": "ECR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0027",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:46",
                "arrDepVia": "D",
                "location": "NWD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0028",
                "outRet": "R",
                "timeFrom": "00:16:35",
                "timeTo": "00:18:46",
                "arrDepVia": "D",
                "location": "NWD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0029",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "HHY",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0030",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "HHY",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0031",
                "outRet": "R",
                "timeFrom": "00:06:25",
                "timeTo": "00:08:16",
                "arrDepVia": "D",
                "location": "HIT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0032",
                "outRet": "R",
                "timeFrom": "00:15:52",
                "timeTo": "00:17:32",
                "arrDepVia": "D",
                "location": "HIT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "timeFrom": "00:07:15",
                "timeTo": "00:08:14",
                "arrDepVia": "D",
                "location": "SVG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "timeFrom": "00:16:18",
                "timeTo": "00:17:57",
                "arrDepVia": "D",
                "location": "SVG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0035",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "FPK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0036",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "FPK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "KGX",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "KGX",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0039",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "D",
                "location": "LST",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0040",
                "outRet": "R",
                "timeFrom": "00:16:30",
                "timeTo": "00:18:58",
                "arrDepVia": "D",
                "location": "LST",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "D",
                "location": "",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "D",
                "location": "",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0002",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "ZFD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0002",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "ZFD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "O",
                "timeFrom": "00:06:39",
                "timeTo": "00:10:47",
                "arrDepVia": "A",
                "location": "MKC",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "ZFD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0004",
                "outRet": "O",
                "timeFrom": "00:06:44",
                "timeTo": "00:10:44",
                "arrDepVia": "A",
                "location": "WFJ",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0004",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:50",
                "arrDepVia": "D",
                "location": "MKC",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "timeFrom": "00:07:20",
                "timeTo": "00:11:29",
                "arrDepVia": "A",
                "location": "EUS",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:37",
                "arrDepVia": "D",
                "location": "WFJ",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0006",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "A",
                "location": "BDM",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0006",
                "outRet": "R",
                "timeFrom": "00:14:39",
                "timeTo": "00:18:37",
                "arrDepVia": "D",
                "location": "WFJ",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0007",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:03",
                "arrDepVia": "A",
                "location": "LUT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0007",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:25",
                "arrDepVia": "D",
                "location": "EUS",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0008",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:02",
                "arrDepVia": "A",
                "location": "STP",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0008",
                "outRet": "R",
                "timeFrom": "00:15:01",
                "timeTo": "00:18:44",
                "arrDepVia": "D",
                "location": "EUS",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0009",
                "outRet": "O",
                "timeFrom": "00:01:00",
                "timeTo": "00:10:04",
                "arrDepVia": "A",
                "location": "PAD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0009",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:00",
                "arrDepVia": "D",
                "location": "BDM",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0010",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:56",
                "arrDepVia": "D",
                "location": "BTH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0010",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:00",
                "arrDepVia": "D",
                "location": "LUT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0011",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:03",
                "arrDepVia": "A",
                "location": "LTN",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0011",
                "outRet": "R",
                "timeFrom": "00:16:30",
                "timeTo": "00:18:58",
                "arrDepVia": "D",
                "location": "LUT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0012",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "BFR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0012",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:46",
                "arrDepVia": "D",
                "location": "STP",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0013",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "CTK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0013",
                "outRet": "R",
                "timeFrom": "00:16:35",
                "timeTo": "00:18:46",
                "arrDepVia": "D",
                "location": "STP",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0014",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "LBG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0014",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:56",
                "arrDepVia": "D",
                "location": "BTH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0015",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "EPH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0015",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:00",
                "arrDepVia": "D",
                "location": "LTN",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0016",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:02",
                "arrDepVia": "A",
                "location": "ECR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0016",
                "outRet": "R",
                "timeFrom": "00:16:30",
                "timeTo": "00:18:58",
                "arrDepVia": "D",
                "location": "LTN",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0017",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:02",
                "arrDepVia": "A",
                "location": "NWD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0017",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "BFR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "HHY",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "BFR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "timeFrom": "00:04:00",
                "timeTo": "00:09:56",
                "arrDepVia": "A",
                "location": "SVG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "CTK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "FPK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "CTK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:10:07",
                "arrDepVia": "A",
                "location": "KGX",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "LBG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "O",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:59",
                "arrDepVia": "A",
                "location": "LST",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "LBG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0023",
                "outRet": "O",
                "timeFrom": "00:04:00",
                "timeTo": "00:07:20",
                "arrDepVia": "D",
                "location": "TTF",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0023",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "EPH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0024",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "EPH",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0025",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:46",
                "arrDepVia": "D",
                "location": "ECR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0026",
                "outRet": "R",
                "timeFrom": "00:16:35",
                "timeTo": "00:18:46",
                "arrDepVia": "D",
                "location": "ECR",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0027",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:08:46",
                "arrDepVia": "D",
                "location": "NWD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0028",
                "outRet": "R",
                "timeFrom": "00:16:35",
                "timeTo": "00:18:46",
                "arrDepVia": "D",
                "location": "NWD",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0029",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "HHY",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0030",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "HHY",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0031",
                "outRet": "R",
                "timeFrom": "00:06:25",
                "timeTo": "00:08:16",
                "arrDepVia": "D",
                "location": "HIT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0032",
                "outRet": "R",
                "timeFrom": "00:15:52",
                "timeTo": "00:17:32",
                "arrDepVia": "D",
                "location": "HIT",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "timeFrom": "00:07:15",
                "timeTo": "00:08:14",
                "arrDepVia": "D",
                "location": "SVG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "timeFrom": "00:16:18",
                "timeTo": "00:17:57",
                "arrDepVia": "D",
                "location": "SVG",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0035",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "FPK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0036",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "FPK",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "timeFrom": "00:06:45",
                "timeTo": "00:07:58",
                "arrDepVia": "D",
                "location": "KGX",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "timeFrom": "00:15:58",
                "timeTo": "00:17:45",
                "arrDepVia": "D",
                "location": "KGX",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0039",
                "outRet": "R",
                "timeFrom": "00:04:30",
                "timeTo": "00:09:29",
                "arrDepVia": "D",
                "location": "LST",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0040",
                "outRet": "R",
                "timeFrom": "00:16:30",
                "timeTo": "00:18:58",
                "arrDepVia": "D",
                "location": "LST",
                "rstrType": "T",
                "trainType": "A",
                "minFareFlag": "0",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            }
        ],
        "restrictionTimeDate": [
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0003",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0018",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0020",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0022",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0024",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0024",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0024",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0024",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0024",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0030",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0030",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0030",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0030",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0030",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0036",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0036",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0036",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0036",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0036",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0019",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0021",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0033",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0034",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0037",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0038",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 0,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            }
        ],
        "restrictionTimeToc": [
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "O",
                "tocCode": "XC"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "R",
                "tocCode": "XC"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "CS"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "LM"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "LO"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "SR"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "VT"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "O",
                "tocCode": "XC"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0001",
                "outRet": "R",
                "tocCode": "XC"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "CS"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "LM"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "LO"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "SR"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "sequenceNo": "0005",
                "outRet": "O",
                "tocCode": "VT"
            }
        ],
        "restrictionTrain": [
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C76152",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C77350",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C77559",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78532",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78534",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78535",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78536",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78538",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78539",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78543",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78544",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78545",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78546",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78548",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78549",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78550",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78552",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "1D",
                "trainNo": "C78553",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "C11125",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "C11147",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "C11369",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61049",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61050",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61051",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61054",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61055",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61056",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61062",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61063",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61064",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61067",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61068",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61069",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61072",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61073",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "1D",
                "trainNo": "G61074",
                "outRet": "O",
                "location": null,
                "quotaInd": "N",
                "arrDep": null,
                "sleeperInd": "N",
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            }
        ],
        "restrictionTrainDate": [
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "C",
                "restrictionCode": "GZ",
                "trainNo": "Y81206",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71881",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y71900",
                "outRet": "R",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            },
            {
                "timeMarker": "F",
                "restrictionCode": "GZ",
                "trainNo": "Y81201",
                "outRet": "O",
                "monday": 1,
                "tuesday": 1,
                "wednesday": 1,
                "thursday": 1,
                "friday": 1,
                "saturday": 0,
                "sunday": 0,
                "startDate": "2019-01-02",
                "endDate": "2999-12-31"
            }
        ],
        "restrictionTrainQuota": [
            {
                "timeMarker": "C",
                "restrictionCode": "1A",
                "trainNo": "L80549",
                "outRet": "R",
                "location": "BTP",
                "quotaInd": "",
                "arrDep": "A",
                "sleeperInd": null,
                "startDate": "2018-09-02",
                "endDate": "2019-01-01"
            }
        ]
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Restriction 123 was not found"
}

GET /ticket-categories

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "anytime": {
                            "type": "array"
                        },
                        "off-peak": {
                            "type": "array"
                        },
                        "advance": {
                            "type": "array"
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "anytime": [
            "MCA"
        ],
        "off-peak": [
            "TKR",
            "YFR"
        ],
        "advance": [
            "WC1",
            "WCC",
            "XS8"
        ]
    },
    "links": []
}

GET /sleeper-tickets

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "additionalProperties": true
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "1D0": {
            "min": 1,
            "max": 5
        },
        "2D0": {
            "min": 1,
            "max": 1
        },
        "SSR": {
            "min": 2,
            "max": 2
        }
    },
    "links": []
}
URI parameters

string originNlc (required)

Pattern: ^[[:alnum:]]{3,4}$

string destinationNlc (required)

Pattern: ^[[:alnum:]]{3,4}$

string routeCode (required)

Pattern: ^\d{5}$

string ticketCode (required)

Pattern: ^[A-Z0-9]{3}$

string date (required)

Pattern: ^\d{4}-\d{2}-\d{2}$

GET /product-type/search/{originNlc}/{destinationNlc}/{routeCode}/{ticketCode}/{date}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "iin": {
                            "type": "string"
                        },
                        "oid": {
                            "type": "string"
                        },
                        "typ": {
                            "type": "integer"
                        },
                        "ptyp": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "id",
                        "iin",
                        "oid",
                        "typ",
                        "ptyp"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "id": "05EO",
        "iin": "633597",
        "oid": "0246",
        "typ": 23,
        "ptyp": 1
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Did not find any products with given criteria"
}

GET /reservation-supplement-finder

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array",
                                "string"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved URIs from 'data' section ",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": "/supplement-type/CAX",
    "links": {
        "/supplement-type/CAX": {
            "code": "CAX",
            "type": "SLE",
            "capriCode": "ZMW",
            "description": "CLSC RESERVATION",
            "shortDescription": "CLSC RESVTN ",
            "price": 0,
            "minGroup": 2,
            "maxGroup": 6,
            "class": 2,
            "isSeparateTicket": true,
            "sundryCode": null,
            "packageDirections": []
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array",
                        "string"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Resolved URIs from 'data' section ",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

Journey Planning

GET /odyssey/fare-search

Plan a journey

Parameters

string origin (required)

NLC or CRS code

Example: TBW

string destination (required)

NLC or CRS code

Example: TBW

string outwardDate (required)

Example: 1540425600

string inwardDate

Example: 1540425600

number adults (required)

Example: 2

number children (required)

Example: 1

string railcards

Example: YNG,EDU

string routeCode

if specified, response will contain only fares with this route code

Example: 59

string ticketType

if specified, response will contain only tickets with this ticket type code

Example: SDS

string ticketCategory

if specified, only fares with ticket types with specified category will be return

Example: off-peak

200 application/json
Response schema (show)
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "outward",
                "inward",
                "return"
            ],
            "properties": {
                "outward": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "/fare\\-option/fare/.+"
                    }
                },
                "inward": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "/fare\\-option/fare/.+"
                    }
                },
                "return": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "/fare\\-option/fare/.+"
                    }
                }
            }
        },
        "links": {
            "type": "object",
            "additionalProperties": false,
            "patternProperties": {
                "^/odyssey/fare/.+$": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "origin": {
                            "type": "string"
                        },
                        "destination": {
                            "type": "string"
                        },
                        "price": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "originalPrice": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "availability": {
                            "type": "number"
                        },
                        "railcard": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "restrictionCode": {
                            "type": "string"
                        },
                        "route": {
                            "pattern": "^/route/\\d+$",
                            "type": "string"
                        },
                        "ticketType": {
                            "pattern": "^/ticket-type/\\w+$",
                            "type": "string"
                        },
                        "fareSetter": {
                            "pattern": "^[A-Z]{3}$",
                            "type": "string"
                        },
                        "statusCode": {
                            "type": "string"
                        },
                        "xLondon": {
                            "type": "number",
                            "description": "0 - not cross London; 1 - cross London; 2 - cross London by underground"
                        },
                        "permittedOriginStations": {
                            "type": "string"
                        },
                        "permittedDestinationStations": {
                            "type": "string"
                        },
                        "discount": {
                            "type": [
                                "null",
                                "object"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "type": {
                                    "type": "string"
                                },
                                "lennonCode": {
                                    "type": "string"
                                },
                                "promoCode": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "percent": {
                                    "type": "integer"
                                },
                                "shortDescription": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "longDescription": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "travelStartDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "travelEndDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "purchaseStartDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "purchaseEndDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                }
                            }
                        },
                        "season": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "stockColour": {
                                    "type": "string"
                                },
                                "comparisonPrice": {
                                    "type": "string"
                                },
                                "duration": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "days": {
                                            "type": "number"
                                        },
                                        "months": {
                                            "type": "number"
                                        }
                                    }
                                }
                            }
                        },
                        "groups": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "labels": {
                            "description": "Labels describing the fare",
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "advance",
                                    "first-class",
                                    "split"
                                ],
                                "description": "Short, computer-readable string that describes a parameter of a fare or fare option"
                            }
                        }
                    },
                    "required": [
                        "origin",
                        "destination",
                        "route",
                        "price",
                        "ticketType",
                        "fareSetter",
                        "statusCode",
                        "xLondon",
                        "permittedOriginStations",
                        "permittedDestinationStations",
                        "groups"
                    ]
                },
                "^/odyssey/fare-option/.+$": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "fares",
                        "labels",
                        "totalPrice"
                    ],
                    "properties": {
                        "totalPrice": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "originalPrice": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "labels": {
                            "description": "Labels for the fare option, shared between all fares in the option plus extra fare option-specific labels",
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "advance",
                                    "first-class",
                                    "split"
                                ],
                                "description": "Short, computer-readable string that describes a parameter of a fare or fare option"
                            }
                        },
                        "supplements": {
                            "type": "array",
                            "items": []
                        },
                        "hasETicket": {
                            "type": "string"
                        },
                        "validUntil": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "fares": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "adults": {
                                        "type": "number"
                                    },
                                    "children": {
                                        "type": "number"
                                    },
                                    "fare": {
                                        "type": "string",
                                        "pattern": "/odyssey/fare/.+"
                                    },
                                    "splitInfo": {
                                        "type": "object",
                                        "description": "Details of a fare split. If not present, this fare is not part of a split ticket.",
                                        "required": [
                                            "sectionIds"
                                        ],
                                        "sectionIds": {
                                            "type": "array",
                                            "items": {
                                                "type": "number"
                                            },
                                            "description": "Indicates which sections of a split ticket this fare belongs to."
                                        },
                                        "outwardOrigin": {
                                            "description": "Station where the split ticket starts for the outward journey. If not present, this fare is only for the inward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        },
                                        "outwardDestination": {
                                            "description": "The CRS code of the station where the split ticket ends for the outward journey. If not present, this fare is only for the inward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        },
                                        "inwardOrigin": {
                                            "description": "The CRS code of the station where the split ticket starts for the inward journey. If not present, this fare is only for the outward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        },
                                        "inwardDestination": {
                                            "description": "The CRS code of the station where the split ticket ends for the inward journey. If not present, this fare is only for the outward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        }
                                    }
                                },
                                "required": [
                                    "adults",
                                    "children",
                                    "fare"
                                ]
                            }
                        }
                    }
                }
            }
        }
    }
}
Response example (show)
{
    "data": {
        "outward": [],
        "inward": [],
        "return": [
            "/odyssey/fare-option/fare/5268-I444-00777-SD4-000-1-DS-262-283-0/fare/5268-I444-00777-SD1-001-1-DS-262-283-0"
        ]
    },
    "links": []
}

GET /odyssey/season-search

Query season ticket fares. Response format can be manipulate, depends on API client needs. Default response format is like: response": { "fares": { "0100": [ "/odyssey/fare/1234", "/odyssey/fare/2345", ], "1200": [ "/odyssey/fare/9876", ] } } Fares are indexed by season duration. However, you can request for flat structure, using flatten parameter. To get fares only for particular duration, use duration. For instance, with flatten=1&duration=0100 above response would look like: response": { "fares": [ "/odyssey/fare/1234", "/odyssey/fare/2345", ] } Flatten and duration can be use separately.

Parameters

string origin (required)

NLC or CRS code

Example: TBW

string destination (required)

NLC or CRS code

Example: TBW

string startDate (required)

Start date of the season ticket (must be within 14 days)

Example: 1540425600

string passengerType (required)

Example: adult|child

string duration

Duration length (MMDD) of season ticket. Can be a single duration or comma separated list of durations. If duration is defined, only fares with those particular durations will be return. Default durations are 0007, 0100, 1200, and they will be return if duration is empty.

Example: 0100,0070,0600

string railcard

Example: YNG

string flatten

if set to true, fares won't be indexed by duration

Example: 1

200 application/json
Response schema (show)
{
    "type": "object",
    "properties": {
        "response": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "fares"
            ],
            "properties": {
                "fares": {
                    "$oneOf": [
                        {
                            "type": "object",
                            "additionalProperties": true,
                            "properties": {
                                "0007": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "/fare\\-option/fare/.+"
                                    }
                                },
                                "0100": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "/fare\\-option/fare/.+"
                                    }
                                },
                                "1200": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "/fare\\-option/fare/.+"
                                    }
                                }
                            }
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "/fare\\-option/fare/.+"
                            }
                        }
                    ]
                }
            }
        },
        "links": {
            "type": "object"
        }
    }
}
Response example (show)
{
    "response": {
        "fares": {
            "1200": [
                "/odyssey/fare/1072-0418-00000-PSS-000-1--331-344-0-12,0",
                "/odyssey/fare/1072-0418-00000-PSF-000-1--331-344-0-12,0"
            ],
            "0007": [
                "/odyssey/fare/1072-0418-00000-7DS-000-1--331-344-0-0,7",
                "/odyssey/fare/1072-0418-00000-7DF-000-1--331-344-0-0,7"
            ],
            "0100": [
                "/odyssey/fare/1072-0418-00000-PSS-000-1--331-344-0-1,0",
                "/odyssey/fare/1072-0418-00000-PSF-000-1--331-344-0-1,0"
            ],
            "0304": [
                "/odyssey/fare/1072-0418-00000-PSS-000-1--331-344-0-3,4",
                "/odyssey/fare/1072-0418-00000-PSF-000-1--331-344-0-3,4"
            ]
        }
    },
    "links": []
}

GET /odyssey/jp

Plan a journey

Parameters

string origin (required)

Outward journey origin as an NLC, CRS or TIPLOC code.

Example: TBW

string destination (required)

Outward journey destination as an NLC, CRS or TIPLOC code.

Example: TBW

string via

NLC, CRS or TIPLOC codes of stations the journeys are required to pass.

Example: EUS,MAN

string avoid

NLC, CRS or TIPLOC codes of stations the journeys are required not to to pass.

Example: EUS,MAN

string tocs

Short codes of TOCs the journey is required to use for at least one of the legs each.

Example: CS,NT

number adults (required)

Number of adult passengers.

number children (required)

Number of non-adult human passengers.

Example: 1

number pets

Number of pet-friendly compartments, might affect fare option selection.

number bikes

Number of bike spaces.

string railcards

List of railcard codes that the passengers are allowed to use.

Example: YNG,YNG,EDU

string promoCode

A promo code that can be used to enable a specific discount.

Example: ANB523DS

string outwardDate (required)

OUTWARD journey start date.

Example: 1540425600

string outwardDepartAt

OUTWARD journeys DEPARTING at or AFTER that time will be shown.

Example: 14:00

string outwardDepartBy

OUTWARD journeys DEPARTING at or BEFORE that time will be shown.

Example: 9:00

string outwardArriveAt

OUTWARD journeys ARRIVING at or AFTER that time will be shown.

Example: 14:00

string outwardArriveBy

OUTWARD journeys ARRIVING at or BEFORE that time will be shown.

Example: 9:30

string inwardDate

INWARD journey start date.

Example: 1540425600

string inwardDepartAt

INWARD journeys DEPARTING at or AFTER that time will be shown.

Example: 14:00

string inwardDepartBy

INWARD journeys DEPARTING at or BEFORE that time will be shown.

Example: 9:00

string inwardArriveAt

INWARD journeys ARRIVING at or AFTER that time will be shown.

Example: 7:30

string inwardArriveBy

INWARD journeys ARRIVING at or BEFORE that time will be shown.

Example: 00:00

boolean firstClass

Set to 'false' to not show first class tickets.

boolean standardClass

Set to 'false' to not show standard class tickets.

boolean singles

Set to 'false' to not show single direction tickets.

boolean returns

Set to 'false' to not show return tickets; does not prevent inward single tickets.

boolean advance

Set to 'false' to not show advance tickets.

string ticketCategory

Only show tickets from a selected category, one of "anytime", "off-peak", "advance".

Example: off-peak

string fareSetters

Only show tickets from selected fare setters.

Example: CAL,SCS

string tenant

Use the specified tenant configuration; either this or an X-Tenant header is required.

Example: rsm

number limit

Maximum number of results returned.

number horizon

Number of hours of schedules to look up; defaults to automatic, 3-27.

number maxPrice

Maximum fare option price in pence.

Example: 10000

boolean useSplits

Set to 'true'/'false' to use/not use split tickets.

string splitPattern

Only show split tickets with the specified pattern.

boolean ignoreNrs

Set to 'true' to assume all fares are fully available.

string journey

Ignore all journeys other than the one specified.

Example: /journey/280:EUS_INV_C72728

string fare

Ignore all fares other than the one specified.

Example: /fare/1444-8649-00345-1T8-001-1-U6--329-280-0-

string ticketType

Only show fares with the specified ticket code.

Example: 1SA

string routeCode

Only show fares with the specified route code.

Example: 100

200 application/json
Response schema (show)
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "pagination",
        "response"
    ],
    "properties": {
        "pagination": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "outward": {
                    "type": "object",
                    "properties": {
                        "current": {
                            "type": "string",
                            "description": "Current effective query string, if present (might be different from requested)"
                        },
                        "earlier": {
                            "type": "string",
                            "description": "Earlier result query string, if present"
                        },
                        "later": {
                            "type": "string",
                            "description": "Later result query string, if present"
                        }
                    }
                },
                "inward": {
                    "type": "object",
                    "properties": {
                        "current": {
                            "type": "string",
                            "description": "Current effective query string, if present (might be different from requested)"
                        },
                        "earlier": {
                            "type": "string",
                            "description": "Earlier result query string, if present"
                        },
                        "later": {
                            "type": "string",
                            "description": "Later result query string, if present"
                        }
                    }
                }
            }
        },
        "response": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "outward",
                "inward",
                "fares",
                "availability"
            ],
            "properties": {
                "outward": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "/odyssey/journey/.+"
                    }
                },
                "inward": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "/odyssey/journey/.+"
                    }
                },
                "fares": {
                    "type": "object",
                    "description": "array associate journeys with fares."
                },
                "addons": {
                    "type": "object",
                    "required": [
                        "outward"
                    ],
                    "properties": {
                        "outward": {
                            "type": "object"
                        },
                        "inward": {
                            "type": "object"
                        }
                    }
                },
                "availability": {
                    "type": "object",
                    "description": "availabilities associated with journeys and ticket types"
                },
                "splitSavings": {
                    "examples": [
                        {
                            "/odyssey/journey/285:285:EUS_GLC_C21856": {
                                "/odyssey/fare-option/fare/1444-1243-00515-V2V-000-1-VR---269-1-0--2500-1-0/fare/1243-0433-00515-V2X-000-1-VR---269-1-0--1300-1-0-EUS:CRE_CRE:GLC": 10
                            }
                        },
                        {
                            "/odyssey/journey/285:285:EUS_GLC_C22071": {
                                "/odyssey/journey/285:285:GLC_EUS_P79235": {
                                    "/odyssey/fare-option/fare/1444-1030-00516-V1R-000-1-VA---269-1-0--5550-1-0/fare/1030-0433-00516-V1G-000-1-VA---269-1-0--14850-1-0-EUS:COV_COV:GLC": {
                                        "/odyssey/fare-option/fare/0433-0785-00430-BPS-000-1-GC---269-1-0--3580-1-0": 4780
                                    }
                                }
                            }
                        }
                    ],
                    "oneOf": [
                        {
                            "description": "One way journey savings - Map>",
                            "type": "object",
                            "additionalProperties": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "number"
                                }
                            }
                        },
                        {
                            "description": "Return journey savings - Map>>>",
                            "type": "object",
                            "additionalProperties": {
                                "type": "object",
                                "additionalProperties": {
                                    "type": "object",
                                    "additionalProperties": {
                                        "type": "object",
                                        "additionalProperties": {
                                            "type": "number"
                                        }
                                    }
                                }
                            }
                        }
                    ]
                }
            }
        },
        "messages": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "tag",
                    "level",
                    "title"
                ],
                "properties": {
                    "tag": {
                        "type": "string"
                    },
                    "level": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    }
                }
            },
            "additionalProperties": false,
            "properties": {
                "outward": {
                    "type": "object",
                    "properties": {
                        "current": {
                            "type": "string",
                            "description": "Current effective query string, if present (might be different from requested)"
                        },
                        "earlier": {
                            "type": "string",
                            "description": "Earlier result query string, if present"
                        },
                        "later": {
                            "type": "string",
                            "description": "Later result query string, if present"
                        }
                    }
                },
                "inward": {
                    "type": "object",
                    "properties": {
                        "current": {
                            "type": "string",
                            "description": "Current effective query string, if present (might be different from requested)"
                        },
                        "earlier": {
                            "type": "string",
                            "description": "Earlier result query string, if present"
                        },
                        "later": {
                            "type": "string",
                            "description": "Later result query string, if present"
                        }
                    }
                }
            }
        },
        "links": {
            "type": "object",
            "additionalProperties": false,
            "patternProperties": {
                "^/odyssey/fare/.+$": {
                    "type": "object",
                    "additionalProperties": false,
                    "properties": {
                        "origin": {
                            "type": "string"
                        },
                        "destination": {
                            "type": "string"
                        },
                        "price": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "originalPrice": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "availability": {
                            "type": "number"
                        },
                        "railcard": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "restrictionCode": {
                            "type": "string"
                        },
                        "route": {
                            "pattern": "^/route/\\d+$",
                            "type": "string"
                        },
                        "ticketType": {
                            "pattern": "^/ticket-type/\\w+$",
                            "type": "string"
                        },
                        "fareSetter": {
                            "pattern": "^[A-Z]{3}$",
                            "type": "string"
                        },
                        "statusCode": {
                            "type": "string"
                        },
                        "xLondon": {
                            "type": "number",
                            "description": "0 - not cross London; 1 - cross London; 2 - cross London by underground"
                        },
                        "permittedOriginStations": {
                            "type": "string"
                        },
                        "permittedDestinationStations": {
                            "type": "string"
                        },
                        "discount": {
                            "type": [
                                "null",
                                "object"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "type": {
                                    "type": "string"
                                },
                                "lennonCode": {
                                    "type": "string"
                                },
                                "promoCode": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "percent": {
                                    "type": "integer"
                                },
                                "shortDescription": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "longDescription": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "travelStartDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "travelEndDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "purchaseStartDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                },
                                "purchaseEndDate": {
                                    "type": [
                                        "null",
                                        "string"
                                    ]
                                }
                            }
                        },
                        "season": {
                            "type": "object",
                            "additionalProperties": false,
                            "properties": {
                                "stockColour": {
                                    "type": "string"
                                },
                                "comparisonPrice": {
                                    "type": "string"
                                },
                                "duration": {
                                    "type": "object",
                                    "additionalProperties": false,
                                    "properties": {
                                        "days": {
                                            "type": "number"
                                        },
                                        "months": {
                                            "type": "number"
                                        }
                                    }
                                }
                            }
                        },
                        "groups": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "labels": {
                            "description": "Labels describing the fare",
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "advance",
                                    "first-class",
                                    "split"
                                ],
                                "description": "Short, computer-readable string that describes a parameter of a fare or fare option"
                            }
                        }
                    },
                    "required": [
                        "origin",
                        "destination",
                        "route",
                        "price",
                        "ticketType",
                        "fareSetter",
                        "statusCode",
                        "xLondon",
                        "permittedOriginStations",
                        "permittedDestinationStations",
                        "groups"
                    ]
                },
                "^/odyssey/fare-option/.+$": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "fares",
                        "labels",
                        "totalPrice"
                    ],
                    "properties": {
                        "totalPrice": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "originalPrice": {
                            "type": "number",
                            "examples": [
                                123.45
                            ],
                            "description": "Price in pence",
                            "pattern": "[0-9]+.[0-9]{2}"
                        },
                        "labels": {
                            "description": "Labels for the fare option, shared between all fares in the option plus extra fare option-specific labels",
                            "type": "array",
                            "items": {
                                "type": "string",
                                "examples": [
                                    "advance",
                                    "first-class",
                                    "split"
                                ],
                                "description": "Short, computer-readable string that describes a parameter of a fare or fare option"
                            }
                        },
                        "supplements": {
                            "type": "array",
                            "items": []
                        },
                        "hasETicket": {
                            "type": "string"
                        },
                        "validUntil": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "fares": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "adults": {
                                        "type": "number"
                                    },
                                    "children": {
                                        "type": "number"
                                    },
                                    "fare": {
                                        "type": "string",
                                        "pattern": "/odyssey/fare/.+"
                                    },
                                    "splitInfo": {
                                        "type": "object",
                                        "description": "Details of a fare split. If not present, this fare is not part of a split ticket.",
                                        "required": [
                                            "sectionIds"
                                        ],
                                        "sectionIds": {
                                            "type": "array",
                                            "items": {
                                                "type": "number"
                                            },
                                            "description": "Indicates which sections of a split ticket this fare belongs to."
                                        },
                                        "outwardOrigin": {
                                            "description": "Station where the split ticket starts for the outward journey. If not present, this fare is only for the inward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        },
                                        "outwardDestination": {
                                            "description": "The CRS code of the station where the split ticket ends for the outward journey. If not present, this fare is only for the inward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        },
                                        "inwardOrigin": {
                                            "description": "The CRS code of the station where the split ticket starts for the inward journey. If not present, this fare is only for the outward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        },
                                        "inwardDestination": {
                                            "description": "The CRS code of the station where the split ticket ends for the inward journey. If not present, this fare is only for the outward part of a split ticket.",
                                            "type": "string",
                                            "pattern": "/station/[A-Z0-9]+",
                                            "example": "/station/CRD"
                                        }
                                    }
                                },
                                "required": [
                                    "adults",
                                    "children",
                                    "fare"
                                ]
                            }
                        }
                    }
                },
                "^/odyssey/journey/.+$": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "origin",
                        "destination",
                        "arrival",
                        "departure",
                        "scheduledArrival",
                        "scheduledDeparture",
                        "legs",
                        "disruptions"
                    ],
                    "properties": {
                        "id": {
                            "type": "string",
                            "pattern": "/odyssey/journey/.+"
                        },
                        "origin": {
                            "type": "string",
                            "pattern": "/station/[A-Z0-9]+",
                            "example": "/station/CRD",
                            "description": "A location URI containing a CRS, NLC or TIPLOC code"
                        },
                        "destination": {
                            "type": "string",
                            "pattern": "/station/[A-Z0-9]+",
                            "example": "/station/CRD",
                            "description": "A location URI containing a CRS, NLC or TIPLOC code"
                        },
                        "departure": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "arrival": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "scheduledDeparture": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "scheduledArrival": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "legs": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "/odyssey/leg/.+"
                            }
                        },
                        "disruptions": {
                            "type": "string",
                            "pattern": "/disruption/[0-9\\-]+T[0-9\\:]+/.+"
                        },
                        "isReservationCompulsory": {
                            "type": "boolean",
                            "description": "Return the info whether reservation is compulsory or not"
                        },
                        "isReservationPossible": {
                            "type": "boolean",
                            "description": "Return the info whether reservation is possible or not"
                        },
                        "isOvertaken": {
                            "type": "boolean",
                            "description": "Whether the journey is overtaken by another journey within this page of results"
                        },
                        "overtakingJourneysCount": {
                            "type": "number",
                            "description": "Number of trains which overtakes given journey. Maximum number is 9 (so if there is more than 9 it will always be 9)"
                        },
                        "boardingTime": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "alightingTime": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "distance": {
                            "type": "number",
                            "description": "Distance traveled by the service, excluding fixed legs, in miles."
                        },
                        "co2": {
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "train",
                                "petrolCar",
                                "flight"
                            ],
                            "properties": {
                                "train": {
                                    "type": "number"
                                },
                                "petrolCar": {
                                    "type": "number"
                                },
                                "flight": {
                                    "type": "number"
                                }
                            },
                            "example": {
                                "train": 30,
                                "petrolCar": 50,
                                "flight": 70
                            }
                        },
                        "status": {
                            "type": "string",
                            "description": "Status of the journey (ready, too-soon, no-valid-fares, sold-out, cancelled"
                        }
                    }
                },
                "^/odyssey/leg/.+$": {
                    "type": "object",
                    "required": [
                        "type",
                        "origin",
                        "destination",
                        "mode",
                        "service",
                        "operator",
                        "callingPoints"
                    ],
                    "additionalProperties": false,
                    "properties": {
                        "id": {
                            "type": "string",
                            "pattern": "/odyssey/leg/.+"
                        },
                        "type": {
                            "enum": [
                                "timetabled",
                                "fixed"
                            ]
                        },
                        "source": {
                            "enum": [
                                "darwin",
                                "dtd"
                            ]
                        },
                        "origin": {
                            "type": "string",
                            "pattern": "/station/[A-Z0-9]+",
                            "example": "/station/CRD",
                            "description": "A location URI containing a CRS, NLC or TIPLOC code"
                        },
                        "destination": {
                            "type": "string",
                            "pattern": "/station/[A-Z0-9]+",
                            "example": "/station/CRD",
                            "description": "A location URI containing a CRS, NLC or TIPLOC code"
                        },
                        "mode": {
                            "enum": [
                                "train",
                                "bus",
                                "transfer"
                            ]
                        },
                        "service": {
                            "oneOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "trainUid": {
                                            "type": "string"
                                        },
                                        "retailServiceId": {
                                            "type": "string"
                                        },
                                        "reservationFlag": {
                                            "type": "string"
                                        },
                                        "reservable": {
                                            "type": "array",
                                            "items": [
                                                {
                                                    "enum": [
                                                        "Possible",
                                                        "Compulsory",
                                                        "Recommended",
                                                        "EssentialForBikes",
                                                        "NotReservable"
                                                    ]
                                                }
                                            ]
                                        },
                                        "origin": {
                                            "type": "string"
                                        },
                                        "destination": {
                                            "type": "string"
                                        },
                                        "date": {
                                            "type": "string"
                                        },
                                        "scheduledDeparture": {
                                            "type": "string"
                                        }
                                    }
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "operator": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/toc/[A-Z]{2}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "departure": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "arrival": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "scheduledDeparture": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "scheduledArrival": {
                            "type": "string",
                            "examples": [
                                "2016-01-01T12:00:00"
                            ]
                        },
                        "disruptionReason": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "disruptions": {
                            "type": "string",
                            "pattern": "/disruption/[0-9\\-]+/[A-Za-z]{2}/[A-Za-z,]+"
                        },
                        "callingPoints": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "required": [
                                    "station",
                                    "arrival",
                                    "departure",
                                    "scheduledArrival",
                                    "scheduledDeparture",
                                    "cancelled",
                                    "pickup",
                                    "dropoff"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "activities": {
                                        "description": "[LEGACY] Generated from pickup/dropoff, please use those fields directly",
                                        "type": "array"
                                    },
                                    "pickup": {
                                        "type": "boolean"
                                    },
                                    "dropoff": {
                                        "type": "boolean"
                                    },
                                    "departure": {
                                        "type": "string",
                                        "examples": [
                                            "2016-01-01T12:00:00"
                                        ]
                                    },
                                    "arrival": {
                                        "type": "string",
                                        "examples": [
                                            "2016-01-01T12:00:00"
                                        ]
                                    },
                                    "scheduledDeparture": {
                                        "type": "string",
                                        "examples": [
                                            "2016-01-01T12:00:00"
                                        ]
                                    },
                                    "scheduledArrival": {
                                        "type": "string",
                                        "examples": [
                                            "2016-01-01T12:00:00"
                                        ]
                                    },
                                    "station": {
                                        "type": "string",
                                        "pattern": "[A-Z]{3}"
                                    },
                                    "cancelled": {
                                        "type": "boolean"
                                    },
                                    "platform": {
                                        "type": [
                                            "null",
                                            "string"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
Response example (show)
{
    "pagination": {
        "outward": {
            "current": "origin=1444&destination=8827&outwardDate=2022-03-14&outwardDepartAt=10%3A20&adults=1&children=0&tocs=CS&limit=1",
            "earlier": "origin=1444&destination=8827&outwardDate=2022-03-14&outwardDepartBy=21%3A15&adults=1&children=0&tocs=CS&limit=1",
            "later": "origin=1444&destination=8827&outwardDate=2022-03-14&outwardDepartAt=21%3A15&adults=1&children=0&tocs=CS&limit=1"
        }
    },
    "response": {
        "outward": [
            "/odyssey/journey/73:73:EUS_EDB_C02177_C02185,74:EDB_FTW_C02185"
        ],
        "inward": [],
        "fares": {
            "/odyssey/journey/73:73:EUS_EDB_C02177_C02185,74:EDB_FTW_C02185": {
                "outward": [
                    "/odyssey/fare-option/73:/fare/1444-8827-00094-SSJ-000-1-U5--49-1-0--1-0",
                    "/odyssey/fare-option/74:/fare/1444-8827-00094-SSJ-000-1-U5--49-1-0--1-0"
                ],
                "inward": [],
                "return": []
            }
        },
        "addons": {
            "outward": {
                "origin": [],
                "destination": []
            }
        },
        "availability": {
            "/odyssey/journey/73:73:EUS_EDB_C02177_C02185,74:EDB_FTW_C02185": {
                "/ticket-type/SSJ": {
                    "/route/00094": 6
                }
            }
        },
        "splitSavings": {
            "/odyssey/journey/73:73:EUS_EDB_C02177_C02185,74:EDB_FTW_C02185": {
                "/odyssey/fare-option/fare/1444-1243-00515-V2V-000-1-VR---269-1-0--2500-1-0/fare/1243-0433-00515-V2X-000-1-VR---269-1-0--1300-1-0-EUS:CRE_CRE:GLC": 800
            }
        }
    },
    "links": {
        "/odyssey/fare/1444-8827-00094-SSJ-000-1-U5--49-1-0-": {
            "origin": "/station/1444",
            "destination": "/station/8827",
            "route": "/route/00094",
            "price": 5500,
            "originalPrice": 5500,
            "ticketType": "/ticket-type/SSJ",
            "restrictionCode": "U5",
            "fareSetter": "SCS",
            "railcard": null,
            "statusCode": "000",
            "xLondon": 0,
            "permittedDestinationStations": "/station/8827/permitted-stations/1444/00094",
            "permittedOriginStations": "/station/1444/permitted-stations/8827/00094",
            "discount": null,
            "groups": [
                "cs_seat_flexi"
            ]
        },
        "/odyssey/fare-option/73:/fare/1444-8827-00094-SSJ-000-1-U5--49-1-0--1-0": {
            "totalPrice": 5500,
            "labels": [
                "seat",
                "flexi",
                "solo",
                "advance"
            ],
            "hasETicket": "/has-e-ticket/1444/8827/1444/8827/00094/SSJ",
            "supplements": [],
            "fares": [
                {
                    "adults": 1,
                    "children": 0,
                    "fare": "/odyssey/fare/1444-8827-00094-SSJ-000-1-U5--49-1-0-"
                }
            ]
        },
        "/odyssey/fare-option/74:/fare/1444-8827-00094-SSJ-000-1-U5--49-1-0--1-0": {
            "totalPrice": 5500,
            "labels": [
                "seat",
                "flexi",
                "solo",
                "advance"
            ],
            "hasETicket": "/has-e-ticket/1444/8827/1444/8827/00094/SSJ",
            "supplements": [],
            "fares": [
                {
                    "adults": 1,
                    "children": 0,
                    "fare": "/odyssey/fare/1444-8827-00094-SSJ-000-1-U5--49-1-0-"
                }
            ]
        },
        "/odyssey/leg/73:EUS_EDB_C02177_C02185": {
            "type": "timetabled",
            "source": "dtd",
            "origin": "/station/EUS",
            "destination": "/station/EDB",
            "mode": "train",
            "operator": "/toc/CS",
            "service": {
                "trainUid": "C02177_C02185",
                "retailServiceId": "CS000104",
                "reservationFlag": "A",
                "reservable": [
                    "Compulsory"
                ],
                "origin": "/station/EUS",
                "destination": "/station/FTW"
            },
            "departure": "2022-03-14T21:15:00",
            "arrival": "2022-03-15T03:50:00",
            "scheduledDeparture": "2022-03-14T21:15:00",
            "scheduledArrival": "2022-03-15T03:50:00",
            "disruptions": "/disruption/2022-03-14/cs/eus,edb",
            "callingPoints": [
                {
                    "station": "/station/EUS",
                    "departure": "2022-03-14T21:15:00",
                    "arrival": "2022-03-14T21:15:00",
                    "scheduledDeparture": "2022-03-14T21:15:00",
                    "scheduledArrival": "2022-03-14T21:15:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": false,
                    "activities": [
                        "PickUpOnly"
                    ]
                },
                {
                    "station": "/station/CRE",
                    "departure": "2022-03-14T23:48:00",
                    "arrival": "2022-03-14T23:48:00",
                    "scheduledDeparture": "2022-03-14T23:48:00",
                    "scheduledArrival": "2022-03-14T23:48:00",
                    "cancelled": false,
                    "platform": "6",
                    "pickup": true,
                    "dropoff": false,
                    "activities": [
                        "PickUpOnly"
                    ]
                },
                {
                    "station": "/station/PRE",
                    "departure": "2022-03-15T00:55:00",
                    "arrival": "2022-03-15T00:55:00",
                    "scheduledDeparture": "2022-03-15T00:55:00",
                    "scheduledArrival": "2022-03-15T00:55:00",
                    "cancelled": false,
                    "platform": "4",
                    "pickup": true,
                    "dropoff": false,
                    "activities": [
                        "PickUpOnly"
                    ]
                },
                {
                    "station": "/station/EDB",
                    "departure": "2022-03-15T04:50:00",
                    "arrival": "2022-03-15T03:50:00",
                    "scheduledDeparture": "2022-03-15T04:50:00",
                    "scheduledArrival": "2022-03-15T03:50:00",
                    "cancelled": false,
                    "platform": "7",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                }
            ]
        },
        "/odyssey/leg/74:EDB_FTW_C02185": {
            "type": "timetabled",
            "source": "dtd",
            "origin": "/station/EDB",
            "destination": "/station/FTW",
            "mode": "train",
            "operator": "/toc/CS",
            "service": {
                "trainUid": "C02185",
                "retailServiceId": "CS000104",
                "reservationFlag": "A",
                "reservable": [
                    "Compulsory"
                ],
                "origin": "/station/EDB",
                "destination": "/station/FTW"
            },
            "departure": "2022-03-15T04:50:00",
            "arrival": "2022-03-15T09:57:00",
            "scheduledDeparture": "2022-03-15T04:50:00",
            "scheduledArrival": "2022-03-15T09:57:00",
            "disruptions": "/disruption/2022-03-15/cs/edb,ftw",
            "callingPoints": [
                {
                    "station": "/station/EDB",
                    "departure": "2022-03-15T04:50:00",
                    "arrival": "2022-03-15T04:50:00",
                    "scheduledDeparture": "2022-03-15T04:50:00",
                    "scheduledArrival": "2022-03-15T04:50:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/GLQ",
                    "departure": "2022-03-15T05:48:00",
                    "arrival": "2022-03-15T05:48:00",
                    "scheduledDeparture": "2022-03-15T05:48:00",
                    "scheduledArrival": "2022-03-15T05:48:00",
                    "cancelled": false,
                    "platform": "8",
                    "pickup": true,
                    "dropoff": false,
                    "activities": [
                        "PickUpOnly"
                    ]
                },
                {
                    "station": "/station/DMR",
                    "departure": "2022-03-15T06:05:00",
                    "arrival": "2022-03-15T06:05:00",
                    "scheduledDeparture": "2022-03-15T06:05:00",
                    "scheduledArrival": "2022-03-15T06:05:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/DBC",
                    "departure": "2022-03-15T06:16:00",
                    "arrival": "2022-03-15T06:16:00",
                    "scheduledDeparture": "2022-03-15T06:16:00",
                    "scheduledArrival": "2022-03-15T06:16:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/HLU",
                    "departure": "2022-03-15T06:32:00",
                    "arrival": "2022-03-15T06:31:00",
                    "scheduledDeparture": "2022-03-15T06:32:00",
                    "scheduledArrival": "2022-03-15T06:31:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/GCH",
                    "departure": "2022-03-15T06:46:00",
                    "arrival": "2022-03-15T06:46:00",
                    "scheduledDeparture": "2022-03-15T06:46:00",
                    "scheduledArrival": "2022-03-15T06:46:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/ART",
                    "departure": "2022-03-15T07:09:00",
                    "arrival": "2022-03-15T07:08:00",
                    "scheduledDeparture": "2022-03-15T07:09:00",
                    "scheduledArrival": "2022-03-15T07:08:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/AUI",
                    "departure": "2022-03-15T07:25:00",
                    "arrival": "2022-03-15T07:24:00",
                    "scheduledDeparture": "2022-03-15T07:25:00",
                    "scheduledArrival": "2022-03-15T07:24:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/CNR",
                    "departure": "2022-03-15T07:47:00",
                    "arrival": "2022-03-15T07:45:00",
                    "scheduledDeparture": "2022-03-15T07:47:00",
                    "scheduledArrival": "2022-03-15T07:45:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/UTY",
                    "departure": "2022-03-15T08:01:00",
                    "arrival": "2022-03-15T07:59:00",
                    "scheduledDeparture": "2022-03-15T08:01:00",
                    "scheduledArrival": "2022-03-15T07:59:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/BRO",
                    "departure": "2022-03-15T08:17:00",
                    "arrival": "2022-03-15T08:17:00",
                    "scheduledDeparture": "2022-03-15T08:17:00",
                    "scheduledArrival": "2022-03-15T08:17:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/RAN",
                    "departure": "2022-03-15T08:44:00",
                    "arrival": "2022-03-15T08:44:00",
                    "scheduledDeparture": "2022-03-15T08:44:00",
                    "scheduledArrival": "2022-03-15T08:44:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/CRR",
                    "departure": "2022-03-15T08:59:00",
                    "arrival": "2022-03-15T08:58:00",
                    "scheduledDeparture": "2022-03-15T08:59:00",
                    "scheduledArrival": "2022-03-15T08:58:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/TUL",
                    "departure": "2022-03-15T09:20:00",
                    "arrival": "2022-03-15T09:19:00",
                    "scheduledDeparture": "2022-03-15T09:20:00",
                    "scheduledArrival": "2022-03-15T09:19:00",
                    "cancelled": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/RYB",
                    "departure": "2022-03-15T09:31:00",
                    "arrival": "2022-03-15T09:31:00",
                    "scheduledDeparture": "2022-03-15T09:31:00",
                    "scheduledArrival": "2022-03-15T09:31:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/SBR",
                    "departure": "2022-03-15T09:38:00",
                    "arrival": "2022-03-15T09:38:00",
                    "scheduledDeparture": "2022-03-15T09:38:00",
                    "scheduledArrival": "2022-03-15T09:38:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/FTW",
                    "departure": "2022-03-15T09:57:00",
                    "arrival": "2022-03-15T09:57:00",
                    "scheduledDeparture": "2022-03-15T09:57:00",
                    "scheduledArrival": "2022-03-15T09:57:00",
                    "cancelled": false,
                    "platform": "1",
                    "pickup": false,
                    "dropoff": true,
                    "activities": [
                        "SetDownOnly"
                    ]
                }
            ]
        },
        "/odyssey/journey/73:73:EUS_EDB_C02177_C02185,74:EDB_FTW_C02185": {
            "id": "/odyssey/journey/73:73:EUS_EDB_C02177_C02185,74:EDB_FTW_C02185",
            "origin": "/station/EUS",
            "destination": "/station/FTW",
            "departure": "2022-03-14T21:15:00",
            "arrival": "2022-03-15T09:57:00",
            "scheduledDeparture": "2022-03-14T21:15:00",
            "scheduledArrival": "2022-03-15T09:57:00",
            "legs": [
                "/odyssey/leg/73:EUS_EDB_C02177_C02185",
                "/odyssey/leg/74:EDB_FTW_C02185"
            ],
            "disruptions": "/disruption/2022-03-14T21:15:00/CS_EUS_EDB_C02177_C02185,CS_EDB_FTW_C02185",
            "isReservationCompulsory": true,
            "isReservationPossible": true,
            "isOvertaken": false,
            "overtakingJourneysCount": 0,
            "status": "ready"
        }
    },
    "messages": []
}

GET /odyssey/rover-search

Find Rangers & Rovers

Parameters

number adults (required)

Example: 2

number children (required)

Example: 1

string railcards

Example: YNG,EDU

string startDate (required)

Example: 1539475200

string roverCode (required)

code of Rover you are looking for

Example: 14R

200 application/json
Response schema (show)
{
    "type": "object",
    "properties": {
        "response": {
            "type": "object",
            "required": [
                "fares"
            ],
            "additionalProperties": false,
            "properties": {
                "fares": {
                    "type": "array",
                    "description": "array of RoverOption links, which were selected as a best possible option for passenger set",
                    "items": {
                        "type": "string"
                    }
                }
            }
        },
        "links": {
            "type": "object"
        }
    }
}
Response example (show)
{
    "response": {
        "fares": [
            "/odyssey/rover-option/1234-I662-14R-1-0-77815-DIS-2018164-1234-I662-14R-1-0-77815-DIS-2018164",
            "/odyssey/rover-option/1234-I662-14R-1-0-50950-DIS-2018164-1234-I662-14R-1-0-50950-DIS-2018164"
        ]
    },
    "links": {
        "1234-I662-14R-1-0-77815-DIS-2018164": {
            "origin": "/station/1234",
            "destination": "/station/I662",
            "restrictionCode": "/restriction/AL",
            "isFirstClass": true,
            "price": 77815,
            "railcard": "/railcard/DIS",
            "type": "/rover-type/14R",
            "validityPeriod": {
                "from": "2018-06-13 00:00:00",
                "until": "2018-06-26 23:59:59"
            }
        },
        "1234-I662-14R-1-0-50950-DIS-2018164": {
            "origin": "/station/1234",
            "destination": "/station/I662",
            "restrictionCode": "/restriction/AL",
            "isFirstClass": false,
            "price": 50950,
            "railcard": "/railcard/DIS",
            "type": "/rover-type/14R",
            "validityPeriod": {
                "from": "2018-06-13 00:00:00",
                "until": "2018-06-26 23:59:59"
            }
        },
        "/odyssey/rover-option/1234-I662-14R-1-0-77815-DIS-2018164-1234-I662-14R-1-0-77815-DIS-2018164": {
            "fares": [
                {
                    "adults": 1,
                    "children": 0,
                    "fare": "/odyssey/rover/1234-I662-14R-1-0-77815-DIS-2018164"
                },
                {
                    "adults": 1,
                    "children": 0,
                    "fare": "/odyssey/rover/1234-I662-14R-1-0-77815-DIS-2018164"
                }
            ]
        },
        "/odyssey/rover-option/1234-I662-14R-1-0-50950-DIS-2018164-1234-I662-14R-1-0-50950-DIS-2018164": {
            "fares": [
                {
                    "adults": 1,
                    "children": 0,
                    "rover": "/odyssey/rover/1234-I662-14R-1-0-50950-DIS-2018164"
                },
                {
                    "adults": 1,
                    "children": 0,
                    "rover": "/odyssey/rover/1234-I662-14R-1-0-50950-DIS-2018164"
                }
            ]
        },
        "/station/7648": [],
        "/station/I662": [],
        "/restriction/AL": [],
        "/rover-type/14R": [],
        "/railcard/DIS": []
    }
}

GET /odyssey/rover-option/:id

Return rover option.

200 application/json
Response schema (show)
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "fares": {
                    "type": "array",
                    "description": "List of rover uses.",
                    "items": {
                        "type": "object",
                        "properties": {
                            "adults": {
                                "type": "number"
                            },
                            "children": {
                                "type": "number"
                            },
                            "rover": {
                                "type": "string",
                                "description": "URI of rover-type"
                            }
                        }
                    }
                }
            },
            "required": [
                "fares"
            ]
        }
    }
}
Response example (show)
{
    "data": {
        "fares": [
            {
                "adults": 1,
                "children": 0,
                "fare": "/odyssey/rover/1234-I662-14R-1-0-77815-DIS-2018164"
            },
            {
                "adults": 0,
                "children": 1,
                "fare": "/odyssey/rover/1234-I662-14R-0-1-58950--2018164"
            }
        ]
    },
    "links": {
        "1234-I662-14R-1-0-77815-DIS-2018164": {
            "origin": "/station/1234",
            "destination": "/station/I662",
            "restrictionCode": "/restriction/AL",
            "isFirstClass": true,
            "price": 77815,
            "railcard": "/railcard/DIS",
            "type": "/rover-type/14R",
            "validityPeriod": {
                "from": "2018-06-13 00:00:00",
                "until": "2018-06-26 23:59:59"
            }
        },
        "1234-I662-14R-0-1-58950--2018164": {
            "origin": "/station/1234",
            "destination": "/station/I662",
            "restrictionCode": "/restriction/AL",
            "isFirstClass": true,
            "price": 58950,
            "railcard": "/railcard/null",
            "type": "/rover-type/14R",
            "validityPeriod": {
                "from": "2018-06-13 00:00:00",
                "until": "2018-06-26 23:59:59"
            }
        },
        "/station/7648": [],
        "/station/I662": [],
        "/restriction/AL": [],
        "/rover-type/14R": [],
        "/railcard/DIS": []
    }
}

GET /odyssey/rover/:id

Return rover.

200 application/json
Response schema (show)
{
    "type": "object",
    "properties": {
        "data": {
            "type": "object",
            "properties": {
                "origin": {
                    "type": "string",
                    "description": "origin station URI. It will be always retailer NLC uri."
                },
                "destination": {
                    "type": "string",
                    "description": "origin station URI. It will be always rover accounting code uri."
                },
                "price": {
                    "type": "number",
                    "description": "Sum of 'rovers' prices"
                },
                "railcard": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "restrictionCode": {
                    "type": "string",
                    "description": "Restriction code"
                },
                "isFirstClass": {
                    "type": "boolean"
                },
                "validityPeriod": {
                    "type": "object",
                    "properties": {
                        "from": {
                            "type": "string"
                        },
                        "until": {
                            "type": "string"
                        }
                    }
                }
            },
            "required": [
                "origin",
                "destination",
                "price",
                "railcard",
                "restrictionCode",
                "isFirstClass",
                "validityPeriod"
            ]
        }
    }
}
Response example (show)
{
    "data": {
        "origin": "/station/1234",
        "destination": "/station/I662",
        "restrictionCode": "AL",
        "isFirstClass": true,
        "price": 77815,
        "railcard": "/railcard/DIS",
        "type": "/rover-type/14R",
        "validityPeriod": {
            "from": "2018-06-13 00:00:00",
            "until": "2018-06-26 23:59:59"
        }
    },
    "links": {
        "/station/7648": [],
        "/station/I662": [],
        "/restriction/AL": [],
        "/rover-type/14R": [],
        "/railcard/DIS": []
    }
}

GET /odyssey/loading

Service loading information

Parameters

string tenant

Tenant name

Headers

string X-Tenant

Tenant name

200 application/json
Response schema (show)
{
    "type": "object",
    "required": [
        "data"
    ],
    "additionalProperties": false,
    "properties": {
        "data": {
            "type": "array",
            "items": {
                "required": [
                    "rid",
                    "uid",
                    "toc",
                    "departure",
                    "arrival",
                    "stops"
                ],
                "additionalProperties": false,
                "properties": {
                    "rid": {
                        "type": "string",
                        "pattern": "[0-9]+"
                    },
                    "uid": {
                        "type": "string",
                        "pattern": "[A-Z]+[0-9]+"
                    },
                    "toc": {
                        "type": "string",
                        "pattern": "[A-Z]{2}"
                    },
                    "departure": {
                        "type": "string",
                        "pattern": "\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}"
                    },
                    "arrival": {
                        "type": "string",
                        "pattern": "\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}"
                    },
                    "stops": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "required": [
                                "crs",
                                "departure"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "crs": {
                                    "type": "string",
                                    "pattern": "[A-Z]{3}"
                                },
                                "departure": {
                                    "type": "string",
                                    "pattern": "\\d{4}\\-\\d{2}\\-\\d{2}T\\d{2}:\\d{2}"
                                },
                                "averageLoading": {
                                    "type": "number",
                                    "minimum": 0,
                                    "maximum": 100
                                },
                                "observedLoading": {
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "coaches": {
                        "type": "object"
                    }
                }
            }
        },
        "links": {
            "type": "object"
        }
    }
}
Response example (show)
{
    "data": [
        {
            "rid": "201901317119776",
            "uid": "G19776",
            "toc": "GX",
            "departure": "2019-01-31T06:14",
            "arrival": "2019-01-31T07:14",
            "stops": [
                {
                    "crs": "BTN",
                    "departure": "2019-01-31T06:14",
                    "averageLoading": 25,
                    "observedLoading": {
                        "1": 10,
                        "2": 20
                    }
                },
                {
                    "crs": "HSK",
                    "departure": "2019-01-31T06:23",
                    "averageLoading": 30,
                    "observedLoading": {
                        "1": 15,
                        "2": 25
                    }
                }
            ],
            "coaches": {
                "1": {
                    "class": "Standard",
                    "toiletType": "Accessible",
                    "toiletStatus": "Unknown"
                },
                "2": {
                    "class": "Standard",
                    "toiletType": "Standard",
                    "toiletStatus": "Unknown"
                }
            }
        },
        {
            "rid": "201901317119837",
            "uid": "G19837",
            "toc": "GX",
            "departure": "2019-01-31T06:29",
            "arrival": "2019-01-31T07:28",
            "stops": [
                {
                    "crs": "BTN",
                    "departure": "2019-01-31T06:29"
                },
                {
                    "crs": "HSK",
                    "departure": "2019-01-31T06:38"
                }
            ]
        }
    ],
    "links": []
}

GET /odyssey/travelcard

Query standalone Travelcard fares. Travelcards are only available in the London area.

Parameters

string date (required)

Date of travel on the travelcard.

Example: 1540425600

integer adults (required)

Number of adult fares.

Example: 1

integer children

Number of child fares.

Example: 2

string railcards

Comma separated list of railcards. To indicate multiples of a railcard type either repeat it, or use the 'x' format (YNGx3).

Example: YNGx2,DIS

string promoCode

Promo code to apply to the fares, if possible.

Example: SUMMER23

string include

Lets you specify which parts of the response you want to include.

Example: *.station

string ticketType

For debugging purposes, allows you to specify a ticket type to return.

Example: 1SA

200 application/json
Response schema (show)
{
    "type": "object",
    "properties": {
        "response": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "fares"
            ],
            "properties": {
                "fares": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "pattern": "/fare\\-option/fare/.+"
                    }
                }
            }
        },
        "links": {
            "type": "object"
        }
    }
}
Response example (show)
{
    "response": {
        "fares": [
            "/odyssey/fare-option/fare/1072-0034-01000-ADT-000-1----58-1-0--1-0",
            "/odyssey/fare-option/fare/1072-0035-01000-ADT-000-1----58-1-0--1-0",
            "/odyssey/fare-option/fare/1072-0035-01000-ODT-000-1-B1---58-1-0--1-0"
        ]
    },
    "links": []
}

Journey Planning Reference Data

GET /current-schedule/{origin}/{destination}/{departure}/{arrival}/{rsid}

Fetch latest state of a scheduled leg.

Parameters

string origin (required)

NLC, TIPLOC or CRS code of journey origin

Example: TBW

string destination (required)

NLC, TIPLOC or CRS code of journey destination

Example: TBW

string departure (required)

Original departure date and time

Example: 2018-10-25T12:34

string arrival (required)

Original arrival date and time

Example: 2018-10-25T12:34

string rsid (required)

Original RSID of the service

Example: GW646000

200 application/json
Response schema (show)
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "status",
        "data",
        "links"
    ],
    "properties": {
        "status": {
            "type": "string"
        },
        "data": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "type",
                "source",
                "mode",
                "origin",
                "destination",
                "departure",
                "arrival",
                "service",
                "stops"
            ],
            "properties": {
                "type": {
                    "type": "string",
                    "pattern": "timetabled|fixed"
                },
                "source": {
                    "type": "string",
                    "pattern": "dtd|darwin"
                },
                "mode": {
                    "type": "string"
                },
                "origin": {
                    "type": "string",
                    "pattern": "[A-Z]{3}",
                    "example": "EUS"
                },
                "originNlc": {
                    "type": "string",
                    "pattern": "[a-z0-9]{4}",
                    "example": "1072"
                },
                "destination": {
                    "type": "string",
                    "pattern": "[A-Z]{3}",
                    "example": "EUS"
                },
                "destinationNlc": {
                    "type": "string",
                    "pattern": "[a-z0-9]{4}",
                    "example": "1072"
                },
                "departure": {
                    "description": "Unix timestamp",
                    "type": "integer"
                },
                "arrival": {
                    "description": "Unix timestamp",
                    "type": "integer"
                },
                "scheduledDeparture": {
                    "description": "Unix timestamp",
                    "type": "integer"
                },
                "scheduledArrival": {
                    "description": "Unix timestamp",
                    "type": "integer"
                },
                "service": {
                    "type": "string",
                    "pattern": "/service/.+"
                },
                "disruptionReason": {
                    "type": "string"
                },
                "stops": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                            "station",
                            "departure",
                            "arrival",
                            "cancelled",
                            "platform",
                            "pickup",
                            "dropoff"
                        ],
                        "properties": {
                            "station": {
                                "type": "string",
                                "pattern": "[A-Z]{3}",
                                "example": "EUS"
                            },
                            "stationNlc": {
                                "type": "string",
                                "pattern": "[a-z0-9]{4}",
                                "example": "1072"
                            },
                            "departure": {
                                "description": "Unix timestamp",
                                "type": "integer"
                            },
                            "arrival": {
                                "description": "Unix timestamp",
                                "type": "integer"
                            },
                            "scheduledDeparture": {
                                "description": "Unix timestamp",
                                "type": "integer"
                            },
                            "scheduledArrival": {
                                "description": "Unix timestamp",
                                "type": "integer"
                            },
                            "cancelled": {
                                "type": "boolean"
                            },
                            "platform": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "pickup": {
                                "type": "boolean"
                            },
                            "dropoff": {
                                "type": "boolean"
                            }
                        }
                    }
                }
            }
        },
        "links": {
            "type": "object"
        }
    }
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "timetabled",
        "source": "dtd",
        "mode": "train",
        "origin": "LST",
        "originNlc": "6965",
        "destination": "CLT",
        "destinationNlc": "6850",
        "departure": 1642977420,
        "arrival": 1642982880,
        "scheduledArrival": 1637879800,
        "service": "/service/23:C56364",
        "stops": [
            {
                "station": "LST",
                "stationNlc": "6965",
                "departure": 1642977420,
                "arrival": 1642977420,
                "cancelled": false,
                "platform": "12",
                "pickup": true,
                "dropoff": false
            },
            {
                "station": "GDP",
                "stationNlc": "6877",
                "departure": 1642978350,
                "arrival": 1642978350,
                "cancelled": false,
                "platform": "2",
                "pickup": false,
                "dropoff": false
            }
        ],
        "disruptionReason": "This train has been delayed by a passenger having been taken ill earlier near London Euston"
    },
    "links": []
}

Orders

Orders in the AWT are a heavily nested data structure with many sub-elements. Until an order has sufficient payment records it is considered an incomplete basket with an expiry date set by the server. When enough payment records have been added to cover the cost of the items the order sold callback will be triggered and the order will be sent for fulfilment. At present only one fulfilment method is allowed per order.

The items in an order can either be a trip or a sundry. A trip is analogous to a basket item whereas a sundry is an additional item, such as a delivery fee or card fee.

POST /order

Create an order. This endpoint will return an API token that will be needed for future modification of the order. It can create also change of journey order.

Request schema (show)
{
    "type": "object",
    "properties": {
        "items": {
            "oneOf": [
                {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "outward": {
                                "description": "for outward fare option",
                                "type": "object",
                                "required": [
                                    "journey",
                                    "reservationPreferences"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "journey": {
                                        "type": "string",
                                        "pattern": "^/odyssey/journey/.+$"
                                    },
                                    "reservationRequested": {
                                        "type": "boolean"
                                    },
                                    "reservationPreferences": {
                                        "type": "array",
                                        "items": {
                                            "enum": [
                                                "AISL",
                                                "WIND",
                                                "AIRL",
                                                "TABL",
                                                "FACE",
                                                "BACK",
                                                "QUIE"
                                            ]
                                        }
                                    }
                                }
                            },
                            "inward": {
                                "description": "for inward (in case of 2 singles or return ticket) ticket",
                                "type": "object",
                                "required": [
                                    "journey",
                                    "reservationPreferences"
                                ],
                                "additionalProperties": false,
                                "properties": {
                                    "journey": {
                                        "type": "string",
                                        "pattern": "^/odyssey/journey/.+$"
                                    },
                                    "reservationRequested": {
                                        "type": "boolean"
                                    },
                                    "reservationPreferences": {
                                        "type": "array",
                                        "items": {
                                            "enum": [
                                                "AISL",
                                                "WIND",
                                                "AIRL",
                                                "TABL",
                                                "FACE",
                                                "BACK",
                                                "QUIE"
                                            ]
                                        }
                                    }
                                }
                            },
                            "fares": {
                                "type": "object",
                                "properties": {
                                    "outwardSingle": {
                                        "type": "string",
                                        "pattern": "^/odyssey/fare-option/.+$"
                                    },
                                    "inwardSingle": {
                                        "type": "string",
                                        "pattern": "^/odyssey/fare-option/.+$"
                                    },
                                    "return": {
                                        "type": "string",
                                        "pattern": "^/odyssey/fare-option/.+$"
                                    },
                                    "carnet": {
                                        "fareOption": {
                                            "type": "string",
                                            "pattern": "^/odyssey/fare-option/.+$"
                                        },
                                        "validFrom": {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                        }
                                    },
                                    "travelcard": {
                                        "type": "string",
                                        "pattern": "^/odyssey/fare-option/.+$"
                                    }
                                },
                                "additionalProperties": false
                            },
                            "addons": {
                                "type": "object",
                                "properties": {
                                    "outward": {
                                        "origin": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/odyssey/fare-option/addon/.+$"
                                            }
                                        },
                                        "destination": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/odyssey/fare-option/addon/.+$"
                                            }
                                        }
                                    },
                                    "inward": {
                                        "origin": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/odyssey/fare-option/addon/.+$"
                                            }
                                        },
                                        "destination": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/odyssey/fare-option/addon/.+$"
                                            }
                                        }
                                    }
                                }
                            }
                        },
                        "additionalProperties": false
                    }
                },
                {
                    "type": "object",
                    "properties": {
                        "outward": {
                            "description": "for outward fare option",
                            "type": "object",
                            "required": [
                                "journey",
                                "reservationPreferences"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "journey": {
                                    "type": "string",
                                    "pattern": "^/odyssey/journey/.+$"
                                },
                                "reservationRequested": {
                                    "type": "boolean"
                                },
                                "reservationPreferences": {
                                    "type": "array",
                                    "items": {
                                        "enum": [
                                            "AISL",
                                            "WIND",
                                            "AIRL",
                                            "TABL",
                                            "FACE",
                                            "BACK",
                                            "QUIE"
                                        ]
                                    }
                                }
                            }
                        },
                        "inward": {
                            "description": "for inward (in case of 2 singles or return ticket) ticket",
                            "type": "object",
                            "required": [
                                "journey",
                                "reservationPreferences"
                            ],
                            "additionalProperties": false,
                            "properties": {
                                "journey": {
                                    "type": "string",
                                    "pattern": "^/odyssey/journey/.+$"
                                },
                                "reservationRequested": {
                                    "type": "boolean"
                                },
                                "reservationPreferences": {
                                    "type": "array",
                                    "items": {
                                        "enum": [
                                            "AISL",
                                            "WIND",
                                            "AIRL",
                                            "TABL",
                                            "FACE",
                                            "BACK",
                                            "QUIE"
                                        ]
                                    }
                                }
                            }
                        },
                        "fares": {
                            "type": "object",
                            "properties": {
                                "outwardSingle": {
                                    "type": "string",
                                    "pattern": "^/odyssey/fare-option/.+$"
                                },
                                "inwardSingle": {
                                    "type": "string",
                                    "pattern": "^/odyssey/fare-option/.+$"
                                },
                                "return": {
                                    "type": "string",
                                    "pattern": "^/odyssey/fare-option/.+$"
                                },
                                "carnet": {
                                    "fareOption": {
                                        "type": "string",
                                        "pattern": "^/odyssey/fare-option/.+$"
                                    },
                                    "validFrom": {
                                        "type": "string",
                                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                    }
                                },
                                "travelcard": {
                                    "type": "string",
                                    "pattern": "^/odyssey/fare-option/.+$"
                                }
                            },
                            "additionalProperties": false
                        },
                        "addons": {
                            "type": "object",
                            "properties": {
                                "outward": {
                                    "origin": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "pattern": "^/odyssey/fare-option/addon/.+$"
                                        }
                                    },
                                    "destination": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "pattern": "^/odyssey/fare-option/addon/.+$"
                                        }
                                    }
                                },
                                "inward": {
                                    "origin": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "pattern": "^/odyssey/fare-option/addon/.+$"
                                        }
                                    },
                                    "destination": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "pattern": "^/odyssey/fare-option/addon/.+$"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "additionalProperties": false
                }
            ]
        },
        "referrer": {
            "type": "string"
        },
        "campaign": {
            "type": "string"
        },
        "links": {
            "type": [
                "array",
                "object"
            ]
        },
        "originalTickets": {
            "type": "string"
        }
    },
    "required": [
        "items"
    ],
    "additionalProperties": false
}
Request example (show)
{
    "items": {
        "fares": {
            "outwardSingle": "/odyssey/fare-option/161:/fare/8649-1444-00345-2S8-000-1-U6--161-1-0--2-0"
        },
        "outward": {
            "reservationPreferences": [],
            "journey": "/odyssey/journey/161:161:INV_EUS_C83856"
        }
    }
}
201 application/json
Response headers

string Location (required)

Response schema (show)
{
    "description": "Response with data",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/order/123"
    }
}
422 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
424 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /order/{id}

Return an order and the products and payments inside the order.

Parameters

string include

Headers

string X-Token-Data (required)

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "tenant": {
                            "type": "string",
                            "pattern": "^[a-z]+$"
                        },
                        "state": {
                            "description": "Order state",
                            "type": "string",
                            "enum": [
                                "Held",
                                "Sold",
                                "Fulfilled",
                                "Cancelled",
                                "Non Issued"
                            ]
                        },
                        "owner": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "retailer": {
                            "type": "string",
                            "pattern": "^[0-9]{4}$"
                        },
                        "purchased": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "updated": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "channel": {
                            "type": "string"
                        },
                        "referrer": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "campaign": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "originalOrder": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "travelReason": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "items": {
                            "type": "array",
                            "items": {
                                "oneOf": [
                                    {
                                        "type": "string",
                                        "pattern": "^/trip/[0-9]+$"
                                    },
                                    {
                                        "type": "string",
                                        "pattern": "^/sundry/[0-9]+$"
                                    }
                                ]
                            }
                        },
                        "payments": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/(st-card|warrant|card)-payment|paypal|account-warrant/[0-9]+$"
                            }
                        },
                        "customer": {
                            "type": "string",
                            "pattern": "^/customer/[0-9]+$"
                        },
                        "delivery": {
                            "type": [
                                "object",
                                "null"
                            ],
                            "properties": {
                                "type": {
                                    "type": "string",
                                    "pattern": "^/delivery/.+$"
                                },
                                "sundry": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^/sundry/[0-9]+$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "fulfilmentMethod": {
                                    "type": "number"
                                },
                                "collectionReference": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[0-9A-Z]{8}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "smartcardUri": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^/(smartcards|external-smartcards|temporary-smartcards)/[A-Z0-9]+$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "address": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^/address/[0-9]+$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                }
                            }
                        },
                        "fulfilment": {
                            "type": "string",
                            "pattern": "^/order/[0-9]+/fulfilment$"
                        },
                        "totalPrice": {
                            "description": "An amount of GBP pence",
                            "type": "integer"
                        },
                        "totalLeftToPay": {
                            "description": "An amount of GBP pence",
                            "type": "integer"
                        },
                        "hash": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "tenant",
                        "retailer",
                        "purchased"
                    ],
                    "additionalProperties": false
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "tenant": "company",
        "state": "Fulfilled",
        "owner": "/user/123",
        "retailer": "1234",
        "purchased": "2023-10-30T07:43:38+00:00",
        "created": "2023-10-30T07:43:30+00:00",
        "updated": "2023-10-30T07:43:38+00:00",
        "channel": "WEB",
        "referrer": "",
        "campaign": "",
        "travelReason": null,
        "originalOrder": null,
        "fulfilment": "/order/12/fulfilment",
        "items": [
            "/trip/123",
            "/trip/124",
            "/sundry/123",
            "/sundry/124"
        ],
        "payments": [
            "/card-payment/123",
            "/warrant/123456"
        ],
        "hash": "0046511fa7c78f066a01250e5c44794fc9d6d000",
        "totalPrice": 5432,
        "totalLeftToPay": 0,
        "delivery": {
            "type": "/delivery/e-ticket",
            "sundry": null,
            "fulfilmentMethod": 6,
            "collectionReference": null,
            "collectionPoint": null,
            "smartcardUri": null,
            "address": "/address/12345"
        }
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

PUT /order/{id}

Reclaim order as logged in user.

Headers

string X-Token-Data (required)

Request schema (show)
{
    "type": "any"
}
200 application/json
Response schema (show)
{
    "description": "Response with data",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/order/123"
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

GET /order/{id}/fulfilment

Return the fulfilment status of the order. Note that individual items in the order may have different fulfilment statuses.

Headers

string X-Token-Data (required)

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "machine": {
                            "type": "string",
                            "pattern": "^/machine/[A-Z0-9]{3,}/\\d{2}/\\d{4}$"
                        },
                        "history": {
                            "properties": {
                                "state": {
                                    "type": "string"
                                },
                                "ticket": {
                                    "type": "string",
                                    "pattern": "^/ticket/[0-9]+$"
                                },
                                "sundry": {
                                    "type": "string",
                                    "pattern": "^/sundry/[0-9]+$"
                                }
                            }
                        }
                    },
                    "required": [
                        "machine",
                        "history"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "machine": "/machine/H123/01/2222",
        "history": {
            "2016-09-16T15:13:29Z": [
                {
                    "state": "checked out",
                    "ticket": "/ticket/1"
                },
                {
                    "state": "checked out",
                    "sundry": "/sundry/1"
                },
                {
                    "state": "checked out",
                    "sundry": "/sundry/2"
                }
            ]
        }
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

GET /order/{id}/state

Return the state of the order.

Headers

string X-Token-Data (required)

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "state": {
                            "description": "Order state",
                            "type": "string",
                            "enum": [
                                "Held",
                                "Sold",
                                "Fulfilled",
                                "Cancelled",
                                "Non Issued"
                            ]
                        }
                    },
                    "required": [
                        "state"
                    ],
                    "additionalProperties": false
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "state": "Fulfilled"
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /order/{id}/confirmation

Re-send order confirmation email

Headers

string X-Token-Data (required)

Request schema (show)
{
    "type": "array",
    "additionalProperties": false
}
200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /order/{id}/delivery

Add delivery method to existing order without delivery

Request schema (show)
{
    "type": "object",
    "properties": {
        "delivery": {
            "type": "object",
            "description": "Delivery property is allowed only if items are not blank. You can't specify delivery type when there is no items in order.",
            "properties": {
                "type": {
                    "type": "string",
                    "pattern": "^/delivery/.+$"
                },
                "collectionPoint": {
                    "type": "string",
                    "pattern": "^/station/[A-Z0-9]+$"
                },
                "address": {
                    "type": "object",
                    "properties": {
                        "title": {
                            "type": "string"
                        },
                        "firstNames": {
                            "type": "string"
                        },
                        "surname": {
                            "type": "string"
                        },
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "address3": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "town": {
                            "type": "string"
                        },
                        "county": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "postCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "telephoneNumber": {
                            "type": "string"
                        }
                    }
                },
                "smartcardDetails": {
                    "schema": "http://json-schema.org/schema",
                    "type": "object",
                    "description": "Used only in case of /new-smartcard delivery type",
                    "properties": {
                        "displayName": {
                            "type": "string",
                            "pattern": ".{1,100}",
                            "description": "Human-readable name of card. To be used in GUI."
                        },
                        "name": {
                            "type": "string",
                            "pattern": "\\w{2,100}"
                        },
                        "surname": {
                            "type": "string",
                            "pattern": "\\w{2,100}"
                        },
                        "title": {
                            "type": "string",
                            "pattern": "\\w{2,10}"
                        },
                        "gender": {
                            "type": "number",
                            "enum": [
                                1,
                                2
                            ],
                            "description": "1-Male, 2-Female"
                        },
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": "string"
                        },
                        "address3": {
                            "type": "string"
                        },
                        "address4": {
                            "type": "string"
                        },
                        "address5": {
                            "type": "string"
                        },
                        "address6": {
                            "type": "string"
                        },
                        "postcode": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "displayName",
                        "name",
                        "surname",
                        "title",
                        "gender",
                        "address1",
                        "address2",
                        "postcode"
                    ],
                    "additionalProperties": false
                },
                "smartcard": {
                    "schema": "http://json-schema.org/schema",
                    "type": "object",
                    "description": "Used for existing smartcards (both external and created by us).",
                    "properties": {
                        "uri": {
                            "type": "string"
                        },
                        "location": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "uri",
                        "location"
                    ],
                    "additionalProperties": false
                },
                "passenger": {
                    "schema": "http://json-schema.org/schema",
                    "type": "object",
                    "description": "Passenger data used for GoldStar fulfilment. At least one property is required.",
                    "properties": {
                        "address": {
                            "type": "../Address/Address.jschema"
                        },
                        "photocard": {
                            "schema": "http://json-schema.org/schema",
                            "type": "object",
                            "description": "Used for GoldStar fulfilment",
                            "properties": {
                                "photocardNumber": {
                                    "type": "string"
                                },
                                "photocardPostcode": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "photocardNumber",
                                "photocardPostcode"
                            ],
                            "additionalProperties": false
                        },
                        "isChild": {
                            "type": "boolean"
                        }
                    },
                    "additionalProperties": false
                }
            },
            "required": [
                "type"
            ],
            "additionalProperties": false
        },
        "links": {
            "type": [
                "array",
                "object"
            ]
        }
    },
    "required": [
        "delivery"
    ],
    "additionalProperties": true
}
Request example (show)
{
    "delivery": {
        "type": "/delivery/mobile",
        "collectionPoint": "/station/H456",
        "address": {
            "title": "Mr",
            "firstNames": "Tester",
            "surname": "Person",
            "address1": "456 Test Street",
            "address2": "Another Street",
            "address3": null,
            "town": "Test Town",
            "county": "Norfolk",
            "country": "United Kingdom",
            "postCode": "TE57 1NG",
            "telephoneNumber": "+79123123123"
        }
    },
    "links": {
        "/delivery/mobile": {
            "uri": "/delivery/mobile",
            "displayOrder": 1,
            "name": "mobile",
            "time": "5 minutes",
            "requirements": "Available to both UK and overseas customers. The card used to make payment will be required for collection. Tickets can be collected from the above stations.",
            "fulfilmentType": 5,
            "price": 0,
            "isForCarnet": false,
            "isForSeason": true,
            "minSecondsBefore": 1200,
            "minWorkingDaysBefore": null,
            "maxValue": null
        }
    }
}
200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

DELETE /order/{id}/delivery

200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /order/{id}/travel-reason

Add travel reason to existing order

Request schema (show)
{
    "type": "object",
    "properties": {
        "reason": {
            "type": "string",
            "description": "A travel reason of the customer. Can be any string"
        }
    },
    "required": [
        "reason"
    ],
    "additionalProperties": false
}
Request example (show)
{
    "reason": "Ditching"
}
200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /order/{id}/cost-centres

Add cost centres to existing not yet sold order

Request schema (show)
{
    "type": "object",
    "properties": {
        "costCentres": {
            "type": "string"
        }
    },
    "required": [
        "costCentres"
    ],
    "additionalProperties": false
}
Request example (show)
{
    "costCentres": "Cost centre 1, Cost centre 2"
}
200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

DELETE /order/{id}/trip/{tripId}

Delete trip from existing order. Cancel all trip reservations. If order was already paid for or delivery type was set, trip won't be removed.

200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string customerId (required)

Pattern: ^\d+$

GET /order-by-customer/{customerId}

Return the list of orders by customer id

Headers

string X-Token-Data (required)

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "meta": {
                            "type": "object",
                            "properties": {
                                "page": {
                                    "type": "integer"
                                },
                                "perPage": {
                                    "type": "integer"
                                },
                                "lastPage": {
                                    "type": "integer"
                                }
                            }
                        },
                        "data": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/order/[0-9]+$"
                            }
                        }
                    }
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "meta": {
            "page": 1,
            "perPage": 10,
            "lastPage": 10
        },
        "data": [
            "/order/0001018025",
            "/order/0001018024"
        ]
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /trip/{id}

A trip is a equivilent to a single basket item. It may consist of one or two journeys and one to two fare options for those journeys. In addition to the fares for the journeys, fare options for plus bus, season tickets or travelcards may be added.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "outwardJourney": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/journey/[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "returnJourney": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/journey/[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "items": {
                            "type": "object",
                            "properties": {
                                "outwardSingle": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "^/ticket/[0-9]+$"
                                    }
                                },
                                "returnSingle": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "^/ticket/[0-9]+$"
                                    }
                                },
                                "return": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "^/ticket/[0-9]+$"
                                    }
                                },
                                "outwardPlusBus": {
                                    "type": "object",
                                    "properties": {
                                        "origin": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/ticket/[0-9]+$"
                                            }
                                        },
                                        "destination": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/ticket/[0-9]+$"
                                            }
                                        }
                                    },
                                    "additionalProperties": false
                                },
                                "returnPlusBus": {
                                    "type": "object",
                                    "properties": {
                                        "origin": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/ticket/[0-9]+$"
                                            }
                                        },
                                        "destination": {
                                            "type": "array",
                                            "items": {
                                                "type": "string",
                                                "pattern": "^/ticket/[0-9]+$"
                                            }
                                        }
                                    },
                                    "additionalProperties": false
                                },
                                "travelcardAddon": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "^/ticket/[0-9]+$"
                                    }
                                },
                                "petTickets": {
                                    "type": "array",
                                    "items": {
                                        "type": "string",
                                        "pattern": "^/ticket/[0-9]+$"
                                    }
                                }
                            },
                            "additionalProperties": false
                        }
                    },
                    "required": [
                        "outwardJourney",
                        "returnJourney",
                        "items"
                    ],
                    "additionalProperties": false
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "outwardJourney": "/journey/123456789123",
        "returnJourney": null,
        "items": {
            "outwardSingle": [
                "/ticket/1111",
                "/ticket/1112"
            ],
            "returnSingle": [
                "/ticket/1211",
                "/ticket/1212"
            ],
            "outwardPlusBus": {
                "origin": [
                    "/ticket/1121",
                    "/ticket/1122"
                ]
            },
            "returnPlusBus": {
                "destination": [
                    "/ticket/1221",
                    "/ticket/1222"
                ]
            }
        }
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Trip with id 9223372036854775807 not found."
}

PUT /trip/{id}/seating

Update trip seating

Request schema (show)
{
    "type": "object",
    "additionalProperties": true
}
Request example (show)
{
    "/seat-reservation/1": "K13L",
    "/seat-reservation/3": "L13L"
}
200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/trip/123"
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /trip/{id}/nodes

Add trip nodes

Request schema (show)
{
    "type": "object",
    "additionalProperties": true
}
Request example (show)
{
    "children5To11": 3,
    "children12To15": 1
}
200 application/json
Response schema (show)
{
    "description": "A standard JSON response",
    "type": "object",
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": [
                "object",
                "array"
            ]
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    }
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/trip/123"
    }
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /ticket/{id}

A ticket is the right to travel for one or more passengers on one or two journeys.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "fare": {
                            "type": "string",
                            "pattern": "^/fare/[0-9]+$"
                        },
                        "adults": {
                            "type": "integer"
                        },
                        "children": {
                            "type": "integer"
                        },
                        "transactionNumber": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{5}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "reservation": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/reservation/[A-Z0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "utn": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "outwardPortion": {
                            "type": "string",
                            "pattern": "^/journey/[0-9]+$"
                        },
                        "returnPortion": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/journey/[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "outwardValidity": {
                            "properties": {
                                "validFrom": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "validTo": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                }
                            }
                        },
                        "returnValidity": {
                            "properties": {
                                "validFrom": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                },
                                "validTo": {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                }
                            }
                        },
                        "supplements": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/supplement/[0-9]+$"
                            }
                        },
                        "seats": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "seat": {
                                        "type": "string",
                                        "pattern": "^/seat-reservation/[0-9]+$"
                                    },
                                    "leg": {
                                        "type": "string",
                                        "pattern": "^/leg/[0-9]+$"
                                    },
                                    "supplement": {
                                        "type": "string",
                                        "pattern": "^/supplement/[0-9]+$"
                                    }
                                },
                                "required": [
                                    "seat",
                                    "leg",
                                    "supplement"
                                ]
                            }
                        },
                        "splitInfo": {
                            "type": "object",
                            "required": [
                                "sectionIds",
                                "outwardOrigin",
                                "outwardDestination",
                                "inwardOrigin",
                                "inwardDestination"
                            ],
                            "properties": {
                                "sectionIds": {
                                    "type": "array",
                                    "items": {
                                        "type": "integer"
                                    },
                                    "examples": [
                                        [
                                            1
                                        ],
                                        [
                                            1,
                                            3,
                                            4
                                        ]
                                    ]
                                },
                                "outwardOrigin": {
                                    "$oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[A-Z]{3}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ],
                                    "examples": [
                                        "EUS",
                                        null
                                    ]
                                },
                                "outwardDestination": {
                                    "$oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[A-Z]{3}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ],
                                    "examples": [
                                        "EUS",
                                        null
                                    ]
                                },
                                "inwardOrigin": {
                                    "$oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[A-Z]{3}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ],
                                    "examples": [
                                        "EUS",
                                        null
                                    ]
                                },
                                "inwardDestination": {
                                    "$oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[A-Z]{3}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ],
                                    "examples": [
                                        "EUS",
                                        null
                                    ]
                                }
                            }
                        },
                        "passenger": {
                            "type": [
                                "string"
                            ]
                        },
                        "originalTicket": {
                            "type": "string",
                            "pattern": "^/ticket/[0-9]+$"
                        },
                        "priceCoveredByOriginalTicket": {
                            "type": [
                                "integer",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "fare",
                        "adults",
                        "children",
                        "transactionNumber",
                        "reservation",
                        "utn",
                        "outwardValidity",
                        "returnValidity",
                        "supplements",
                        "seats"
                    ],
                    "additionalProperties": false
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "fare": "/fare/5",
        "adults": 1,
        "children": 0,
        "transactionNumber": "00123",
        "reservation": "/reservation/XXXYYY",
        "utn": "AA123456789",
        "outwardPortion": "/journey/1",
        "returnPortion": null,
        "outwardValidity": {
            "validFrom": "2017-01-24",
            "validUntil": "2018-01-23"
        },
        "returnValidity": null,
        "supplements": [
            "/supplement/123456"
        ],
        "seats": [
            {
                "seat": "/seat-reservation/123",
                "origin": "WVH",
                "destination": "SGB",
                "leg": "/leg/123",
                "supplement": "/supplement/123456"
            },
            {
                "seat": "/seat-reservation/124",
                "origin": "SGB",
                "destination": "CRA",
                "leg": "/leg/124",
                "supplement": "/supplement/123456"
            }
        ],
        "splitInfo": {
            "sectionIds": [
                1
            ],
            "outwardOrigin": "KID",
            "outwardDestination": "CRA",
            "inwardOrigin": null,
            "inwardDestination": null
        },
        "passenger": "/passenger/123",
        "originalTicket": "/ticket/321998",
        "priceCoveredByOriginalTicket": 520
    },
    "links": {
        "/fare/5": [],
        "/reservation/XXXYYY": [],
        "/supplement/123456": [],
        "/ticket/321998": []
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Ticket with id 9223372036854775807 not found."
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /fare/{id}

Abstract information for a ticket. The fare itself contains the origin, destination, route, ticket type and restriction of the fare but is not bound to a particular date range like the ticket. Instead the ticket type has a validity duration.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "ticketType": {
                            "type": "string",
                            "pattern": "^/ticket-type/[A-Z0-9]{3}$"
                        },
                        "origin": {
                            "type": "string",
                            "pattern": "^/station/[A-Z0-9]+$"
                        },
                        "destination": {
                            "type": "string",
                            "pattern": "^/station/[A-Z0-9]+$"
                        },
                        "price": {
                            "type": "number"
                        },
                        "originalPrice": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "railcard": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "restrictionCode": {
                            "type": "string",
                            "pattern": "^[A-Z0-9]{2}$"
                        },
                        "route": {
                            "type": "string",
                            "pattern": "^/route/[0-9]{5}$"
                        },
                        "statusCode": {
                            "type": "string"
                        },
                        "fareSetter": {
                            "type": [
                                "null",
                                "string"
                            ]
                        },
                        "xLondon": {
                            "type": "number",
                            "description": "0 - not cross London; 1 - cross London; 2 - cross London by underground"
                        },
                        "isPlusBus": {
                            "type": "boolean"
                        },
                        "discount": {
                            "oneOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "type": {
                                            "type": "string",
                                            "pattern": "^/discount/[0-9]+$"
                                        },
                                        "lennonCode": {
                                            "type": "string"
                                        },
                                        "promoCode": {
                                            "type": "string"
                                        },
                                        "percent": {
                                            "type": "number"
                                        },
                                        "shortDescription": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        }
                                    },
                                    "required": [],
                                    "additionalProperties": false
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "childStatusDescription": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "adultStatusDescription": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "ticketType",
                        "origin",
                        "destination",
                        "price",
                        "railcard",
                        "restrictionCode",
                        "route",
                        "statusCode",
                        "xLondon",
                        "isPlusBus",
                        "discount",
                        "childStatusDescription",
                        "adultStatusDescription"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "ticketType": "/ticket-type/VDS",
        "origin": "/station/1072",
        "destination": "/station/2961",
        "price": 2700,
        "originalPrice": 5400,
        "railcard": "/railcard/2TR",
        "restrictionCode": "VR",
        "route": "/route/00452",
        "statusCode": "052",
        "fareSetter": null,
        "xLondon": 1,
        "isPlusBus": false,
        "discount": {
            "type": "/discount/123",
            "lennonCode": "0301",
            "promoCode": "test",
            "percent": 50,
            "shortDescription": "Some description of the discount made up by a marketing genius"
        },
        "childStatusDescription": "CHILD",
        "adultStatusDescription": null
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "error",
    "message": "Fare with id 99999 not found."
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /journey/{id}

A complete passenger journey from an origin to a destination. It will involve journeys on one or more legs.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "legs": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/leg/[0-9]+$"
                            }
                        },
                        "distance": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "co2": {
                            "type": [
                                "object",
                                "null"
                            ],
                            "required": [
                                "train"
                            ],
                            "properties": {
                                "train": {
                                    "type": "number"
                                }
                            },
                            "additionalProperties": true
                        }
                    },
                    "required": [
                        "legs",
                        "distance",
                        "co2"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "legs": [
            "/leg/123",
            "/leg/456"
        ]
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Journey with id 9223372036854775807 not found."
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /leg/{id}

A particular segment of an overall journey constrained to one service of method of travel. There are two types of legs; timetable legs that have a departure and arrival time and fixed legs that only have a duration (walk, tube, etc). Given a journey from Tunbridge Wells to Diss there may be a timetable leg from Tunbridge Wells to London Bridge (on a Hastings to Charing Cross service), a fixed leg walk to London Liverpool Street and then a final timetable leg from London Liverpool Street to Diss (on the London Liverpool Street to Norwich service).

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "enum": [
                                "timetabled",
                                "fixed"
                            ]
                        },
                        "origin": {
                            "type": "string",
                            "pattern": "^/station/[A-Z0-9]+$"
                        },
                        "destination": {
                            "type": "string",
                            "pattern": "^/station/[A-Z0-9]+$"
                        },
                        "mode": {
                            "enum": [
                                "train",
                                "bus",
                                "walk"
                            ]
                        },
                        "service": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/service/[0-9A-Z_]+/\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "operator": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/toc/[A-Z]{2}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "scheduledDeparture": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "scheduledArrival": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "boardingTime": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "alightingTime": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "duration": {
                            "type": "number"
                        },
                        "availableFrom": {
                            "type": "string",
                            "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "availableTo": {
                            "type": "string",
                            "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "callingPoints": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "crs": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{3}$"
                                    },
                                    "arrival": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "departure": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "platform": {
                                        "type": "string",
                                        "description": "The platform number or letter"
                                    },
                                    "pickup": {
                                        "type": "boolean",
                                        "description": "Does the train stop here for passengers to board"
                                    },
                                    "dropoff": {
                                        "type": "boolean",
                                        "description": "Does the train stop here for passengers to alight"
                                    }
                                },
                                "required": [
                                    "crs",
                                    "arrival",
                                    "departure",
                                    "platform",
                                    "pickup",
                                    "dropoff"
                                ]
                            }
                        }
                    },
                    "required": [
                        "type",
                        "origin",
                        "destination",
                        "operator",
                        "mode"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "timetabled",
        "origin": "/station/1027",
        "destination": "/station/5187",
        "mode": "train",
        "service": "/service/A12345/2015-12-07",
        "scheduledDeparture": "2015-12-07T11:59:59+00:00",
        "scheduledArrival": "2015-12-07T11:59:59+00:00",
        "alightingTime": "2015-12-07T12:03:00+00:00",
        "operator": "/toc/AB",
        "callingPoints": [
            {
                "crs": "KID",
                "arrival": "2023-11-27T11:54:00+00:00",
                "departure": "2023-11-27T11:54:00+00:00",
                "platform": "1",
                "pickup": true,
                "dropoff": false
            },
            {
                "crs": "BKD",
                "arrival": "2023-11-27T11:58:00+00:00",
                "departure": "2023-11-27T11:58:00+00:00",
                "platform": null,
                "pickup": true,
                "dropoff": true
            }
        ]
    },
    "links": []
}
201 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "enum": [
                                "timetabled",
                                "fixed"
                            ]
                        },
                        "origin": {
                            "type": "string",
                            "pattern": "^/station/[A-Z0-9]+$"
                        },
                        "destination": {
                            "type": "string",
                            "pattern": "^/station/[A-Z0-9]+$"
                        },
                        "mode": {
                            "enum": [
                                "train",
                                "bus",
                                "walk"
                            ]
                        },
                        "service": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/service/[0-9A-Z_]+/\\d{4}-\\d{2}-\\d{2}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "operator": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/toc/[A-Z]{2}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "scheduledDeparture": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "scheduledArrival": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "boardingTime": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "alightingTime": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "duration": {
                            "type": "number"
                        },
                        "availableFrom": {
                            "type": "string",
                            "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "availableTo": {
                            "type": "string",
                            "pattern": "^\\d{2}:\\d{2}$"
                        },
                        "callingPoints": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "crs": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{3}$"
                                    },
                                    "arrival": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "departure": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "platform": {
                                        "type": "string",
                                        "description": "The platform number or letter"
                                    },
                                    "pickup": {
                                        "type": "boolean",
                                        "description": "Does the train stop here for passengers to board"
                                    },
                                    "dropoff": {
                                        "type": "boolean",
                                        "description": "Does the train stop here for passengers to alight"
                                    }
                                },
                                "required": [
                                    "crs",
                                    "arrival",
                                    "departure",
                                    "platform",
                                    "pickup",
                                    "dropoff"
                                ]
                            }
                        }
                    },
                    "required": [
                        "type",
                        "origin",
                        "destination",
                        "operator",
                        "mode"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "fixed",
        "origin": "/station/5187",
        "destination": "/station/5100",
        "mode": "walk",
        "operator": "/toc/AB",
        "duration": 15,
        "availableFrom": "05:30",
        "availableTo": "22:45"
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Leg with id 20234234234234324 not found."
}
URI parameters

string tuid (required)

Pattern: ^[0-9A-Z_]+$

string date (required)

Pattern: ^[0-9\-]+$

GET /service/{tuid}/{date}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "type": {
                            "type": "string",
                            "pattern": "^fixed|timetable$"
                        },
                        "mode": {
                            "type": "string",
                            "pattern": "^train$"
                        },
                        "retailServiceId": {
                            "type": "string",
                            "pattern": "^[0-9A-Z]+$"
                        },
                        "trainUid": {
                            "type": "string",
                            "pattern": "^[0-9A-Z_]+$"
                        },
                        "iptisTripIdentifier": {
                            "type": "string"
                        },
                        "facilities": {
                            "type": "object",
                            "properties": {
                                "firstClass": {
                                    "type": "boolean"
                                },
                                "firstClassMeal": {
                                    "type": "boolean"
                                },
                                "firstClassRestaurant": {
                                    "type": "boolean"
                                },
                                "hotFood": {
                                    "type": "boolean"
                                },
                                "buffet": {
                                    "type": "boolean"
                                },
                                "restaurant": {
                                    "type": "boolean"
                                },
                                "trolley": {
                                    "type": "boolean"
                                },
                                "wheelchair": {
                                    "type": "boolean"
                                }
                            },
                            "additionalProperties": true
                        },
                        "isTemporaryTrain": {
                            "type": "boolean"
                        },
                        "isCountedPlace": {
                            "type": "boolean"
                        },
                        "callingPoints": {
                            "type": "string",
                            "pattern": "^/service/[0-9A-Z_]+/\\d{4}-\\d{2}-\\d{2}/calling-points$"
                        },
                        "transferAdvice": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        },
                        "reservable": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    },
                    "required": [
                        "type",
                        "mode",
                        "retailServiceId",
                        "trainUid",
                        "callingPoints"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "fixed",
        "mode": "train",
        "retailServiceId": "AB12345",
        "trainUid": "A1234",
        "callingPoints": "/service/A12345/2017-02-09/calling-points",
        "reservable": [
            "Recommended"
        ]
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string tuid (required)

Pattern: ^[0-9A-Z_]+$

string date (required)

Pattern: ^[0-9\-]+$

GET /service/{tuid}/{date}/calling-points

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "location": {
                                "type": "object",
                                "properties": {
                                    "crs": {
                                        "type": "string",
                                        "pattern": "^[A-Z]{3}$"
                                    },
                                    "nlc": {
                                        "type": "string",
                                        "pattern": "^[0-9]{4}$"
                                    }
                                }
                            },
                            "order": {
                                "type": "integer"
                            },
                            "arriveTime": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "departTime": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "platform": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        {
            "location": {
                "crs": "EDB",
                "nlc": "9328"
            },
            "order": 1,
            "arriveTime": "6:40",
            "departTime": "4:40",
            "platform": "11"
        },
        {
            "location": {
                "crs": "INK",
                "nlc": "9136"
            },
            "order": 2,
            "arriveTime": "4:58",
            "departTime": "3:58",
            "platform": "2"
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /passenger/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "title": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "initials": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "surname": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "photocardNumber": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    },
                    "additionalProperties": false,
                    "required": [
                        "title",
                        "initials",
                        "surname",
                        "photocardNumber"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "title": "Mr",
        "initials": "F",
        "surname": "Bar",
        "photocardNumber": "12345678"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Passenger with id 20234234234234324 not found."
}
URI parameters

string id (required)

Pattern: ^.+$

GET /reservation/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "created": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                },
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                }
                            ]
                        },
                        "seats": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/seat-reservation/[0-9]+$"
                            }
                        }
                    },
                    "required": [
                        "created",
                        "seats"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "created": "2015-03-31T13:50:58+01:00",
        "seats": [
            "/seat-reservation/1234",
            "/seat-reservation/4567"
        ]
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /seat-reservation/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "coach": {
                            "type": "string",
                            "pattern": "^[A-Z]$"
                        },
                        "seat": {
                            "type": "string",
                            "pattern": "^[0-9]{1,3}[A-Z]$"
                        },
                        "leg": {
                            "type": "string",
                            "pattern": "^/leg/[0-9]+$"
                        },
                        "supplement": {
                            "type": "string",
                            "pattern": "^/supplement/[0-9]+$"
                        },
                        "reservation": {
                            "type": "string",
                            "pattern": "^/reservation/[A-Z0-9]+$"
                        },
                        "display": {
                            "type": "object",
                            "properties": {
                                "coach": {
                                    "type": "string",
                                    "pattern": "^[A-Z]$"
                                },
                                "seat": {
                                    "type": "string",
                                    "pattern": "^[0-9]{1,3}[A-Z]$"
                                }
                            }
                        }
                    },
                    "required": [
                        "coach",
                        "seat",
                        "leg",
                        "supplement",
                        "reservation",
                        "display"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "coach": "A",
        "seat": "12F",
        "display": {
            "coach": "A",
            "seat": "12"
        },
        "leg": "/leg/123",
        "supplement": "/supplement/123456",
        "reservation": "/reservation/ZY1233DB"
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Passenger with id 20234234234234324 not found."
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /supplement/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string",
                            "pattern": "^/supplement-type/[A-Z0-9]+$"
                        },
                        "transactionNumber": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "price": {
                            "type": "number"
                        },
                        "isBerth": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "type",
                        "transactionNumber",
                        "price",
                        "isBerth"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "/supplement-type/XFS",
        "transactionNumber": null,
        "price": 0,
        "isBerth": false
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Supplement with id 1123213213 not found."
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /sundry/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "type": {
                            "type": "string",
                            "pattern": "^/sundry-type/[0-9]{5}$"
                        },
                        "price": {
                            "type": "integer"
                        }
                    },
                    "required": [
                        "type",
                        "price"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "/sundry-type/09015",
        "price": 100
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Sundry with id 1123213213 not found."
}

GET /search-coj

Search for change of journey for original tickets. Query parameters require only originalTickets, but it can be extended with any odyssey query parameter to change date & time of travel, adults, children and railcards. It returns augmented odyssey response. It additionally has "priceCoveredByOriginalTickets" property on fareOption, "priceCoveredByOriginalFare" property on fare, "originalTicket" on fareOption's fare and "sameAsOriginalJourney" on journey.

200 application/json
Response schema (show)
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "pagination",
        "response"
    ],
    "properties": {
        "pagination": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "outward": {
                    "$ref": "./PaginationResult.jschema"
                },
                "inward": {
                    "$ref": "./PaginationResult.jschema"
                }
            }
        },
        "response": {
            "type": "object",
            "additionalProperties": false,
            "required": [
                "outward",
                "inward",
                "fares",
                "availability"
            ],
            "properties": {
                "outward": {
                    "type": "array",
                    "items": {
                        "$ref": "Types.jschema#/journeyUri"
                    }
                },
                "inward": {
                    "type": "array",
                    "items": {
                        "$ref": "Types.jschema#/journeyUri"
                    }
                },
                "fares": {
                    "type": "object",
                    "description": "array associate journeys with fares."
                },
                "addons": {
                    "type": "object",
                    "required": [
                        "outward"
                    ],
                    "properties": {
                        "outward": {
                            "type": "object"
                        },
                        "inward": {
                            "type": "object"
                        }
                    }
                },
                "availability": {
                    "type": "object",
                    "description": "availabilities associated with journeys and ticket types"
                }
            }
        },
        "messages": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "tag",
                    "level",
                    "title"
                ],
                "properties": {
                    "tag": {
                        "type": "string"
                    },
                    "level": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    }
                }
            },
            "additionalProperties": false,
            "properties": {
                "outward": {
                    "$ref": "./PaginationResult.jschema"
                },
                "inward": {
                    "$ref": "./PaginationResult.jschema"
                }
            }
        },
        "links": {
            "type": "object",
            "additionalProperties": false,
            "patternProperties": {
                "^/odyssey/fare/.+$": {
                    "$ref": "Fare.jschema"
                },
                "^/odyssey/fare-option/.+$": {
                    "$ref": "FareOption.jschema"
                },
                "^/odyssey/journey/.+$": {
                    "$ref": "Journey.jschema"
                },
                "^/odyssey/leg/.+$": {
                    "$ref": "Leg.jschema"
                }
            }
        }
    }
}
Response example (show)
{
    "response": {
        "outward": [
            "/odyssey/journey/270:270:MCV_HBD_G37312",
            "/odyssey/journey/270:270:MCV_HBD_G30188",
            "/odyssey/journey/270:270:MCV_HBD_G30155",
            "/odyssey/journey/270:270:MCV_HBD_G37319",
            "/odyssey/journey/270:270:MCV_HBD_G31967"
        ],
        "inward": [],
        "fares": {
            "/odyssey/journey/270:270:MCV_HBD_G37312": {
                "outward": [
                    "/odyssey/fare-option/270:/fare/2970-8524-00429-DG0-000-1-NT---268-1-0--370-1-0"
                ],
                "inward": [],
                "return": []
            },
            "/odyssey/journey/270:270:MCV_HBD_G30188": {
                "outward": [
                    "/odyssey/fare-option/270:/fare/2970-8524-00429-DG3-000-1-NT---268-1-0--440-1-0"
                ],
                "inward": [],
                "return": []
            },
            "/odyssey/journey/270:270:MCV_HBD_G30155": {
                "outward": [
                    "/odyssey/fare-option/270:/fare/2970-8524-00429-DG6-000-1-NT---268-1-0--520-1-0"
                ],
                "inward": [],
                "return": []
            },
            "/odyssey/journey/270:270:MCV_HBD_G37319": {
                "outward": [
                    "/odyssey/fare-option/270:/fare/2970-8524-00429-DG6-000-1-NT---268-1-0--520-1-0"
                ],
                "inward": [],
                "return": []
            },
            "/odyssey/journey/270:270:MCV_HBD_G31967": {
                "outward": [
                    "/odyssey/fare-option/270:/fare/2970-8524-00429-DG0-000-1-NT---268-1-0--370-1-0"
                ],
                "inward": [],
                "return": []
            }
        },
        "addons": {
            "outward": {
                "origin": [],
                "destination": []
            }
        },
        "availability": {
            "/odyssey/journey/270:270:MCV_HBD_G37312": {
                "/ticket-type/DG0": {
                    "/route/00429": 8
                }
            },
            "/odyssey/journey/270:270:MCV_HBD_G30188": {
                "/ticket-type/DG3": {
                    "/route/00429": 8
                }
            },
            "/odyssey/journey/270:270:MCV_HBD_G30155": {
                "/ticket-type/DG6": {
                    "/route/00429": 8
                }
            },
            "/odyssey/journey/270:270:MCV_HBD_G37319": {
                "/ticket-type/DG6": {
                    "/route/00429": 8
                }
            },
            "/odyssey/journey/270:270:MCV_HBD_G31967": {
                "/ticket-type/DG0": {
                    "/route/00429": 8
                }
            }
        }
    },
    "pagination": {
        "outward": {
            "current": "origin=2970&destination=8524&outwardDate=2024-09-26&outwardDepartAt=13%3A33&adults=1&children=0&limit=5&returns=false&ticketCategory=advance&originalTickets=140099",
            "earlier": "origin=2970&destination=8524&outwardDate=2024-09-26&outwardDepartBy=13%3A36&adults=1&children=0&limit=5&returns=false&ticketCategory=advance&originalTickets=140099",
            "later": "origin=2970&destination=8524&outwardDate=2024-09-26&outwardDepartAt=14%3A54&adults=1&children=0&limit=5&returns=false&ticketCategory=advance&originalTickets=140099"
        }
    },
    "links": {
        "/odyssey/fare/2970-8524-00429-DG0-000-1-NT---268-1-0--370": {
            "origin": "/station/2970",
            "destination": "/station/8524",
            "route": "/route/00429",
            "price": 370,
            "originalPrice": 370,
            "ticketType": "/ticket-type/DG0",
            "restrictionCode": "NT",
            "fareSetter": "NTH",
            "railcard": null,
            "statusCode": "000",
            "xLondon": 0,
            "permittedDestinationStations": "/station/8524/permitted-stations/2970/00429",
            "permittedOriginStations": "/station/2970/permitted-stations/8524/00429",
            "discount": null,
            "groups": [
                "2970-8524-00429-DG0"
            ],
            "priceCoveredByOriginalTickets": 370
        },
        "/odyssey/fare-option/270:/fare/2970-8524-00429-DG0-000-1-NT---268-1-0--370-1-0": {
            "totalPrice": 370,
            "labels": [
                "advance"
            ],
            "hasETicket": "/has-e-ticket/2970-8524-2970-8524-00429-DG0",
            "supplements": [],
            "fares": [
                {
                    "adults": 1,
                    "children": 0,
                    "fare": "/odyssey/fare/2970-8524-00429-DG0-000-1-NT---268-1-0--370",
                    "originalTicket": "/ticket/140099"
                }
            ],
            "validUntil": "2024-09-27T23:59:59",
            "priceCoveredByOriginalTickets": 370
        },
        "/odyssey/fare/2970-8524-00429-DG3-000-1-NT---268-1-0--440": {
            "origin": "/station/2970",
            "destination": "/station/8524",
            "route": "/route/00429",
            "price": 440,
            "originalPrice": 440,
            "ticketType": "/ticket-type/DG3",
            "restrictionCode": "NT",
            "fareSetter": "NTH",
            "railcard": null,
            "statusCode": "000",
            "xLondon": 0,
            "permittedDestinationStations": "/station/8524/permitted-stations/2970/00429",
            "permittedOriginStations": "/station/2970/permitted-stations/8524/00429",
            "discount": null,
            "groups": [
                "2970-8524-00429-DG3"
            ],
            "priceCoveredByOriginalTickets": 440
        },
        "/odyssey/fare-option/270:/fare/2970-8524-00429-DG3-000-1-NT---268-1-0--440-1-0": {
            "totalPrice": 440,
            "labels": [
                "advance"
            ],
            "hasETicket": "/has-e-ticket/2970-8524-2970-8524-00429-DG3",
            "supplements": [],
            "fares": [
                {
                    "adults": 1,
                    "children": 0,
                    "fare": "/odyssey/fare/2970-8524-00429-DG3-000-1-NT---268-1-0--440",
                    "originalTicket": "/ticket/140099"
                }
            ],
            "validUntil": "2024-09-27T23:59:59",
            "priceCoveredByOriginalTickets": 440
        },
        "/odyssey/fare/2970-8524-00429-DG6-000-1-NT---268-1-0--520": {
            "origin": "/station/2970",
            "destination": "/station/8524",
            "route": "/route/00429",
            "price": 520,
            "originalPrice": 520,
            "ticketType": "/ticket-type/DG6",
            "restrictionCode": "NT",
            "fareSetter": "NTH",
            "railcard": null,
            "statusCode": "000",
            "xLondon": 0,
            "permittedDestinationStations": "/station/8524/permitted-stations/2970/00429",
            "permittedOriginStations": "/station/2970/permitted-stations/8524/00429",
            "discount": null,
            "groups": [
                "2970-8524-00429-DG6"
            ],
            "priceCoveredByOriginalTickets": 520
        },
        "/odyssey/fare-option/270:/fare/2970-8524-00429-DG6-000-1-NT---268-1-0--520-1-0": {
            "totalPrice": 520,
            "labels": [
                "advance"
            ],
            "hasETicket": "/has-e-ticket/2970-8524-2970-8524-00429-DG6",
            "supplements": [],
            "fares": [
                {
                    "adults": 1,
                    "children": 0,
                    "fare": "/odyssey/fare/2970-8524-00429-DG6-000-1-NT---268-1-0--520",
                    "originalTicket": "/ticket/140099"
                }
            ],
            "validUntil": "2024-09-27T23:59:59",
            "priceCoveredByOriginalTickets": 520
        },
        "/odyssey/leg/270:MCV_HBD_G37312": {
            "type": "timetabled",
            "source": "dtd",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "mode": "train",
            "operator": "/toc/NT",
            "service": {
                "trainUid": "G37312",
                "retailServiceId": "NT414700",
                "reservationFlag": "S",
                "reservable": [
                    "Possible"
                ],
                "origin": "/station/WGW",
                "destination": "/station/LDS",
                "date": "2024-09-26",
                "scheduledDeparture": "2024-09-26T12:49:00"
            },
            "departure": "2024-09-26T13:36:00",
            "arrival": "2024-09-26T14:15:00",
            "scheduledDeparture": "2024-09-26T13:36:00",
            "scheduledArrival": "2024-09-26T14:15:00",
            "disruptions": "/disruption/2024-09-26T13:36:00/NT_MCV_HBD_G37312",
            "callingPoints": [
                {
                    "station": "/station/MCV",
                    "departure": "2024-09-26T13:36:00",
                    "arrival": "2024-09-26T13:33:00",
                    "scheduledDeparture": "2024-09-26T13:36:00",
                    "scheduledArrival": "2024-09-26T13:33:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "6",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/RCD",
                    "departure": "2024-09-26T13:51:00",
                    "arrival": "2024-09-26T13:51:00",
                    "scheduledDeparture": "2024-09-26T13:51:00",
                    "scheduledArrival": "2024-09-26T13:51:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/SMB",
                    "departure": "2024-09-26T13:55:00",
                    "arrival": "2024-09-26T13:55:00",
                    "scheduledDeparture": "2024-09-26T13:55:00",
                    "scheduledArrival": "2024-09-26T13:55:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/LTL",
                    "departure": "2024-09-26T13:59:00",
                    "arrival": "2024-09-26T13:58:00",
                    "scheduledDeparture": "2024-09-26T13:59:00",
                    "scheduledArrival": "2024-09-26T13:58:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/WDN",
                    "departure": "2024-09-26T14:05:00",
                    "arrival": "2024-09-26T14:05:00",
                    "scheduledDeparture": "2024-09-26T14:05:00",
                    "scheduledArrival": "2024-09-26T14:05:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/TOD",
                    "departure": "2024-09-26T14:08:00",
                    "arrival": "2024-09-26T14:08:00",
                    "scheduledDeparture": "2024-09-26T14:08:00",
                    "scheduledArrival": "2024-09-26T14:08:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/HBD",
                    "departure": "2024-09-26T14:15:00",
                    "arrival": "2024-09-26T14:15:00",
                    "scheduledDeparture": "2024-09-26T14:15:00",
                    "scheduledArrival": "2024-09-26T14:15:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                }
            ],
            "isDelayed": false
        },
        "/odyssey/journey/270:270:MCV_HBD_G37312": {
            "id": "/odyssey/journey/270:270:MCV_HBD_G37312",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "departure": "2024-09-26T13:36:00",
            "arrival": "2024-09-26T14:15:00",
            "scheduledDeparture": "2024-09-26T13:36:00",
            "scheduledArrival": "2024-09-26T14:15:00",
            "legs": [
                "/odyssey/leg/270:MCV_HBD_G37312"
            ],
            "disruptions": "/disruption/2024-09-26T13:36:00/NT_MCV_HBD_G37312",
            "isReservationCompulsory": false,
            "isReservationPossible": true,
            "isOvertaken": false,
            "overtakingJourneysCount": 0,
            "status": "ready",
            "boardingTime": null,
            "alightingTime": null,
            "distance": 23,
            "sameAsOriginalJourney": false
        },
        "/odyssey/leg/270:MCV_HBD_G30188": {
            "type": "timetabled",
            "source": "dtd",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "mode": "train",
            "operator": "/toc/NT",
            "service": {
                "trainUid": "G30188",
                "retailServiceId": "NT414900",
                "reservationFlag": "S",
                "reservable": [
                    "Possible"
                ],
                "origin": "/station/MCV",
                "destination": "/station/LDS",
                "date": "2024-09-26",
                "scheduledDeparture": "2024-09-26T13:57:00"
            },
            "departure": "2024-09-26T13:57:00",
            "arrival": "2024-09-26T14:25:00",
            "scheduledDeparture": "2024-09-26T13:57:00",
            "scheduledArrival": "2024-09-26T14:25:00",
            "disruptions": "/disruption/2024-09-26T13:57:00/NT_MCV_HBD_G30188",
            "callingPoints": [
                {
                    "station": "/station/MCV",
                    "departure": "2024-09-26T13:57:00",
                    "arrival": "2024-09-26T13:57:00",
                    "scheduledDeparture": "2024-09-26T13:57:00",
                    "scheduledArrival": "2024-09-26T13:57:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": false,
                    "activities": [
                        "PickUpOnly"
                    ]
                },
                {
                    "station": "/station/RCD",
                    "departure": "2024-09-26T14:10:00",
                    "arrival": "2024-09-26T14:09:00",
                    "scheduledDeparture": "2024-09-26T14:10:00",
                    "scheduledArrival": "2024-09-26T14:09:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/TOD",
                    "departure": "2024-09-26T14:19:00",
                    "arrival": "2024-09-26T14:19:00",
                    "scheduledDeparture": "2024-09-26T14:19:00",
                    "scheduledArrival": "2024-09-26T14:19:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/HBD",
                    "departure": "2024-09-26T14:26:00",
                    "arrival": "2024-09-26T14:25:00",
                    "scheduledDeparture": "2024-09-26T14:26:00",
                    "scheduledArrival": "2024-09-26T14:25:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                }
            ],
            "isDelayed": false
        },
        "/odyssey/journey/270:270:MCV_HBD_G30188": {
            "id": "/odyssey/journey/270:270:MCV_HBD_G30188",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "departure": "2024-09-26T13:57:00",
            "arrival": "2024-09-26T14:25:00",
            "scheduledDeparture": "2024-09-26T13:57:00",
            "scheduledArrival": "2024-09-26T14:25:00",
            "legs": [
                "/odyssey/leg/270:MCV_HBD_G30188"
            ],
            "disruptions": "/disruption/2024-09-26T13:57:00/NT_MCV_HBD_G30188",
            "isReservationCompulsory": false,
            "isReservationPossible": true,
            "isOvertaken": false,
            "overtakingJourneysCount": 0,
            "status": "ready",
            "boardingTime": null,
            "alightingTime": null,
            "distance": 23,
            "sameAsOriginalJourney": false
        },
        "/odyssey/leg/270:MCV_HBD_G30155": {
            "type": "timetabled",
            "source": "dtd",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "mode": "train",
            "operator": "/toc/NT",
            "service": {
                "trainUid": "G30155",
                "retailServiceId": "NT415100",
                "reservationFlag": "S",
                "reservable": [
                    "Possible"
                ],
                "origin": "/station/CTR",
                "destination": "/station/LDS",
                "date": "2024-09-26",
                "scheduledDeparture": "2024-09-26T13:28:00"
            },
            "departure": "2024-09-26T14:21:00",
            "arrival": "2024-09-26T14:49:00",
            "scheduledDeparture": "2024-09-26T14:21:00",
            "scheduledArrival": "2024-09-26T14:49:00",
            "disruptions": "/disruption/2024-09-26T14:21:00/NT_MCV_HBD_G30155",
            "callingPoints": [
                {
                    "station": "/station/MCV",
                    "departure": "2024-09-26T14:21:00",
                    "arrival": "2024-09-26T14:18:00",
                    "scheduledDeparture": "2024-09-26T14:21:00",
                    "scheduledArrival": "2024-09-26T14:18:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "4",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/RCD",
                    "departure": "2024-09-26T14:34:00",
                    "arrival": "2024-09-26T14:33:00",
                    "scheduledDeparture": "2024-09-26T14:34:00",
                    "scheduledArrival": "2024-09-26T14:33:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/TOD",
                    "departure": "2024-09-26T14:43:00",
                    "arrival": "2024-09-26T14:43:00",
                    "scheduledDeparture": "2024-09-26T14:43:00",
                    "scheduledArrival": "2024-09-26T14:43:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/HBD",
                    "departure": "2024-09-26T14:50:00",
                    "arrival": "2024-09-26T14:49:00",
                    "scheduledDeparture": "2024-09-26T14:50:00",
                    "scheduledArrival": "2024-09-26T14:49:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                }
            ],
            "isDelayed": false
        },
        "/odyssey/journey/270:270:MCV_HBD_G30155": {
            "id": "/odyssey/journey/270:270:MCV_HBD_G30155",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "departure": "2024-09-26T14:21:00",
            "arrival": "2024-09-26T14:49:00",
            "scheduledDeparture": "2024-09-26T14:21:00",
            "scheduledArrival": "2024-09-26T14:49:00",
            "legs": [
                "/odyssey/leg/270:MCV_HBD_G30155"
            ],
            "disruptions": "/disruption/2024-09-26T14:21:00/NT_MCV_HBD_G30155",
            "isReservationCompulsory": false,
            "isReservationPossible": true,
            "isOvertaken": false,
            "overtakingJourneysCount": 0,
            "status": "ready",
            "boardingTime": null,
            "alightingTime": null,
            "distance": 23,
            "sameAsOriginalJourney": false
        },
        "/odyssey/leg/270:MCV_HBD_G37319": {
            "type": "timetabled",
            "source": "dtd",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "mode": "train",
            "operator": "/toc/NT",
            "service": {
                "trainUid": "G37319",
                "retailServiceId": "NT415300",
                "reservationFlag": "S",
                "reservable": [
                    "Possible"
                ],
                "origin": "/station/WGW",
                "destination": "/station/LDS",
                "date": "2024-09-26",
                "scheduledDeparture": "2024-09-26T13:49:00"
            },
            "departure": "2024-09-26T14:36:00",
            "arrival": "2024-09-26T15:15:00",
            "scheduledDeparture": "2024-09-26T14:36:00",
            "scheduledArrival": "2024-09-26T15:15:00",
            "disruptions": "/disruption/2024-09-26T14:36:00/NT_MCV_HBD_G37319",
            "callingPoints": [
                {
                    "station": "/station/MCV",
                    "departure": "2024-09-26T14:36:00",
                    "arrival": "2024-09-26T14:33:00",
                    "scheduledDeparture": "2024-09-26T14:36:00",
                    "scheduledArrival": "2024-09-26T14:33:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "6",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/RCD",
                    "departure": "2024-09-26T14:51:00",
                    "arrival": "2024-09-26T14:50:00",
                    "scheduledDeparture": "2024-09-26T14:51:00",
                    "scheduledArrival": "2024-09-26T14:50:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/SMB",
                    "departure": "2024-09-26T14:55:00",
                    "arrival": "2024-09-26T14:55:00",
                    "scheduledDeparture": "2024-09-26T14:55:00",
                    "scheduledArrival": "2024-09-26T14:55:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/LTL",
                    "departure": "2024-09-26T14:59:00",
                    "arrival": "2024-09-26T14:58:00",
                    "scheduledDeparture": "2024-09-26T14:59:00",
                    "scheduledArrival": "2024-09-26T14:58:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/WDN",
                    "departure": "2024-09-26T15:05:00",
                    "arrival": "2024-09-26T15:05:00",
                    "scheduledDeparture": "2024-09-26T15:05:00",
                    "scheduledArrival": "2024-09-26T15:05:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/TOD",
                    "departure": "2024-09-26T15:08:00",
                    "arrival": "2024-09-26T15:08:00",
                    "scheduledDeparture": "2024-09-26T15:08:00",
                    "scheduledArrival": "2024-09-26T15:08:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/HBD",
                    "departure": "2024-09-26T15:15:00",
                    "arrival": "2024-09-26T15:15:00",
                    "scheduledDeparture": "2024-09-26T15:15:00",
                    "scheduledArrival": "2024-09-26T15:15:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                }
            ],
            "isDelayed": false
        },
        "/odyssey/journey/270:270:MCV_HBD_G37319": {
            "id": "/odyssey/journey/270:270:MCV_HBD_G37319",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "departure": "2024-09-26T14:36:00",
            "arrival": "2024-09-26T15:15:00",
            "scheduledDeparture": "2024-09-26T14:36:00",
            "scheduledArrival": "2024-09-26T15:15:00",
            "legs": [
                "/odyssey/leg/270:MCV_HBD_G37319"
            ],
            "disruptions": "/disruption/2024-09-26T14:36:00/NT_MCV_HBD_G37319",
            "isReservationCompulsory": false,
            "isReservationPossible": true,
            "isOvertaken": false,
            "overtakingJourneysCount": 0,
            "status": "ready",
            "boardingTime": null,
            "alightingTime": null,
            "distance": 23,
            "sameAsOriginalJourney": true
        },
        "/odyssey/leg/270:MCV_HBD_G31967": {
            "type": "timetabled",
            "source": "dtd",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "mode": "train",
            "operator": "/toc/NT",
            "service": {
                "trainUid": "G31967",
                "retailServiceId": "NT415500",
                "reservationFlag": "S",
                "reservable": [
                    "Possible"
                ],
                "origin": "/station/MCV",
                "destination": "/station/LDS",
                "date": "2024-09-26",
                "scheduledDeparture": "2024-09-26T14:54:00"
            },
            "departure": "2024-09-26T14:54:00",
            "arrival": "2024-09-26T15:25:00",
            "scheduledDeparture": "2024-09-26T14:54:00",
            "scheduledArrival": "2024-09-26T15:25:00",
            "disruptions": "/disruption/2024-09-26T14:54:00/NT_MCV_HBD_G31967",
            "callingPoints": [
                {
                    "station": "/station/MCV",
                    "departure": "2024-09-26T14:54:00",
                    "arrival": "2024-09-26T14:54:00",
                    "scheduledDeparture": "2024-09-26T14:54:00",
                    "scheduledArrival": "2024-09-26T14:54:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": false,
                    "activities": [
                        "PickUpOnly"
                    ]
                },
                {
                    "station": "/station/RCD",
                    "departure": "2024-09-26T15:09:00",
                    "arrival": "2024-09-26T15:06:00",
                    "scheduledDeparture": "2024-09-26T15:09:00",
                    "scheduledArrival": "2024-09-26T15:06:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/TOD",
                    "departure": "2024-09-26T15:19:00",
                    "arrival": "2024-09-26T15:18:00",
                    "scheduledDeparture": "2024-09-26T15:19:00",
                    "scheduledArrival": "2024-09-26T15:18:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                },
                {
                    "station": "/station/HBD",
                    "departure": "2024-09-26T15:26:00",
                    "arrival": "2024-09-26T15:25:00",
                    "scheduledDeparture": "2024-09-26T15:26:00",
                    "scheduledArrival": "2024-09-26T15:25:00",
                    "cancelled": false,
                    "delayed": false,
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true,
                    "activities": [
                        "Normal"
                    ]
                }
            ],
            "isDelayed": false
        },
        "/odyssey/journey/270:270:MCV_HBD_G31967": {
            "id": "/odyssey/journey/270:270:MCV_HBD_G31967",
            "origin": "/station/MCV",
            "destination": "/station/HBD",
            "departure": "2024-09-26T14:54:00",
            "arrival": "2024-09-26T15:25:00",
            "scheduledDeparture": "2024-09-26T14:54:00",
            "scheduledArrival": "2024-09-26T15:25:00",
            "legs": [
                "/odyssey/leg/270:MCV_HBD_G31967"
            ],
            "disruptions": "/disruption/2024-09-26T14:54:00/NT_MCV_HBD_G31967",
            "isReservationCompulsory": false,
            "isReservationPossible": true,
            "isOvertaken": false,
            "overtakingJourneysCount": 0,
            "status": "ready",
            "boardingTime": null,
            "alightingTime": null,
            "distance": 23,
            "sameAsOriginalJourney": false
        },
        "/station/CTR": {
            "name": {
                "station": "CHESTER",
                "location": "CHESTER",
                "display": "Chester",
                "print": "Chester"
            },
            "code": {
                "nlc": "2412",
                "uic": "7024120",
                "crs": "CTR",
                "tiploc": "CHST",
                "atco": "9100CHST"
            },
            "latitude": 53.196695,
            "longitude": -2.879594,
            "facilities": [
                "BO",
                "TVM",
                "G",
                "L",
                "LI",
                "LI",
                "LI"
            ],
            "groups": "/station/2412/groups",
            "members": [],
            "londonTerminals": "/station/2412/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "2412"
        },
        "/station/TOD": {
            "name": {
                "station": "TODMORDEN",
                "location": "TODMORDEN",
                "display": "Todmorden",
                "print": "Todmorden"
            },
            "code": {
                "nlc": "2677",
                "uic": "7026770",
                "crs": "TOD",
                "tiploc": "TODMRDN",
                "atco": "9100TODMRDN"
            },
            "latitude": 53.713818,
            "longitude": -2.099659,
            "facilities": [
                "TVM",
                "V",
                "L",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": [],
            "members": [],
            "londonTerminals": "/station/2677/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "2677"
        },
        "/station/WDN": {
            "name": {
                "station": "WALSDEN",
                "location": "WALSDEN",
                "display": "Walsden",
                "print": "Walsden"
            },
            "code": {
                "nlc": "2665",
                "uic": "7026650",
                "crs": "WDN",
                "tiploc": "WDEN",
                "atco": "9100WDEN"
            },
            "latitude": 53.69626,
            "longitude": -2.104464,
            "facilities": [
                "TVM",
                "L",
                "LI",
                "LI",
                "LI"
            ],
            "groups": [],
            "members": [],
            "londonTerminals": "/station/2665/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009000S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "2665"
        },
        "/station/LTL": {
            "name": {
                "station": "LITTLEBOROUGH",
                "location": "LITTLEBOROUGH",
                "display": "Littleborough",
                "print": "Littleborough"
            },
            "code": {
                "nlc": "2661",
                "uic": "7026610",
                "crs": "LTL",
                "tiploc": "LITLBRO",
                "atco": "9100LITLBRO"
            },
            "latitude": 53.642995,
            "longitude": -2.094651,
            "facilities": [
                "TVM",
                "V",
                "L",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": [],
            "members": [],
            "londonTerminals": "/station/2661/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "2661"
        },
        "/station/SMB": {
            "name": {
                "station": "SMITHY BRIDGE",
                "location": "SMITHY BRIDGE",
                "display": "Smithy Bridge",
                "print": "Smithy Bridge"
            },
            "code": {
                "nlc": "2660",
                "uic": "7026600",
                "crs": "SMB",
                "tiploc": "SMBG",
                "atco": "9100SMBG"
            },
            "latitude": 53.633254,
            "longitude": -2.113502,
            "facilities": [
                "TVM",
                "L",
                "LI",
                "LI",
                "LI"
            ],
            "groups": [],
            "members": [],
            "londonTerminals": "/station/2660/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "2660"
        },
        "/station/RCD": {
            "name": {
                "station": "ROCHDALE",
                "location": "ROCHDALE",
                "display": "Rochdale",
                "print": "Rochdale"
            },
            "code": {
                "nlc": "2924",
                "uic": "7029240",
                "crs": "RCD",
                "tiploc": "RCHDALE",
                "atco": "9100RCHDALE"
            },
            "latitude": 53.610307,
            "longitude": -2.153524,
            "facilities": [
                "TVM",
                "G",
                "L",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": "/station/2924/groups",
            "members": [],
            "londonTerminals": "/station/2924/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "2924"
        },
        "/station/LDS": {
            "name": {
                "station": "LEEDS",
                "location": "LEEDS",
                "display": "Leeds",
                "print": "Leeds"
            },
            "code": {
                "nlc": "8487",
                "uic": "7084870",
                "crs": "LDS",
                "tiploc": "LEEDS",
                "atco": "9100LEEDS"
            },
            "latitude": 53.795627,
            "longitude": -1.548026,
            "facilities": [
                "BO",
                "TVM",
                "G",
                "L",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": "/station/8487/groups",
            "members": [],
            "londonTerminals": "/station/8487/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-085000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "8487"
        },
        "/station/WGW": {
            "name": {
                "station": "WIGAN WALLGATE",
                "location": "WIGAN WALLGATE",
                "display": "Wigan Wallgate",
                "print": "Wigan Wallgate"
            },
            "code": {
                "nlc": "2406",
                "uic": "7024060",
                "crs": "WGW",
                "tiploc": "WIGANWL",
                "atco": "9100WIGANWL"
            },
            "latitude": 53.544821,
            "longitude": -2.633185,
            "facilities": [
                "TVM",
                "G",
                "L",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": "/station/2406/groups",
            "members": [],
            "londonTerminals": "/station/2406/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "0446"
        },
        "/toc/NT": {
            "code": "NT",
            "name": "NORTHERN",
            "description": "NORTHERN"
        },
        "/station/HBD": {
            "name": {
                "station": "HEBDEN BRIDGE",
                "location": "HEBDEN BRIDGE",
                "display": "Hebden Bridge",
                "print": "Hebden Bridge"
            },
            "code": {
                "nlc": "8524",
                "uic": "7085240",
                "crs": "HBD",
                "tiploc": "HBDNBDG",
                "atco": "9100HBDNBDG"
            },
            "latitude": 53.737587,
            "longitude": -2.009059,
            "facilities": [
                "TVM",
                "L",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": [],
            "members": [],
            "londonTerminals": "/station/8524/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "8524"
        },
        "/station/MCV": {
            "name": {
                "station": "MANCHESTER VICTORIA",
                "location": "MANCHESTER VIC",
                "display": "Manchester Victoria",
                "print": "Manchester Victoria"
            },
            "code": {
                "nlc": "2970",
                "uic": "7029700",
                "crs": "MCV",
                "tiploc": "MNCRVIC",
                "atco": "9100MNCRVIC"
            },
            "latitude": 53.487468,
            "longitude": -2.242599,
            "facilities": [
                "BO",
                "TVM",
                "G",
                "L",
                "LI",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": "/station/2970/groups",
            "members": [],
            "londonTerminals": "/station/2970/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009003S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "0438"
        },
        "/ticket-type/DG6": {
            "name": {
                "display": "Advance Single",
                "print": "Advance Single",
                "description": "ADVANCE"
            },
            "ccstFormat": "X10",
            "code": "DG6",
            "validity": "/validity-type/64",
            "isReturn": false,
            "isSeason": false,
            "isAdvance": true,
            "isPackage": false,
            "isCarnet": false,
            "isFirstClass": false,
            "reservationType": "B",
            "maxPassengers": 1,
            "minPassengers": 1,
            "minAdults": 0,
            "maxAdults": 1,
            "minChildren": 0,
            "maxChildren": 1,
            "utsCode": 0,
            "timeRestriction": 0,
            "capriCode": "SDI",
            "canBeRetailed": true,
            "ticketCategory": "advance",
            "reservationSupplement": null
        },
        "/ticket-type/DG3": {
            "name": {
                "display": "Advance Single",
                "print": "Advance Single",
                "description": "ADVANCE"
            },
            "ccstFormat": "X10",
            "code": "DG3",
            "validity": "/validity-type/64",
            "isReturn": false,
            "isSeason": false,
            "isAdvance": true,
            "isPackage": false,
            "isCarnet": false,
            "isFirstClass": false,
            "reservationType": "B",
            "maxPassengers": 1,
            "minPassengers": 1,
            "minAdults": 0,
            "maxAdults": 1,
            "minChildren": 0,
            "maxChildren": 1,
            "utsCode": 0,
            "timeRestriction": 0,
            "capriCode": "SDC",
            "canBeRetailed": true,
            "ticketCategory": "advance",
            "reservationSupplement": null
        },
        "/ticket-type/DG0": {
            "name": {
                "display": "Advance Single",
                "print": "Advance Single",
                "description": "ADVANCE"
            },
            "ccstFormat": "X10",
            "code": "DG0",
            "validity": "/validity-type/64",
            "isReturn": false,
            "isSeason": false,
            "isAdvance": true,
            "isPackage": false,
            "isCarnet": false,
            "isFirstClass": false,
            "reservationType": "B",
            "maxPassengers": 1,
            "minPassengers": 1,
            "minAdults": 0,
            "maxAdults": 1,
            "minChildren": 0,
            "maxChildren": 1,
            "utsCode": 0,
            "timeRestriction": 0,
            "capriCode": "SDM",
            "canBeRetailed": true,
            "ticketCategory": "advance",
            "reservationSupplement": null
        },
        "/route/00429": {
            "code": "00429",
            "name": {
                "description": "AP NORTHERN ONLY",
                "aaaDescription": null,
                "print": "Valid on specified Northern Trains only",
                "display": "Only valid on booked Northern services."
            },
            "included": [],
            "excluded": [],
            "lul": "NNNNNN-000000000000-_"
        },
        "/station/8524": {
            "name": {
                "station": "HEBDEN BRIDGE",
                "location": "HEBDEN BRIDGE",
                "display": "Hebden Bridge",
                "print": "Hebden Bridge"
            },
            "code": {
                "nlc": "8524",
                "uic": "7085240",
                "crs": "HBD",
                "tiploc": "HBDNBDG",
                "atco": "9100HBDNBDG"
            },
            "latitude": 53.737587,
            "longitude": -2.009059,
            "facilities": [
                "TVM",
                "L",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": [],
            "members": [],
            "londonTerminals": "/station/8524/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "8524"
        },
        "/station/2970": {
            "name": {
                "station": "MANCHESTER VICTORIA",
                "location": "MANCHESTER VIC",
                "display": "Manchester Victoria",
                "print": "Manchester Victoria"
            },
            "code": {
                "nlc": "2970",
                "uic": "7029700",
                "crs": "MCV",
                "tiploc": "MNCRVIC",
                "atco": "9100MNCRVIC"
            },
            "latitude": 53.487468,
            "longitude": -2.242599,
            "facilities": [
                "TVM",
                "G",
                "BO",
                "L",
                "LI",
                "LI",
                "LI",
                "LI",
                "LI"
            ],
            "groups": "/station/2970/groups",
            "members": [],
            "londonTerminals": "/station/2970/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009003S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "0438"
        },
        "/validity-type/64": {
            "code": "64",
            "outward": {
                "days": 1,
                "months": 0,
                "break": false,
                "description": "BOOKDTRAINONLY"
            },
            "return": {
                "days": 0,
                "months": 0,
                "break": false,
                "description": "INVALID"
            },
            "returnMustBeAfter": {
                "days": 0,
                "months": 0,
                "dayOfWeek": null
            }
        },
        "/disruption/2024-09-26T14:36:00/NT_MCV_HBD_G37319": [],
        "/disruption/2024-09-26T14:54:00/NT_MCV_HBD_G31967": [],
        "/disruption/2024-09-26T13:57:00/NT_MCV_HBD_G30188": [],
        "/disruption/2024-09-26T14:21:00/NT_MCV_HBD_G30155": [],
        "/disruption/2024-09-26T13:36:00/NT_MCV_HBD_G37312": [],
        "/ticket/140099": {
            "fare": "/fare/130612",
            "adults": 1,
            "children": 0,
            "transactionNumber": "92083",
            "state": "Fulfilled",
            "reservation": "/reservation/YR782647",
            "utn": "R2FQ5R5WRFE",
            "outwardValidity": {
                "validFrom": "2024-09-26",
                "validUntil": "2024-09-26"
            },
            "returnValidity": null,
            "outwardPortion": "/journey/150743",
            "returnPortion": null,
            "supplements": [],
            "seats": [
                {
                    "seat": "/seat-reservation/94581",
                    "leg": "/leg/14235",
                    "supplement": "/supplement/113664"
                }
            ],
            "passenger": "/passenger/101137",
            "originalTicket": null,
            "priceCoveredByOriginalTicket": null
        },
        "/fare/130612": {
            "ticketType": "/ticket-type/DG6",
            "origin": "/station/2970",
            "destination": "/station/8524",
            "price": 520,
            "originalPrice": 520,
            "railcard": null,
            "restrictionCode": "NT",
            "route": "/route/00429",
            "statusCode": "000",
            "fareSetter": "NTH",
            "xLondon": 0,
            "isPlusBus": false,
            "discount": null,
            "childStatusDescription": null,
            "adultStatusDescription": null,
            "labels": [
                "advance"
            ],
            "assistedCode": null
        },
        "/reservation/YR782647": {
            "created": "2024-09-24T12:32:35+01:00",
            "seats": [
                "/seat-reservation/94581"
            ]
        },
        "/seat-reservation/94581": {
            "id": "94581",
            "coach": "*",
            "seat": "***",
            "leg": "/leg/14235",
            "supplement": "/supplement/113664",
            "reservation": "/reservation/YR782647"
        },
        "/leg/14235": {
            "type": "timetabled",
            "origin": "/station/2970",
            "destination": "/station/8524",
            "service": "/service/G37319/2024-09-26",
            "operator": "/toc/NT",
            "mode": "train",
            "scheduledDeparture": "2024-09-26T14:36:00+01:00",
            "scheduledArrival": "2024-09-26T15:15:00+01:00",
            "boardingTime": null,
            "alightingTime": null,
            "callingPoints": [
                {
                    "crs": "MCV",
                    "arrival": "2024-09-26T14:33:00+01:00",
                    "departure": "2024-09-26T14:36:00+01:00",
                    "platform": "6",
                    "pickup": true,
                    "dropoff": true
                },
                {
                    "crs": "RCD",
                    "arrival": "2024-09-26T14:50:00+01:00",
                    "departure": "2024-09-26T14:51:00+01:00",
                    "platform": "1",
                    "pickup": true,
                    "dropoff": true
                },
                {
                    "crs": "SMB",
                    "arrival": "2024-09-26T14:55:00+01:00",
                    "departure": "2024-09-26T14:55:00+01:00",
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true
                },
                {
                    "crs": "LTL",
                    "arrival": "2024-09-26T14:58:00+01:00",
                    "departure": "2024-09-26T14:59:00+01:00",
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true
                },
                {
                    "crs": "WDN",
                    "arrival": "2024-09-26T15:05:00+01:00",
                    "departure": "2024-09-26T15:05:00+01:00",
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true
                },
                {
                    "crs": "TOD",
                    "arrival": "2024-09-26T15:08:00+01:00",
                    "departure": "2024-09-26T15:08:00+01:00",
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true
                },
                {
                    "crs": "HBD",
                    "arrival": "2024-09-26T15:15:00+01:00",
                    "departure": "2024-09-26T15:15:00+01:00",
                    "platform": "2",
                    "pickup": true,
                    "dropoff": true
                }
            ]
        },
        "/service/G37319/2024-09-26": {
            "type": "fixed",
            "mode": "train",
            "retailServiceId": "NT415300",
            "trainUid": "G37319",
            "callingPoints": "/service/G37319/2024-09-26/calling-points",
            "reservable": [
                "Possible from any station"
            ]
        },
        "/service/G37319/2024-09-26/calling-points": [],
        "/supplement/113664": {
            "type": "/supplement-type/XFS",
            "transactionNumber": "92084",
            "price": 0,
            "isBerth": false
        },
        "/journey/150743": {
            "distance": 23,
            "co2": null,
            "boardingTime": null,
            "alightingTime": null,
            "legs": [
                "/leg/14235"
            ]
        },
        "/passenger/101137": {
            "title": "Mr",
            "initials": "Mateusz",
            "surname": "Angulski",
            "photocardNumber": null
        },
        "/supplement-type/XFS": {
            "code": "XFS",
            "type": "SEA",
            "capriCode": "ZYM",
            "description": "SEAT",
            "shortDescription": "SEAT        ",
            "price": 0,
            "minGroup": 1,
            "maxGroup": 4,
            "class": 2,
            "isSeparateTicket": true,
            "sundryCode": null,
            "packageDirections": []
        }
    },
    "messages": []
}
422 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
403 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

Delivery

Introduction

Welcome to the Delivery API Documentation. The Delivery API allows you to read delivery mothods available in TIS. It also allow you to check which delivery methods are available for particular order.

URI parameters

string id (required)

Pattern: ^[a-z\-]+$

GET /delivery-method/{id}

Read particular delivery method details

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "id": {
                            "type": "string"
                        },
                        "uri": {
                            "type": "string"
                        },
                        "displayOrder": {
                            "type": "number"
                        },
                        "name": {
                            "type": "string"
                        },
                        "time": {
                            "type": "string"
                        },
                        "requirements": {
                            "type": "string"
                        },
                        "fulfilmentType": {
                            "type": "number"
                        },
                        "price": {
                            "type": "number"
                        },
                        "isForCarnet": {
                            "type": "boolean"
                        },
                        "isForSeason": {
                            "type": "boolean"
                        },
                        "isForSeasonAnnual": {
                            "type": "boolean"
                        },
                        "isForSingle": {
                            "type": "boolean"
                        },
                        "minSecondsBefore": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "minWorkingDaysBefore": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "maxValue": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "active": {
                            "type": "boolean"
                        },
                        "maxTickets": {
                            "type": [
                                "number",
                                "null"
                            ]
                        }
                    },
                    "required": [
                        "uri",
                        "displayOrder",
                        "name",
                        "time",
                        "requirements",
                        "fulfilmentType",
                        "price",
                        "isForCarnet",
                        "isForSeason",
                        "isForSeasonAnnual",
                        "isForSingle",
                        "minSecondsBefore",
                        "minWorkingDaysBefore",
                        "maxValue"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "id": "first-class-post",
        "uri": "/delivery-method/first-class-post",
        "displayOrder": 2,
        "name": "First class post",
        "time": "(allow up to five working days)",
        "requirements": "Postal address",
        "fulfilmentType": 9,
        "price": 150,
        "isForCarnet": false,
        "isForSeason": false,
        "isForSeasonAnnual": false,
        "isForSingle": true,
        "minSecondsBefore": null,
        "minWorkingDaysBefore": 5,
        "maxValue": 25000,
        "active": true
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "status",
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Delivery method with id abc does not exist.",
    "code": "ERR-NOT-FOUND"
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /delivery/order/{id}

Read all delivery methods available for particular order

Parameters

string format

Possible values are legacy and links. Currently defaults to legacy.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "/delivery-method/first-class-post"
    ],
    "links": {
        "/delivery-method/first-class-post": {
            "id": "first-class-post",
            "uri": "/delivery-method/first-class-post",
            "displayOrder": 2,
            "name": "First class post",
            "time": "(allow up to five working days)",
            "requirements": "Postal address",
            "fulfilmentType": 9,
            "price": 150,
            "isForCarnet": false,
            "isForSeason": false,
            "isForSeasonAnnual": false,
            "isForSingle": true,
            "minSecondsBefore": null,
            "minWorkingDaysBefore": 5,
            "maxValue": 25000
        }
    }
}
204 text/html
Response headers

string X-Message

Explanation of lack of delivery methods for order

404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "status",
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Order with id 1234 was not found",
    "code": "ERR-NOT-FOUND"
}
URI parameters

string fareOrigin (required)

Fare origin station NLC code

Pattern: ^.+$

string fareDestination (required)

Fare destination station NLC code

Pattern: ^.+$

string journeyOrigin (required)

Journey origin station NLC code

Pattern: ^.+$

string journeyDestination (required)

Journey destination station NLC code

Pattern: ^.+$

string travelDate (required)

Pattern: ^\d{4}\-\d{2}\-\d{2}$

Example: 1618358400

string routeCode (required)

Pattern: ^\d{5}$

Example: 00345

string ticketCodes (required)

A list of ticket codes separated by commas

Example: ABC,DEF,GHI

GET /delivery/params/{fareOrigin}/{fareDestination}/{journeyOrigin}/{journeyDestination}/{travelDate}/{routeCode}/{ticketCodes}

Read all delivery methods available for provided parameters

Parameters

string format

Possible values are legacy and links. Currently defaults to legacy.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "/delivery-method/first-class-post"
    ],
    "links": {
        "/delivery-method/first-class-post": {
            "id": "first-class-post",
            "uri": "/delivery-method/first-class-post",
            "displayOrder": 2,
            "name": "First class post",
            "time": "(allow up to five working days)",
            "requirements": "Postal address",
            "fulfilmentType": 9,
            "price": 150,
            "isForCarnet": false,
            "isForSeason": false,
            "isForSeasonAnnual": false,
            "isForSingle": true,
            "minSecondsBefore": null,
            "minWorkingDaysBefore": 5,
            "maxValue": 25000
        }
    }
}
204 text/html
Response headers

string X-Message

Explanation of lack of delivery methods for provided parameters

404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "status",
                "message"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Order with id 1234 was not found",
    "code": "ERR-NOT-FOUND"
}
URI parameters

string fareOrigin (required)

Fare origin station NLC code

Pattern: ^.+$

string fareDestination (required)

Fare destination station NLC code

Pattern: ^.+$

string journeyOrigin (required)

Journey origin station NLC code

Pattern: ^.+$

string journeyDestination (required)

Journey destination station NLC code

Pattern: ^.+$

string routeCode (required)

Pattern: ^\d{5}$

Example: 00345

string ticketCode (required)

A list of ticket codes separated by commas

Example: SOS,SSS

GET /has-e-ticket/{fareOrigin}/{fareDestination}/{journeyOrigin}/{journeyDestination}/{routeCode}/{ticketCodes}

Check whether a specific ticket set can be an e-ticket

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "e-ticket": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "e-ticket"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "e-ticket": true
    }
}
URI parameters

string items (required)

Items to be checked as comma-separated fareOrigin-fareDestination-journeyOrigin-journeyDestination-routeCode-ticketCode

Pattern: ^([0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{4}-[0-9]{5}-[A-Za-z0-9]{3}[,]*)+$

Example: 1234-5678-9012-3456-78901-ABC,1234-5678-9012-3456-78901-DEF

GET /has-e-ticket/{items}

Check whether a specific ticket set can be an e-ticket

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "e-ticket": {
                            "type": "boolean"
                        }
                    },
                    "required": [
                        "e-ticket"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "e-ticket": true
    }
}

Card Payments

Secure Trading API

The card payments API processes card payments with 3d secure and fraud checks.

POST /st-card-payment

Request schema (show)
{
    "description": "Card payment request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "order",
        "amount",
        "callback"
    ],
    "properties": {
        "order": {
            "type": [
                "string"
            ],
            "pattern": "/order/[0-9]+"
        },
        "amount": {
            "type": "integer",
            "description": "Amount pence in GBP"
        },
        "callback": {
            "type": "string",
            "description": "Callback url required for 3d secure payments"
        },
        "cardToken": {
            "type": "string"
        },
        "expiryMonth": {
            "type": "integer"
        },
        "expiryYear": {
            "type": "integer"
        },
        "billingAddress": {
            "description": "Card payment billing address schema",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "title",
                "firstNames",
                "surname",
                "address1",
                "town",
                "country"
            ],
            "properties": {
                "title": {
                    "description": "e.g. Mr, Miss, Dr",
                    "type": "string",
                    "maxLength": 25
                },
                "firstNames": {
                    "type": "string",
                    "maxLength": 254
                },
                "surname": {
                    "type": "string",
                    "maxLength": 127
                },
                "address1": {
                    "type": "string",
                    "maxLength": 25
                },
                "address2": {
                    "type": "string",
                    "maxLength": 127
                },
                "address3": {
                    "type": "string",
                    "maxLength": 127
                },
                "town": {
                    "type": "string",
                    "maxLength": 127
                },
                "county": {
                    "description": "For US addresses, the state would be entered in this field",
                    "type": "string",
                    "maxLength": 127
                },
                "postCode": {
                    "description": "If the country provided is not United States, Great Britain or Canada, or if no country is provided, the postcode field is not validated",
                    "type": "string",
                    "maxLength": 25
                },
                "country": {
                    "description": "This will need to be in ISO2A format. https://www.securetrading.com/docs/document/toolbox/country-codes/",
                    "type": "string",
                    "pattern": "^[A-Z]{2}$",
                    "maxLength": 2
                },
                "telephoneNumber": {
                    "type": "string",
                    "pattern": "^[0-9\\-\\+\\(\\)\\s]{0,20}$",
                    "maxLength": 20
                },
                "email": {
                    "type": "string",
                    "pattern": "^.*$",
                    "maxLength": 255
                },
                "marketingSignup": {
                    "type": "boolean"
                }
            }
        },
        "storedCard": {
            "type": [
                "string"
            ],
            "pattern": "/st-card/[0-9]+"
        },
        "currency": {
            "type": "string",
            "default": "GBP",
            "description": "One of currency codes from https://docs.trustpayments.com/document/toolbox/currency-codes/ that is available on the secure trading account",
            "pattern": "^[A-Z]{3}$"
        },
        "localAmount": {
            "type": "integer",
            "description": "Amount pence in selected currency"
        }
    }
}
Request example (show)
{
    "order": "/order/1",
    "amount": 1000,
    "expiryMonth": 10,
    "expiryYear": 2029,
    "cardToken": "abcd1234",
    "billingAddress": {
        "title": "Mr",
        "firstNames": "Test Ing",
        "surname": "Person",
        "address1": "123 Test Street",
        "address2": "Another Street",
        "town": "Test Town",
        "county": "Norfolk",
        "country": "GB",
        "postCode": "TE57 1NG",
        "telephoneNumber": "+79 123-123-123"
    },
    "callback": "http://www.example.org"
}
Request example (show)
{
    "order": "/order/1",
    "storedCard": "/st-card/1",
    "currency": "GBP",
    "localAmount": 0,
    "cvv": 123,
    "amount": 615
}
200 application/json
Response schema (show)
{
    "description": "Secure Trading Card Payment response",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "required": [
                "links"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "payment"
                    ],
                    "properties": {
                        "payment": {
                            "type": [
                                "string"
                            ],
                            "pattern": "/st-card-payment/[0-9]+"
                        },
                        "threeDSecure": {
                            "type": "object",
                            "description": "Information required for preforming three d secure process",
                            "properties": {
                                "acsUrl": {
                                    "type": "string",
                                    "description": "Bank website that need to be used to start three d secure process"
                                },
                                "MD": {
                                    "type": "string",
                                    "description": "The unique 3-D Secure reference for this transaction"
                                },
                                "PaReq": {
                                    "type": "string",
                                    "description": "The unique identifier for the transaction"
                                },
                                "TermUrl": {
                                    "type": "string",
                                    "description": "Address where bank will redirect in the end of process"
                                }
                            },
                            "required": [
                                "acsUrl",
                                "MD",
                                "PaReq",
                                "TermUrl"
                            ]
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "payment": "/st-card-payment/1",
        "threeDSecure": {
            "acsUrl": "https://webapp.securetrading.net/acs/visa.cgi",
            "MD": "UEZOVVBqeE5SRDQ4VFVSSVBtWjJWMWR4SzBKeWQySmxLMnQ1TUhSRlVrSkNja0U5UFR3dlRVUklQanhoWTNOVmNtdythSFIwY0hNNkx5OTNaV0poY0hBdWMyVmpkWEpsZEhKaFpHbHVaeTV1WlhRdllXTnpMM1pwYzJFdVkyZHBQQzloWTNOVmNtdytQSEJoYmt4bGJtZDBhRDR4Tmp3dmNHRnVUR1Z1WjNSb1BqeHRaWE56WVdkbFNXUStVRUZTWlhFdE1UVXdORFV5TmpRM05UWXdOeTB4T0RjM05UTTJOamt6UEM5dFpYTnpZV2RsU1dRK1BDOU5SRDQ4TDFOVVBnPT06bWRlU29aUlIrYytQTGt3OU5OdHZyUzRNeFpJa2hNT0k4bzY0WjdlZjZmNTNzPQ==",
            "PaReq": "eJxVUttuAiEQ/RXj+8plb2pGElub1KQ1atf0mcBEN9mLAhr9+8KqVeeFOTNwOHMAip1BnP2gOhoU8I3Wyi32Sj3pL6drPEQspUnKsyRPM5pHbJjnaZxlo7gvoNsg4ITGlm0j2IAOOJA79FxG7WTjBEh1eJsvBONxkmZAbhBqNPOZoK8B5FqGRtYoptaicaXtfTkNpCuBao+NMxcx5J7rDuBoKrFzbj8mxHbDRM5IXTbbyDOcSoWDqlWyItZFShod7eWlxsYRTkmsLZBwHshD8/IYMuvvO5dayM15U9AVX3CdylhdiqIq1h96t/ptJ0DCDtDSoeCU5XREkx7jY8rGLAXS1UHWQWiwwM9/zWEfrpg+NZ4L4Gcw2Kj7nHcEeN63jVcuvNf/OWi0yuu/LQ/x75/BfuW8owl7jfAQXSNQlt7DmLIrZwBAwlFye2Ny+xg+e/kwf2fkumw=",
            "TermUrl": "http://secure-trading-service.local/st-card-payment/1/3ds"
        }
    },
    "links": {
        "/st-card-payment/1": {
            "amount": 1000,
            "currency": "GBP",
            "status": "Pending",
            "billingAddress": {
                "title": "Mr",
                "firstNames": "Test Ing",
                "surname": "Person",
                "address1": "123 Test Street",
                "address2": "Another Street",
                "town": "Test Town",
                "county": "Norfolk",
                "country": "GB",
                "postCode": "TE57 1NG",
                "telephoneNumber": "+79 123-123-123"
            },
            "underReview": false,
            "fraudChecked": true,
            "3dSecureEnabled": true,
            "pan": "411111######1111",
            "cardType": "VISA",
            "expiryDate": "122017",
            "created": "2017-06-25T14:00:00+00:00",
            "updated": "2017-06-25T14:05:00+00:00"
        }
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "validation": {
            "amount": "must be greater than 0, but is equal to \"-1\""
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Stored card not found"
    }
}
422 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "code": "10000",
        "message": "The payment was declined by the bank"
    }
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /st-card-payment/{id}

200 application/json
Response schema (show)
{
    "description": "Secure Trading Card Payment object",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "amount",
                        "currency",
                        "localAmount",
                        "status",
                        "underReview",
                        "fraudChecked",
                        "3dSecureEnabled",
                        "pan",
                        "cardType",
                        "expiryDate",
                        "lastReference",
                        "authReference",
                        "created",
                        "updated"
                    ],
                    "properties": {
                        "amount": {
                            "type": "integer",
                            "description": "Amount pence in GBP"
                        },
                        "currency": {
                            "type": "string",
                            "description": "One of currency codes from https://www.securetrading.com/docs/document/toolbox/currency-codes/ that is available on the secure trading account"
                        },
                        "localAmount": {
                            "type": [
                                "integer",
                                "null"
                            ],
                            "description": "Amount pence in selected currency"
                        },
                        "status": {
                            "description": "Current status of the payment transaction.",
                            "type": "string",
                            "enum": [
                                "Pending",
                                "Declined",
                                "Authorised"
                            ]
                        },
                        "billingAddress": {
                            "description": "Card payment billing address schema",
                            "type": "object",
                            "additionalProperties": false,
                            "required": [
                                "title",
                                "firstNames",
                                "surname",
                                "address1",
                                "town",
                                "country"
                            ],
                            "properties": {
                                "title": {
                                    "description": "e.g. Mr, Miss, Dr",
                                    "type": "string",
                                    "maxLength": 25
                                },
                                "firstNames": {
                                    "type": "string",
                                    "maxLength": 254
                                },
                                "surname": {
                                    "type": "string",
                                    "maxLength": 127
                                },
                                "address1": {
                                    "type": "string",
                                    "maxLength": 25
                                },
                                "address2": {
                                    "type": "string",
                                    "maxLength": 127
                                },
                                "address3": {
                                    "type": "string",
                                    "maxLength": 127
                                },
                                "town": {
                                    "type": "string",
                                    "maxLength": 127
                                },
                                "county": {
                                    "description": "For US addresses, the state would be entered in this field",
                                    "type": "string",
                                    "maxLength": 127
                                },
                                "postCode": {
                                    "description": "If the country provided is not United States, Great Britain or Canada, or if no country is provided, the postcode field is not validated",
                                    "type": "string",
                                    "maxLength": 25
                                },
                                "country": {
                                    "description": "This will need to be in ISO2A format. https://www.securetrading.com/docs/document/toolbox/country-codes/",
                                    "type": "string",
                                    "pattern": "^[A-Z]{2}$",
                                    "maxLength": 2
                                },
                                "telephoneNumber": {
                                    "type": "string",
                                    "pattern": "^[0-9\\-\\+\\(\\)\\s]{0,20}$",
                                    "maxLength": 20
                                },
                                "email": {
                                    "type": "string",
                                    "pattern": "^.*$",
                                    "maxLength": 255
                                },
                                "marketingSignup": {
                                    "type": "boolean"
                                }
                            }
                        },
                        "underReview": {
                            "type": "boolean"
                        },
                        "fraudChecked": {
                            "type": "boolean"
                        },
                        "3dSecureEnabled": {
                            "type": "boolean"
                        },
                        "pan": {
                            "description": "Masked card number, e.g. 411111######1111",
                            "type": [
                                "string",
                                "null"
                            ],
                            "pattern": "^[0-9]{6,6}#{6,6}[0-9]{4,4}$"
                        },
                        "cardType": {
                            "type": [
                                "string",
                                "null"
                            ]
                        },
                        "expiryDate": {
                            "type": "string"
                        },
                        "authReference": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "Reference to auth operation on payment in SecureTrading"
                        },
                        "lastReference": {
                            "type": [
                                "string",
                                "null"
                            ],
                            "description": "Reference to last operation on payment in SecureTrading"
                        },
                        "created": {
                            "type": "string"
                        },
                        "updated": {
                            "type": [
                                "string",
                                "null"
                            ]
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "amount": 1000,
        "currency": "GBP",
        "status": "Pending",
        "billingAddress": {
            "title": "Mr",
            "firstNames": "Mat Pat",
            "surname": "Tad",
            "address1": "Address Line 1",
            "town": "Berat",
            "postCode": "123-45-GET",
            "country": "UG"
        },
        "underReview": false,
        "fraudChecked": true,
        "3dSecureEnabled": true,
        "pan": "411111######1111",
        "cardType": "VISA",
        "expiryDate": "122017",
        "lastReference": null,
        "authReference": "123-abcd4e",
        "created": "2017-06-25T14:00:00+00:00",
        "updated": "2017-06-25T14:05:00+00:00"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}

PUT /st-card-payment/{id}

Request schema (show)
{
    "description": "Card payment fraud challanged update request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "status"
    ],
    "properties": {
        "status": {
            "type": "string",
            "description": "One of payment statuses: Declined or Authorised"
        }
    }
}
Request example (show)
{
    "status": "Authorised"
}
200 application/json
Response schema (show)
{
    "description": "Secure Trading Card Payment response",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "required": [
                "links"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "payment"
                    ],
                    "properties": {
                        "payment": {
                            "type": [
                                "string"
                            ],
                            "pattern": "/st-card-payment/[0-9]+"
                        },
                        "threeDSecure": {
                            "type": "object",
                            "description": "Information required for preforming three d secure process",
                            "properties": {
                                "acsUrl": {
                                    "type": "string",
                                    "description": "Bank website that need to be used to start three d secure process"
                                },
                                "MD": {
                                    "type": "string",
                                    "description": "The unique 3-D Secure reference for this transaction"
                                },
                                "PaReq": {
                                    "type": "string",
                                    "description": "The unique identifier for the transaction"
                                },
                                "TermUrl": {
                                    "type": "string",
                                    "description": "Address where bank will redirect in the end of process"
                                }
                            },
                            "required": [
                                "acsUrl",
                                "MD",
                                "PaReq",
                                "TermUrl"
                            ]
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "payment": "/st-card-payment/1",
        "threeDSecure": {
            "acsUrl": "https://webapp.securetrading.net/acs/visa.cgi",
            "MD": "UEZOVVBqeE5SRDQ4VFVSSVBtWjJWMWR4SzBKeWQySmxLMnQ1TUhSRlVrSkNja0U5UFR3dlRVUklQanhoWTNOVmNtdythSFIwY0hNNkx5OTNaV0poY0hBdWMyVmpkWEpsZEhKaFpHbHVaeTV1WlhRdllXTnpMM1pwYzJFdVkyZHBQQzloWTNOVmNtdytQSEJoYmt4bGJtZDBhRDR4Tmp3dmNHRnVUR1Z1WjNSb1BqeHRaWE56WVdkbFNXUStVRUZTWlhFdE1UVXdORFV5TmpRM05UWXdOeTB4T0RjM05UTTJOamt6UEM5dFpYTnpZV2RsU1dRK1BDOU5SRDQ4TDFOVVBnPT06bWRlU29aUlIrYytQTGt3OU5OdHZyUzRNeFpJa2hNT0k4bzY0WjdlZjZmNTNzPQ==",
            "PaReq": "eJxVUttuAiEQ/RXj+8plb2pGElub1KQ1atf0mcBEN9mLAhr9+8KqVeeFOTNwOHMAip1BnP2gOhoU8I3Wyi32Sj3pL6drPEQspUnKsyRPM5pHbJjnaZxlo7gvoNsg4ITGlm0j2IAOOJA79FxG7WTjBEh1eJsvBONxkmZAbhBqNPOZoK8B5FqGRtYoptaicaXtfTkNpCuBao+NMxcx5J7rDuBoKrFzbj8mxHbDRM5IXTbbyDOcSoWDqlWyItZFShod7eWlxsYRTkmsLZBwHshD8/IYMuvvO5dayM15U9AVX3CdylhdiqIq1h96t/ptJ0DCDtDSoeCU5XREkx7jY8rGLAXS1UHWQWiwwM9/zWEfrpg+NZ4L4Gcw2Kj7nHcEeN63jVcuvNf/OWi0yuu/LQ/x75/BfuW8owl7jfAQXSNQlt7DmLIrZwBAwlFye2Ny+xg+e/kwf2fkumw=",
            "TermUrl": "http://secure-trading-service.local/st-card-payment/1/3ds"
        }
    },
    "links": {
        "/st-card-payment/1": {
            "amount": 1000,
            "currency": "GBP",
            "status": "Pending",
            "billingAddress": {
                "title": "Mr",
                "firstNames": "Test Ing",
                "surname": "Person",
                "address1": "123 Test Street",
                "address2": "Another Street",
                "town": "Test Town",
                "county": "Norfolk",
                "country": "GB",
                "postCode": "TE57 1NG",
                "telephoneNumber": "+79 123-123-123"
            },
            "underReview": false,
            "fraudChecked": true,
            "3dSecureEnabled": true,
            "pan": "411111######1111",
            "cardType": "VISA",
            "expiryDate": "122017",
            "created": "2017-06-25T14:00:00+00:00",
            "updated": "2017-06-25T14:05:00+00:00"
        }
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "validation": {
            "amount": "must be greater than 0, but is equal to \"-1\""
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Stored card not found"
    }
}
422 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Payment is not under review"
    }
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

POST /st-card-payment/{id}/3ds

URI parameters

string id (required)

Pattern: ^\d+$

POST /st-card-payment/{id}/refund

Request schema (show)
{
    "description": "Payment refund request",
    "type": "object",
    "additionalProperties": false,
    "required": [],
    "properties": {
        "amount": {
            "type": "integer",
            "description": "Amount pence in GBP (default currency)"
        },
        "localAmount": {
            "type": "integer",
            "description": "Amount pence in selected currency"
        }
    }
}
Request example (show)
{
    "localAmount": 3000,
    "amount": 2560
}
200 application/json
Response schema (show)
{
    "description": "Secure Trading Card Payment Refund response",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "transactionRef"
                    ],
                    "properties": {
                        "transactionRef": {
                            "type": "string"
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "transactionRef": "123abc"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "validation": {
            "amount": "must be greater than 0, but is equal to \"-1\""
        }
    }
}
422 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Refund amount too great",
        "code": 20007
    }
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /st-card

Request schema (show)
{
    "description": "Card store request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "cardToken",
        "expiryMonth",
        "expiryYear",
        "billingAddress"
    ],
    "properties": {
        "cardToken": {
            "type": "string"
        },
        "billingAddress": {
            "description": "Card payment billing address schema",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "title",
                "firstNames",
                "surname",
                "address1",
                "town",
                "country"
            ],
            "properties": {
                "title": {
                    "description": "e.g. Mr, Miss, Dr",
                    "type": "string",
                    "maxLength": 25
                },
                "firstNames": {
                    "type": "string",
                    "maxLength": 254
                },
                "surname": {
                    "type": "string",
                    "maxLength": 127
                },
                "address1": {
                    "type": "string",
                    "maxLength": 25
                },
                "address2": {
                    "type": "string",
                    "maxLength": 127
                },
                "address3": {
                    "type": "string",
                    "maxLength": 127
                },
                "town": {
                    "type": "string",
                    "maxLength": 127
                },
                "county": {
                    "description": "For US addresses, the state would be entered in this field",
                    "type": "string",
                    "maxLength": 127
                },
                "postCode": {
                    "description": "If the country provided is not United States, Great Britain or Canada, or if no country is provided, the postcode field is not validated",
                    "type": "string",
                    "maxLength": 25
                },
                "country": {
                    "description": "This will need to be in ISO2A format. https://www.securetrading.com/docs/document/toolbox/country-codes/",
                    "type": "string",
                    "pattern": "^[A-Z]{2}$",
                    "maxLength": 2
                },
                "telephoneNumber": {
                    "type": "string",
                    "pattern": "^[0-9\\-\\+\\(\\)\\s]{0,20}$",
                    "maxLength": 20
                },
                "email": {
                    "type": "string",
                    "pattern": "^.*$",
                    "maxLength": 255
                },
                "marketingSignup": {
                    "type": "boolean"
                }
            }
        }
    }
}
Request example (show)
{
    "cardToken": "abcd1234",
    "expiryMonth": 10,
    "expiryYear": 2029,
    "billingAddress": {
        "title": "Mr",
        "firstNames": "Test Ing",
        "surname": "Person",
        "address1": "123 Test Street",
        "address2": "Another Street",
        "town": "Test Town",
        "county": "Norfolk",
        "country": "GB",
        "postCode": "TE57 1NG",
        "telephoneNumber": "+79 123-123-123"
    }
}
200 application/json
Response example (show)
{
    "status": "success",
    "data": {
        "id": 6,
        "userId": "***",
        "expiryMonth": 10,
        "expiryYear": 2029,
        "title": "Mr",
        "firstNames": "Test Ing",
        "surname": "Person",
        "address1": "123 Test Street",
        "address2": "Another Street",
        "address3": null,
        "town": "Test Town",
        "county": "Norfolk",
        "postCode": "TE57 1NG",
        "country": "GB",
        "telephoneNumber": "+79 123-123-123",
        "transactionReference": "6-52-1785244"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "validation": {
            "cardToken": "Token is missing"
        }
    }
}
422 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Error message"
    }
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

GET /st-card

200 application/json
Response schema (show)
{
    "description": "Response with data",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data",
                "links"
            ]
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "/st-card/1"
    ],
    "links": {
        "/st-card/1": {
            "storedCard": {
                "id": 5,
                "userId": "***",
                "expiryMonth": 10,
                "expiryYear": 2029,
                "title": "Mr",
                "firstNames": "Test Ing",
                "surname": "Person",
                "address1": "123 Test Street",
                "address2": "Another Street",
                "address3": null,
                "town": "Test Town",
                "county": "Norfolk",
                "postCode": "TE57 1NG",
                "country": "GB",
                "telephoneNumber": "+79 123-123-123",
                "transactionReference": "7-52-1284041"
            },
            "maskedPan": "411111######0021",
            "addedAt": "2018-01-31 08:04:25"
        }
    }
}

GET /st-card/{id}

200 application/json
Response example (show)
{
    "status": "success",
    "data": {
        "storedCard": {
            "id": 5,
            "userId": "***",
            "expiryMonth": 10,
            "expiryYear": 2029,
            "title": "Mr",
            "firstNames": "Test Ing",
            "surname": "Person",
            "address1": "123 Test Street",
            "address2": "Another Street",
            "address3": null,
            "town": "Test Town",
            "county": "Norfolk",
            "postCode": "TE57 1NG",
            "country": "GB",
            "telephoneNumber": "+79 123-123-123",
            "transactionReference": "7-52-1284041"
        },
        "maskedPan": "411111######0021",
        "addedAt": "2018-01-31 08:04:25"
    }
}
422 application/json
Response example (show)
{
    "status": "success",
    "data": {
        "message": "User {{userId}} is not authorized to read this card data"
    }
}

DELETE /st-card/{id}

200 application/json
Response example (show)
{
    "status": "success",
    "data": []
}
422 application/json
Response example (show)
{
    "status": "fail",
    "data": {
        "message": "Error message"
    }
}

POST /st-card/:id/user

Request schema (show)
{
    "additionalProperties": false,
    "description": "Store card user schema",
    "properties": {
        "userId": {
            "required": true,
            "type": "number"
        }
    },
    "required": [
        "userId"
    ],
    "type": "object"
}
Request example (show)
{
    "userId": "/user/1"
}
200 application/json
Response example (show)
{
    "status": "success",
    "data": {
        "cardId": 1,
        "usersList": [
            "/user/2",
            "/user/1",
            "/user/3",
            "/tbo-user/6",
            "/tbo-user/8",
            "/tbo-user/10",
            "/tbo-user/11",
            "/tbo-user/13",
            "/tbo-user/15",
            "/tbo-user/1"
        ]
    }
}
422 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "message": "Example message"
    }
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

DELETE /st-card/:id/user

Request schema (show)
{
    "additionalProperties": false,
    "description": "Store card user schema",
    "properties": {
        "userId": {
            "required": true,
            "type": "number"
        }
    },
    "required": [
        "userId"
    ],
    "type": "object"
}
Request example (show)
{
    "userId": "/user/1"
}
200 application/json
Response example (show)
{
    "status": "success",
    "data": {
        "cardId": 1,
        "usersList": [
            "/user/2",
            "/user/1",
            "/user/3",
            "/tbo-user/6",
            "/tbo-user/8",
            "/tbo-user/10",
            "/tbo-user/11",
            "/tbo-user/13",
            "/tbo-user/15",
            "/tbo-user/1"
        ]
    }
}
422 application/json
Response schema (show)
{
    "description": "Response with failure",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "data"
            ]
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "message": "Example message"
    }
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                },
                "links": {
                    "description": "Response resolved links",
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

GET /st-card/:id/users

200 application/json
Response example (show)
{
    "status": "success",
    "data": {
        "cardId": 1,
        "usersList": [
            "/user/2",
            "/user/1",
            "/user/3",
            "/tbo-user/6",
            "/tbo-user/8",
            "/tbo-user/10",
            "/tbo-user/11",
            "/tbo-user/13",
            "/tbo-user/15",
            "/tbo-user/1"
        ]
    }
}

GET /v2/token

Parameters

number amount (required)

Value expressed in GBP (pence to be precise). 1000 = 10.00 GBP

Example: 1000

number localAmount

This parameter has to be specified only if currency is other than GBP. If it is not GBP, "amount" should be amount in GBP and "localAmount" should be amount expressed in currency. If "currency" is GBP and this parameter is defined, value here has to be same as value in amount" parameter.

Example: 1000

string currency (required)

Example: EUR

string reference

An optional parameter to inherit payment details from either previously stored card or another transaction. e.g. reference=/st-card/1 to pay with stored card ID 1 or reference=/st-card-payment/1 to pay with card used for card transaction ID 1

Example: /st-card/1

string order

Example: /order/123

string locale

Choose one of them 'cyGB' -> Welsh (United Kingdom) 'daDK' -> Danish (Denmark) 'deDE' -> German (Germany) 'enUS' -> English (United States) 'enGB' -> English (United Kingdom) 'esES' -> Spanish (Spain) 'frFR' -> French (France) 'nlNL' -> Dutch (The Netherlands) 'noNO' -> Norwegian (Norway) 'svSE' -> Swedish (Sweden)

Example: es_ES

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "additionalProperties": false,
                    "properties": {
                        "jwt": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "jwt"
                    ]
                }
            }
        }
    ],
    "description": "Secure Trading Serivce status",
    "type": "object"
}
Response example (show)
{
    "status": "success",
    "data": {
        "jwt": "eyJhbGciOiJIUzI1NiJ9.eyJwYXlsb2FkIjp7ImFjY291bnR0eXBlZGVzY3JpcHRpb24iOiJFQ09NIiwiYmFzZWFtb3VudCI6IjEwNTAiLCJjdXJyZW5jeWlzbzNhIjoiR0JQIiwic2l0ZXJlZmVyZW5jZSI6InRlc3RfYXNzZXJ0aXM1MTYxOCJ9LCJpYXQiOjE1Njk5Mjk2NDIsImlzcyI6Indzand0QGFzc2VydGlzLmNvLnVrIn0.TWLOfV-b009TD6uGprrHKUkMN8JDSJRoMm-3sK7QsxA"
    }
}

POST /v2/payment

Request schema (show)
{
    "description": "Card payment request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "order",
        "amount",
        "callback"
    ],
    "properties": {
        "order": {
            "type": [
                "string"
            ],
            "pattern": "/order/[0-9]+"
        },
        "jwt": {
            "type": "string",
            "description": "Json Web Token retrieved from Secure Trading (AUTH request)"
        },
        "billingAddress": {
            "description": "Card payment billing address schema",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "title",
                "firstNames",
                "surname",
                "address1",
                "town",
                "country"
            ],
            "properties": {
                "title": {
                    "description": "e.g. Mr, Miss, Dr",
                    "type": "string",
                    "maxLength": 25
                },
                "firstNames": {
                    "type": "string",
                    "maxLength": 254
                },
                "surname": {
                    "type": "string",
                    "maxLength": 127
                },
                "address1": {
                    "type": "string",
                    "maxLength": 25
                },
                "address2": {
                    "type": "string",
                    "maxLength": 127
                },
                "address3": {
                    "type": "string",
                    "maxLength": 127
                },
                "town": {
                    "type": "string",
                    "maxLength": 127
                },
                "county": {
                    "description": "For US addresses, the state would be entered in this field",
                    "type": "string",
                    "maxLength": 127
                },
                "postCode": {
                    "description": "If the country provided is not United States, Great Britain or Canada, or if no country is provided, the postcode field is not validated",
                    "type": "string",
                    "maxLength": 25
                },
                "country": {
                    "description": "This will need to be in ISO2A format. https://www.securetrading.com/docs/document/toolbox/country-codes/",
                    "type": "string",
                    "pattern": "^[A-Z]{2}$",
                    "maxLength": 2
                },
                "telephoneNumber": {
                    "type": "string",
                    "pattern": "^[0-9\\-\\+\\(\\)\\s]{0,20}$",
                    "maxLength": 20
                },
                "email": {
                    "type": "string",
                    "pattern": "^.*$",
                    "maxLength": 255
                },
                "marketingSignup": {
                    "type": "boolean"
                }
            }
        }
    }
}
Request example (show)
{
    "order": "/order/1",
    "jwt": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpYXQiOjE1NzAwMTM2NDgsInBheWxvYWQiOnsicmVxdWVzdHJlZmVyZW5jZSI6Ilc2LTl3ODhwNm1iIiwidmVyc2lvbiI6IjEuMDAiLCJqd3QiOiJleUpoYkdjaU9pSklVekkxTmlJc0luUjVjQ0k2SWtwWFZDSjkuZXlKcGMzTWlPaUozYzJwM2RFQmhjM05sY25ScGN5NWpieTUxYXlJc0ltbGhkQ0k2TVRVM01EQXhNelkwT0N3aWNHRjViRzloWkNJNmV5SndZWEpsYm5SMGNtRnVjMkZqZEdsdmJuSmxabVZ5Wlc1alpTSTZJall0T1MwME9EZ3hOekkySWl3aVltRnpaV0Z0YjNWdWRDSTZJakV3TURBaUxDSmpkWEp5Wlc1amVXbHpiek5oSWpvaVIwSlFJaXdpYzJsMFpYSmxabVZ5Wlc1alpTSTZJblJsYzNSZllYTnpaWEowYVhNMU1UWXhPQ0lzSW1GalkyOTFiblIwZVhCbFpHVnpZM0pwY0hScGIyNGlPaUpGUTA5TkluMTkuVEN4ZExZaEJGTC1hOUhXS3B3MXdfb0FzTkFJS0xBdWFnaXdSWU1wSDBHUSIsInJlc3BvbnNlIjpbeyJ0cmFuc2FjdGlvbnN0YXJ0ZWR0aW1lc3RhbXAiOiIyMDE5LTEwLTAyIDEwOjU0OjA4IiwicGFyZW50dHJhbnNhY3Rpb25yZWZlcmVuY2UiOiI2LTktNDg4MTcyNSIsImN1c3RvbWVyb3V0cHV0IjoiUkVTVUxUIiwibGl2ZXN0YXR1cyI6IjAiLCJtZXJjaGFudG5hbWUiOiJBc3NlcnRpcyBMdGQiLCJzcGxpdGZpbmFsbnVtYmVyIjoiMSIsImRjY2VuYWJsZWQiOiIwIiwic2V0dGxlZHVlZGF0ZSI6IjIwMTktMTAtMDIiLCJlcnJvcmNvZGUiOiIwIiwiY2F2diI6Ik1USXpORFUyTnpnNU1ERXlNelExTmpjNE9UQT0iLCJpc3N1ZXIiOiJTZWN1cmVUcmFkaW5nIFRlc3QgSXNzdWVyMSIsIm1lcmNoYW50bnVtYmVyIjoiMDAwMDAwMDAiLCJtZXJjaGFudGNvdW50cnlpc28yYSI6IkdCIiwic3RhdHVzIjoiWSIsInRyYW5zYWN0aW9ucmVmZXJlbmNlIjoiNi05LTQ4ODE3MjYiLCJ0aHJlZWR2ZXJzaW9uIjoiMi4yLjAiLCJwYXltZW50dHlwZWRlc2NyaXB0aW9uIjoiVklTQSIsImJhc2VhbW91bnQiOiIxMDAwIiwiZWNpIjoiMDUiLCJhY2NvdW50dHlwZWRlc2NyaXB0aW9uIjoiRUNPTSIsInRpZCI6IjI3ODgyNzg4IiwiYWNxdWlyZXJyZXNwb25zZWNvZGUiOiIwMCIsInJlcXVlc3R0eXBlZGVzY3JpcHRpb24iOiJBVVRIIiwic2VjdXJpdHlyZXNwb25zZXNlY3VyaXR5Y29kZSI6IjIiLCJjdXJyZW5jeWlzbzNhIjoiR0JQIiwiYXV0aGNvZGUiOiJURVNUMjUiLCJlcnJvcm1lc3NhZ2UiOiJPayIsImlzc3VlcmNvdW50cnlpc28yYSI6IlpaIiwibWFza2VkcGFuIjoiNDAwMDAwIyMjIyMjMTA5MSIsInNlY3VyaXR5cmVzcG9uc2Vwb3N0Y29kZSI6IjAiLCJlbnJvbGxlZCI6IlkiLCJzZWN1cml0eXJlc3BvbnNlYWRkcmVzcyI6IjAiLCJvcGVyYXRvcm5hbWUiOiJ3c2p3dEBhc3NlcnRpcy5jby51ayIsInNldHRsZXN0YXR1cyI6IjAifV0sInNlY3JhbmQiOiJ5djFnIn0sImF1ZCI6Indzand0QGFzc2VydGlzLmNvLnVrIn0.IXxm7oCmLjHqggyNM82CtmdkRsWwtWztviyGEA80MPI",
    "billingAddress": {
        "title": "Mr",
        "firstNames": "Test Ing",
        "surname": "Person",
        "address1": "123 Test Street",
        "address2": "Another Street",
        "town": "Test Town",
        "county": "Norfolk",
        "country": "GB",
        "postCode": "TE57 1NG",
        "telephoneNumber": "+79 123-123-123"
    }
}
200 application/json
Response schema (show)
{
    "description": "Secure Trading Card Payment response",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "required": [
                "links"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "payment"
                    ],
                    "properties": {
                        "payment": {
                            "type": [
                                "string"
                            ],
                            "pattern": "/st-card-payment/[0-9]+"
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "payment": "/st-card-payment/1"
    }
}

POST /st-alipay-payment/

Request schema (show)
{
    "description": "AliPay payment request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "order",
        "amount",
        "returnUrl",
        "mode"
    ],
    "properties": {
        "order": {
            "type": [
                "string"
            ],
            "pattern": "/order/[0-9]+"
        },
        "amount": {
            "type": "integer",
            "description": "Amount pence in GBP"
        },
        "returnUrl": {
            "type": "string",
            "description": "Callback url required for 3d secure payments"
        },
        "billingAddress": {
            "description": "Card payment billing address schema",
            "type": "object",
            "additionalProperties": false,
            "required": [
                "title",
                "firstNames",
                "surname",
                "address1",
                "town",
                "country"
            ],
            "properties": {
                "title": {
                    "description": "e.g. Mr, Miss, Dr",
                    "type": "string",
                    "maxLength": 25
                },
                "firstNames": {
                    "type": "string",
                    "maxLength": 254
                },
                "surname": {
                    "type": "string",
                    "maxLength": 127
                },
                "address1": {
                    "type": "string",
                    "maxLength": 25
                },
                "address2": {
                    "type": "string",
                    "maxLength": 127
                },
                "address3": {
                    "type": "string",
                    "maxLength": 127
                },
                "town": {
                    "type": "string",
                    "maxLength": 127
                },
                "county": {
                    "description": "For US addresses, the state would be entered in this field",
                    "type": "string",
                    "maxLength": 127
                },
                "postCode": {
                    "description": "If the country provided is not United States, Great Britain or Canada, or if no country is provided, the postcode field is not validated",
                    "type": "string",
                    "maxLength": 25
                },
                "country": {
                    "description": "This will need to be in ISO2A format. https://www.securetrading.com/docs/document/toolbox/country-codes/",
                    "type": "string",
                    "pattern": "^[A-Z]{2}$",
                    "maxLength": 2
                },
                "telephoneNumber": {
                    "type": "string",
                    "pattern": "^[0-9\\-\\+\\(\\)\\s]{0,20}$",
                    "maxLength": 20
                },
                "email": {
                    "type": "string",
                    "pattern": "^.*$",
                    "maxLength": 255
                },
                "marketingSignup": {
                    "type": "boolean"
                }
            }
        },
        "currency": {
            "type": "string",
            "default": "GBP",
            "description": "One of currency codes from https://docs.trustpayments.com/document/toolbox/currency-codes/ that is available on the secure trading account",
            "pattern": "^[A-Z]{3}$"
        },
        "localAmount": {
            "type": "integer",
            "description": "Amount pence in selected currency"
        },
        "mode": {
            "enum": [
                "desktop",
                "mobile",
                "sdk"
            ],
            "description": "Whether to use the AliPay desktop, mobile or SDK-based interface"
        }
    }
}
Request example (show)
{
    "order": "/order/1",
    "amount": 1000,
    "billingAddress": {
        "title": "Mr",
        "firstNames": "Test Ing",
        "surname": "Person",
        "address1": "123 Test Street",
        "address2": "Another Street",
        "town": "Test Town",
        "county": "Norfolk",
        "country": "GB",
        "postCode": "TE57 1NG",
        "telephoneNumber": "+79 123-123-123"
    },
    "returnUrl": "http://www.example.org",
    "mode": "mobile"
}
200 application/json
Response schema (show)
{
    "description": "Secure Trading AliPay Payment response",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "required": [
                "links"
            ],
            "properties": {
                "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                        "payment",
                        "redirectUrl"
                    ],
                    "properties": {
                        "payment": {
                            "type": [
                                "string"
                            ],
                            "pattern": "/st-card-payment/[0-9]+"
                        },
                        "redirectUrl": {
                            "description": "A regular full URL",
                            "type": "string"
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "payment": "/st-card-payment/1",
        "redirectUrl": "http://www.example.com/alipay-url"
    },
    "links": {
        "/st-card-payment/1": {
            "amount": 1000,
            "currency": "GBP",
            "status": "Pending",
            "underReview": false,
            "fraudChecked": true,
            "3dSecureEnabled": true,
            "pan": null,
            "cardType": null,
            "expiryDate": null,
            "created": "2017-06-25T14:00:00+00:00",
            "updated": "2017-06-25T14:05:00+00:00"
        }
    }
}

POST /st-alipay-payment/auth

Request schema (show)
{
    "description": "AliPay auth request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "authReference",
        "verifyString"
    ],
    "properties": {
        "authReference": {
            "type": "string",
            "description": "Payment reference number"
        },
        "verifyString": {
            "type": "string",
            "description": "Verify string received from AliPay"
        }
    }
}
Request example (show)
{
    "authReference": "59-85-350",
    "verifyString": "1234567890"
}
200 application/json
Response schema (show)
{
    "description": "AliPay auth response",
    "type": "object",
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Response resolved links",
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "success"
}

On Account Payments

Warrant Service allows API users to manage warrant-based payments.

POST /account-warrant

Create a warrant.

Request schema (show)
{
    "description": "Create Warrant Request",
    "type": "object",
    "properties": {
        "order": {
            "type": "string",
            "pattern": "^/order/[0-9]+$"
        },
        "amount": {
            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
            "type": "integer"
        },
        "localAmount": {
            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
            "type": "integer"
        },
        "currency": {
            "description": "ISO-4217 currency code",
            "type": "string",
            "regex": "^[A-Z]{3}$"
        },
        "warrantAccountNumber": {
            "description": "Non-RSP Payment Code / Warrant Account Number",
            "$oneOf": [
                {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                {
                    "type": "null"
                }
            ]
        },
        "warrantNumber": {
            "description": "Non-RSP Payment Type / Warrant Number",
            "$oneOf": [
                {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                {
                    "type": "null"
                }
            ]
        }
    },
    "required": [
        "order",
        "amount",
        "currency"
    ],
    "additionalProperties": true
}
Request example (show)
{
    "order": "/order/123",
    "amount": 1909,
    "currency": "GBP",
    "warrantAccountNumber": "123456",
    "warrantNumber": "1234567"
}
201 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "uri": {
                            "type": "string",
                            "pattern": "^/account-warrant/[0-9]+$"
                        }
                    },
                    "required": [
                        "uri"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/account-warrant/123"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "Response with error",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        },
        {
            "required": [
                "code",
                "data"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /account-warrant/{id}

Read a warrant.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "status": {
                            "description": "Warrant status description",
                            "type": "string"
                        },
                        "order": {
                            "type": "string",
                            "pattern": "^/order/[0-9]+$"
                        },
                        "amount": {
                            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
                            "type": "integer"
                        },
                        "localAmount": {
                            "$oneOf": [
                                {
                                    "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "currency": {
                            "description": "ISO-4217 currency code",
                            "type": "string",
                            "regex": "^[A-Z]{3}$"
                        },
                        "warrantAccountNumber": {
                            "description": "Non-RSP Payment Code / Warrant Account Number",
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "warrantNumber": {
                            "description": "Non-RSP Payment Type / Warrant Number",
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "updated": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        }
                    },
                    "required": [
                        "status",
                        "order",
                        "amount",
                        "localAmount",
                        "currency",
                        "warrantAccountNumber",
                        "warrantNumber",
                        "created",
                        "updated"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "status": "Authorized",
        "order": "/order/123",
        "amount": 1909,
        "localAmount": null,
        "currency": "GBP",
        "warrantAccountNumber": 123456,
        "warrantNumber": 123456,
        "created": "2018-01-08T12:34:56+0100",
        "updated": "2018-01-08T12:34:56+0100"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /warrant

Create a warrant.

Request schema (show)
{
    "description": "Create Warrant Request",
    "type": "object",
    "properties": {
        "order": {
            "type": "string",
            "pattern": "^/order/[0-9]+$"
        },
        "amount": {
            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
            "type": "integer"
        },
        "localAmount": {
            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
            "type": "integer"
        },
        "currency": {
            "description": "ISO-4217 currency code",
            "type": "string",
            "regex": "^[A-Z]{3}$"
        },
        "warrantAccountNumber": {
            "description": "Non-RSP Payment Code / Warrant Account Number",
            "$oneOf": [
                {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                {
                    "type": "null"
                }
            ]
        },
        "warrantNumber": {
            "description": "Non-RSP Payment Type / Warrant Number",
            "$oneOf": [
                {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                {
                    "type": "null"
                }
            ]
        }
    },
    "required": [
        "order",
        "amount",
        "currency"
    ],
    "additionalProperties": true
}
Request example (show)
{
    "order": "/order/123",
    "amount": 1909,
    "currency": "GBP",
    "warrantAccountNumber": "123456",
    "warrantNumber": "1234567"
}
201 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "uri": {
                            "type": "string",
                            "pattern": "^/account-warrant/[0-9]+$"
                        }
                    },
                    "required": [
                        "uri"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/account-warrant/123"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "Response with error",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        },
        {
            "required": [
                "code",
                "data"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /warrant/{id}

Read a warrant.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "status": {
                            "description": "Warrant status description",
                            "type": "string"
                        },
                        "order": {
                            "type": "string",
                            "pattern": "^/order/[0-9]+$"
                        },
                        "amount": {
                            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
                            "type": "integer"
                        },
                        "localAmount": {
                            "$oneOf": [
                                {
                                    "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "currency": {
                            "description": "ISO-4217 currency code",
                            "type": "string",
                            "regex": "^[A-Z]{3}$"
                        },
                        "warrantAccountNumber": {
                            "description": "Non-RSP Payment Code / Warrant Account Number",
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "warrantNumber": {
                            "description": "Non-RSP Payment Type / Warrant Number",
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "updated": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        }
                    },
                    "required": [
                        "status",
                        "order",
                        "amount",
                        "localAmount",
                        "currency",
                        "warrantAccountNumber",
                        "warrantNumber",
                        "created",
                        "updated"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "status": "Authorized",
        "order": "/order/123",
        "amount": 1909,
        "localAmount": null,
        "currency": "GBP",
        "warrantAccountNumber": 123456,
        "warrantNumber": 123456,
        "created": "2018-01-08T12:34:56+0100",
        "updated": "2018-01-08T12:34:56+0100"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /voucher

Create a warrant

Request schema (show)
{
    "description": "Create Warrant Request",
    "type": "object",
    "properties": {
        "order": {
            "type": "string",
            "pattern": "^/order/[0-9]+$"
        },
        "amount": {
            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
            "type": "integer"
        },
        "localAmount": {
            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
            "type": "integer"
        },
        "currency": {
            "description": "ISO-4217 currency code",
            "type": "string",
            "regex": "^[A-Z]{3}$"
        },
        "accountNumber": {
            "description": "Non-RSP Payment Code / Warrant Account Number",
            "$oneOf": [
                {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                {
                    "type": "null"
                }
            ]
        },
        "number": {
            "description": "Non-RSP Payment Type / Warrant Number",
            "$oneOf": [
                {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                {
                    "type": "null"
                }
            ]
        }
    },
    "required": [
        "order",
        "amount",
        "currency"
    ],
    "additionalProperties": false
}
Request example (show)
{
    "order": "/order/123",
    "amount": 1909,
    "currency": "GBP",
    "accountNumber": "123456",
    "number": "1234567"
}
201 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "uri": {
                            "type": "string",
                            "pattern": "^/voucher/[0-9]+$"
                        }
                    },
                    "required": [
                        "uri"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/voucher/123"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "Response with error",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        },
        {
            "required": [
                "code",
                "data"
            ]
        }
    ]
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /voucher/{id}

Read a warrant.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "status": {
                            "description": "Warrant status description",
                            "type": "string"
                        },
                        "order": {
                            "type": "string",
                            "pattern": "^/order/[0-9]+$"
                        },
                        "amount": {
                            "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
                            "type": "integer"
                        },
                        "localAmount": {
                            "$oneOf": [
                                {
                                    "description": "Amount of the smallest units of a currency (i.e. cents, pence)",
                                    "type": "integer"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "currency": {
                            "description": "ISO-4217 currency code",
                            "type": "string",
                            "regex": "^[A-Z]{3}$"
                        },
                        "accountNumber": {
                            "description": "Non-RSP Payment Code / Warrant Account Number",
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "number": {
                            "description": "Non-RSP Payment Type / Warrant Number",
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "updated": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        }
                    },
                    "required": [
                        "status",
                        "order",
                        "amount",
                        "localAmount",
                        "currency",
                        "accountNumber",
                        "number",
                        "created",
                        "updated"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "status": "Authorized",
        "order": "/order/123",
        "amount": 1909,
        "localAmount": null,
        "currency": "GBP",
        "accountNumber": 123456,
        "number": 123456,
        "created": "2018-01-08T12:34:56+0100",
        "updated": "2018-01-08T12:34:56+0100"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

GET /voucher-token

Read a user's voucher tokens for the given tenant.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "description": "Voucher token URI"
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "/voucher-token/2",
        "/voucher-token/3",
        "/voucher-token/4",
        "/voucher-token/5",
        "/voucher-token/6",
        "/voucher-token/7",
        "/voucher-token/8",
        "/voucher-token/9",
        "/voucher-token/10",
        "/voucher-token/11",
        "/voucher-token/12",
        "/voucher-token/13",
        "/voucher-token/14",
        "/voucher-token/15",
        "/voucher-token/16",
        "/voucher-token/17",
        "/voucher-token/18",
        "/voucher-token/19",
        "/voucher-token/20",
        "/voucher-token/21",
        "/voucher-token/22",
        "/voucher-token/23"
    ],
    "links": []
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

POST /voucher-token

Adds new voucher token

Request schema (show)
{
    "description": "Create Voucher Token Request",
    "type": "object",
    "properties": {
        "order": {
            "type": "string",
            "pattern": "^/order/[0-9]+$"
        },
        "customer": {
            "type": "string",
            "pattern": "^/user/[0-9]+$"
        },
        "tenant": {
            "type": "string"
        },
        "type": {
            "type": "string"
        },
        "start": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "expiry": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        }
    },
    "required": [],
    "additionalProperties": false
}
Request example (show)
{
    "tenant": "sleeper",
    "customer": "/user/123",
    "order": "/order/123",
    "start": "2020-05-16",
    "expiry": "2020-05-17",
    "type": "FPZ"
}
200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "required": [
                        "type",
                        "starts",
                        "expires",
                        "voucher",
                        "used",
                        "created",
                        "updated"
                    ],
                    "properties": {
                        "type": {
                            "type": "string",
                            "pattern": "^/voucher-token-type/[0-9]+$"
                        },
                        "starts": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "expires": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "voucher": {
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/voucher/[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "used": {
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "updated": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "sourceOrderId": {
                            "type": "string"
                        }
                    },
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "/voucher-token-type/1",
        "starts": "2019-07-25T12:34:56+0000",
        "expires": "2020-07-25T12:34:56+0000",
        "voucher": null,
        "used": null,
        "created": "2019-07-25T12:34:56+0000",
        "updated": "2019-07-25T12:34:56+0000"
    },
    "links": []
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /voucher-token/{id}

Read a user's voucher token.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "required": [
                        "type",
                        "starts",
                        "expires",
                        "voucher",
                        "used",
                        "created",
                        "updated"
                    ],
                    "properties": {
                        "type": {
                            "type": "string",
                            "pattern": "^/voucher-token-type/[0-9]+$"
                        },
                        "starts": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "expires": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "voucher": {
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/voucher/[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "used": {
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "updated": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "sourceOrderId": {
                            "type": "string"
                        }
                    },
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "/voucher-token-type/1",
        "starts": "2019-07-25T12:34:56+0000",
        "expires": "2020-07-25T12:34:56+0000",
        "voucher": null,
        "used": null,
        "created": "2019-07-25T12:34:56+0000",
        "updated": "2019-07-25T12:34:56+0000"
    },
    "links": []
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

PUT /voucher-token/{id}

Modifies existing voucher token

Request schema (show)
{
    "description": "Create Voucher Token Request",
    "type": "object",
    "properties": {
        "order": {
            "type": "string",
            "pattern": "^/order/[0-9]+$"
        },
        "customer": {
            "type": "string",
            "pattern": "^/user/[0-9]+$"
        },
        "tenant": {
            "type": "string"
        },
        "type": {
            "type": "string"
        },
        "start": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        },
        "expiry": {
            "type": "string",
            "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
        }
    },
    "required": [],
    "additionalProperties": false
}
Request example (show)
{
    "tenant": "sleeper",
    "customer": "/user/123",
    "order": "/order/123",
    "start": "2020-05-16",
    "expiry": "2020-05-17",
    "type": "FPZ"
}
200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "required": [
                        "type",
                        "starts",
                        "expires",
                        "voucher",
                        "used",
                        "created",
                        "updated"
                    ],
                    "properties": {
                        "type": {
                            "type": "string",
                            "pattern": "^/voucher-token-type/[0-9]+$"
                        },
                        "starts": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "expires": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "voucher": {
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^/voucher/[0-9]+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "used": {
                            "$oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "updated": {
                            "type": "string",
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{4}$"
                        },
                        "sourceOrderId": {
                            "type": "string"
                        }
                    },
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "type": "/voucher-token-type/1",
        "starts": "2019-07-25T12:34:56+0000",
        "expires": "2020-07-25T12:34:56+0000",
        "voucher": null,
        "used": null,
        "created": "2019-07-25T12:34:56+0000",
        "updated": "2019-07-25T12:34:56+0000"
    },
    "links": []
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /voucher-token-type/{id}

Describes a voucher token type.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "requires": {
                            "type": "object"
                        },
                        "source": {
                            "type": "string"
                        }
                    },
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "requires": {
            "ticket-type": [
                "1S8",
                "1S9",
                "1S0",
                "1S1",
                "1S2",
                "1S3",
                "1S4",
                "1F8",
                "1F9",
                "1F0",
                "1F1",
                "1F2",
                "1F3",
                "1F4"
            ]
        },
        "source": "/ticket-type/FPZ"
    },
    "links": []
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /voucher-tokens-for-order/{id}

Get a list of tokens an order would be paid for, or error if it can't.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "description": "Voucher token URI"
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "/voucher-token/2",
        "/voucher-token/3",
        "/voucher-token/4",
        "/voucher-token/5",
        "/voucher-token/6",
        "/voucher-token/7",
        "/voucher-token/8",
        "/voucher-token/9",
        "/voucher-token/10",
        "/voucher-token/11",
        "/voucher-token/12",
        "/voucher-token/13",
        "/voucher-token/14",
        "/voucher-token/15",
        "/voucher-token/16",
        "/voucher-token/17",
        "/voucher-token/18",
        "/voucher-token/19",
        "/voucher-token/20",
        "/voucher-token/21",
        "/voucher-token/22",
        "/voucher-token/23"
    ],
    "links": []
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
URI parameters

string id (required)

Pattern: ^\d+$

GET /voucher-tokens-for-customer/{id}

Get a list of all tokens owned by customer, or error if it can't.

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "properties": {
                        "data": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "links": {
                            "type": [
                                "object",
                                "array"
                            ]
                        }
                    },
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "string",
                        "description": "Voucher token URI"
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "/voucher-token/2",
        "/voucher-token/3",
        "/voucher-token/4",
        "/voucher-token/5",
        "/voucher-token/6",
        "/voucher-token/7",
        "/voucher-token/8",
        "/voucher-token/9",
        "/voucher-token/10",
        "/voucher-token/11",
        "/voucher-token/12",
        "/voucher-token/13",
        "/voucher-token/14",
        "/voucher-token/15",
        "/voucher-token/16",
        "/voucher-token/17",
        "/voucher-token/18",
        "/voucher-token/19",
        "/voucher-token/20",
        "/voucher-token/21",
        "/voucher-token/22",
        "/voucher-token/23"
    ],
    "links": []
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}
500 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

eTickets

URI parameters

string id (required)

Pattern: ^\d+$

GET /order/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "status": {
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        }
                    },
                    "required": [
                        "status"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "status": "success"
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "allOf": [
        {
            "description": "A standard JSON response",
            "type": "object",
            "required": [
                "status"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "fail",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "code": {
                    "description": "Response error code",
                    "type": "string"
                },
                "message": {
                    "description": "Response error message",
                    "type": "string"
                }
            }
        },
        {
            "required": [
                "message"
            ]
        }
    ]
}

GET /order/{id}/data

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Response with data",
            "allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "googlePass": {
                            "type": "string"
                        },
                        "e-tickets": {
                            "type": "array",
                            "minItems": 1,
                            "items": {
                                "properties": {
                                    "uri": {
                                        "type": "string",
                                        "pattern": "^\\/ticket\\/[0-9]+$"
                                    },
                                    "pdfList": {
                                        "type": "array"
                                    },
                                    "pkpassList": {
                                        "type": "array"
                                    },
                                    "googlePassList": {
                                        "type": "array"
                                    }
                                },
                                "required": [
                                    "uri",
                                    "pdfList",
                                    "pkpassList"
                                ],
                                "additionalProperties": false
                            }
                        }
                    },
                    "required": [
                        "e-tickets"
                    ],
                    "additionalProperties": false
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "googlePass": "https://pay.google.com/gp/v/save/jwt.token",
        "e-tickets": [
            {
                "uri": "/ticket/1",
                "pdfList": [
                    "base64encoded-content"
                ],
                "pkpassList": [
                    "base64encoded-content"
                ],
                "googlePassList": [
                    "https://pay.google.com/gp/v/save/jwt.token"
                ]
            }
        ]
    }
}

Refunds

Refunds

Refunds must be performed after a ticket has been fulfilled. As such it is expected that client checks the fulfilment status of the relevant tickets using the /fulfilment/order/{id} endpoint.

The following processes take place as part of the refund process:

Restrictions

All /refund/ endpoints are restricted by IP.

POST /refund

Start new refund process

Request schema (show)
{
    "description": "Admin refund request",
    "type": "object",
    "additionalProperties": false,
    "required": [
        "order",
        "agent",
        "reason",
        "adminFee",
        "products"
    ],
    "properties": {
        "order": {
            "type": [
                "string"
            ],
            "pattern": "/order/[0-9]+"
        },
        "tarsId": {
            "$oneOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ]
        },
        "agent": {
            "type": [
                "string"
            ],
            "pattern": "/(tbo\\-user|user)/[0-9]+"
        },
        "lennonUserId": {
            "type": [
                "string"
            ],
            "pattern": "[A-Z]{2}[0-9]+"
        },
        "reason": {
            "description": "Numeric reason ID for refunding",
            "$oneOf": [
                {
                    "enum": [
                        1,
                        "1"
                    ],
                    "description": "SEASON TICKET LEFT AT HOME"
                },
                {
                    "enum": [
                        2,
                        "2"
                    ],
                    "description": "WAITING FOR DUPLICATE"
                },
                {
                    "enum": [
                        3,
                        "3"
                    ],
                    "description": "SERVICE DISRUPTIONS AND CANCELLATIONS"
                },
                {
                    "enum": [
                        4,
                        "4"
                    ],
                    "description": "NO FIRST CLASS ACCOMMODATION"
                },
                {
                    "enum": [
                        5,
                        "5"
                    ],
                    "description": "NO SEAT RESERVATIONS"
                },
                {
                    "enum": [
                        6,
                        "6"
                    ],
                    "description": "FULL TICKET NOT REQUIRED"
                },
                {
                    "enum": [
                        7,
                        "7"
                    ],
                    "description": "PART TICKET NOT REQUIRED"
                },
                {
                    "enum": [
                        8,
                        "8"
                    ],
                    "description": "NOTIONAL REFUND"
                },
                {
                    "enum": [
                        9,
                        "9"
                    ],
                    "description": "OTHER"
                },
                {
                    "enum": [
                        10,
                        "10"
                    ],
                    "description": "FULFILMENT FAILURE"
                },
                {
                    "enum": [
                        11,
                        "11"
                    ],
                    "description": "SAME DAY VOID"
                },
                {
                    "enum": [
                        12,
                        "12"
                    ],
                    "description": "TOC GUARANTEED REFUNDS"
                }
            ]
        },
        "note": {
            "type": "string"
        },
        "adminFee": {
            "type": "integer"
        },
        "products": {
            "type": "array",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "product"
                ],
                "properties": {
                    "product": {
                        "$oneOf": [
                            {
                                "type": [
                                    "string"
                                ],
                                "pattern": "/ticket/[0-9]+"
                            },
                            {
                                "type": [
                                    "string"
                                ],
                                "pattern": "/sundry/[0-9]+"
                            },
                            {
                                "type": [
                                    "string"
                                ],
                                "pattern": "/supplement/[0-9]+"
                            }
                        ]
                    },
                    "refundAmount": {
                        "description": "Price of products SHOULD NOT be decreased by admin fee. Ie. You have ticket for 1000, and admin fee is 200 - set this field to 1000 and 'adminFee' to 200. Refunded amount will be 800.",
                        "type": "integer"
                    }
                }
            }
        },
        "payments": {
            "type": "array",
            "description": "This parameter can be omit if there were only one payment. In that case there is no doubt which payment should be refunded. In case of multiple payments for refunded order, this property is required.",
            "items": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                    "payment",
                    "refundAmount"
                ],
                "properties": {
                    "payment": {
                        "$oneOf": [
                            {
                                "type": "string",
                                "pattern": "/st-card-payment/\\d+"
                            },
                            {
                                "type": "string",
                                "pattern": "/card-payment/\\d+"
                            },
                            {
                                "type": "string",
                                "pattern": "/paypal/\\d+"
                            },
                            {
                                "type": "string",
                                "pattern": "/warrant-payment/\\d+"
                            }
                        ]
                    },
                    "refundAmount": {
                        "type": "integer",
                        "description": "Amount of money to refund. Always expressed in GBP currency. This value SHOULD be decreased by admin fee. This value is amount which will be refunded (without any additional calculations)."
                    },
                    "refundLocalAmount": {
                        "type": "integer",
                        "description": "If payment was made in currency other ten GBP, this property should define how much foreign currency should be returned. If payment was made in foreign currency and this property is missing, validation error will be returned. If payment was in GBP and this property was declared, it will be omit"
                    }
                }
            }
        }
    }
}
Request example (show)
{
    "order": "/order/215",
    "agent": "/user/234567",
    "tarsId": "123456",
    "lennonUserId": "OH0001",
    "reason": 7,
    "note": "This is a note",
    "adminFee": 1050,
    "atocFee": 0,
    "products": [
        {
            "product": "/ticket/345",
            "refundAmount": 1800
        },
        {
            "product": "/sundry/4567",
            "refundAmount": 500
        }
    ],
    "payments": [
        {
            "payment": "/st-card-payment/123",
            "refundAmount": 1000,
            "refundLocalAmount": 1200
        },
        {
            "payment": "/warrant-payment/456",
            "refundAmount": 1300
        }
    ]
}
200 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with data",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "refunds": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "order": {
                                        "type": [
                                            "string"
                                        ],
                                        "pattern": "/order/[0-9]+"
                                    },
                                    "orderId": {
                                        "description": "This field is deprecated and should not be used by API clients",
                                        "type": "string"
                                    },
                                    "refund": {
                                        "type": [
                                            "string"
                                        ],
                                        "pattern": "/refund/[0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12}"
                                    },
                                    "refundId": {
                                        "description": "This field is deprecated and should not be used by API clients",
                                        "type": [
                                            "string"
                                        ],
                                        "pattern": "[0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12}"
                                    }
                                },
                                "required": [
                                    "order",
                                    "orderId",
                                    "refund",
                                    "refundId"
                                ]
                            }
                        }
                    },
                    "required": [
                        "refunds"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "refunds": [
            {
                "order": "/order/1",
                "orderId": "1",
                "refund": "/refund/cf09b74c-15ed-43b7-9bc9-25c1f789f3bc",
                "refundId": "cf09b74c-15ed-43b7-9bc9-25c1f789f3bc"
            }
        ]
    }
}
400 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with error",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "error",
    "message": "Order with id \"111\" could not be found.",
    "code": "ERR-BAD-REQUEST"
}

GET /refund/{refundId}

Read state of existing refund

200 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with data",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "uuid": {
                            "description": "UUID v4",
                            "type": [
                                "string"
                            ],
                            "pattern": "[0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12}"
                        },
                        "order": {
                            "type": [
                                "string"
                            ],
                            "pattern": "/order/[0-9]+"
                        },
                        "orderId": {
                            "description": "This field is deprecated and should not be used by API clients",
                            "type": [
                                "string",
                                "number"
                            ],
                            "pattern": "[0-9]+"
                        },
                        "state": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "cancelBooking": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "createBooking": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "modifyBooking": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "refundPayment": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "lennonUpdate": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "tvdUpdate": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "coJOrderPaymentState": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "ticketUpdate": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "resetTicket": {
                            "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                            "type": {
                                "enum": [
                                    "Started",
                                    "Successful",
                                    "Failed",
                                    null
                                ]
                            }
                        },
                        "updatedOn": {
                            "description": "Numeric timestamp",
                            "type": [
                                "number"
                            ]
                        }
                    },
                    "required": [
                        "uuid",
                        "order",
                        "orderId",
                        "state",
                        "cancelBooking",
                        "createBooking",
                        "refundPayment",
                        "lennonUpdate",
                        "tvdUpdate",
                        "ticketUpdate",
                        "resetTicket",
                        "updatedOn"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uuid": "97020ad6-6b02-4f2b-b11a-dc0826692fda",
        "order": "/order/1",
        "orderId": "1",
        "state": "Failed",
        "cancelBooking": "Successful",
        "createBooking": "Failed",
        "modifyBooking": null,
        "refundPayment": "Successful",
        "lennonUpdate": null,
        "tvdUpdate": "Successful",
        "coJOrderPaymentState": null,
        "ticketUpdate": "Successful",
        "resetTicket": null,
        "updatedOn": 1464947417,
        "agent": "/tbo-user/1",
        "reason": 1
    }
}
404 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with error",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Refund with id \"12345678\" could not be found."
}

POST /refund/{refundId}/reset

Reset (re-create) state of existing refund

Request schema (show)
{
    "type": "array",
    "items": []
}
Request example (show)
[]
200 application/json
Response schema (show)
{
    "$allOf": [
        {
            "$ref": "../Shared/ResponseWithData.jschema"
        },
        {
            "properties": {
                "data": {
                    "$ref": "../RefundState/RefundState.jschema.jschema"
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uuid": "97020ad6-6b02-4f2b-b11a-dc0826692fda",
        "order": "/order/1",
        "orderId": "1",
        "state": "Failed",
        "cancelBooking": "Successful",
        "createBooking": "Failed",
        "modifyBooking": null,
        "refundPayment": "Successful",
        "lennonUpdate": null,
        "tvdUpdate": "Successful",
        "coJOrderPaymentState": null,
        "ticketUpdate": "Successful",
        "resetTicket": null,
        "updatedOn": 1464947417,
        "agent": "/tbo-user/1",
        "reason": 1
    }
}
404 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with error",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Refund with id \"12345678\" could not be found."
}

GET /refund/order/{orderId}

Read refund information for particular order

Parameters

string agent (required)

Example: /user/1

string impersonate

Allows checking refundability as a specific access level: 'admin', 'manager', 'helpdesk', or 'user'.

Example: user

200 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with data",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "order": {
                            "type": [
                                "string"
                            ],
                            "pattern": "/order/[0-9]+"
                        },
                        "orderId": {
                            "describe": "This field is deprecated and should not be used by API clients",
                            "description": "Order ID",
                            "type": [
                                "string",
                                "number"
                            ],
                            "pattern": "[0-9]+"
                        },
                        "refundType": {
                            "enum": [
                                "PartialRefund",
                                "FullRefund"
                            ]
                        },
                        "products": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "product": {
                                        "$oneOf": [
                                            {
                                                "type": [
                                                    "string"
                                                ],
                                                "pattern": "/ticket/[0-9]+"
                                            },
                                            {
                                                "type": [
                                                    "string"
                                                ],
                                                "pattern": "/sundry/[0-9]+"
                                            }
                                        ]
                                    },
                                    "refundStatus": {
                                        "enum": [
                                            "Refunded",
                                            "Cancelled",
                                            "NonRefundable",
                                            "AutoRefundable",
                                            "TarsRefundable",
                                            "Started",
                                            "Failed",
                                            "Successful"
                                        ]
                                    },
                                    "reason": {
                                        "description": "Refundability reason code, i.e. IS_ALLOWED, TICKET_WAS_SCANNED, ALREADY_REFUNDED",
                                        "type": "string",
                                        "pattern": "[A-Z0-9][A-Z0-9_]+[A-Z0-9]"
                                    },
                                    "reasonText": {
                                        "description": "Textual description of refundability reason.",
                                        "type": "string"
                                    },
                                    "refundableAmount": {
                                        "type": "integer"
                                    },
                                    "refundId": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "isRefundable": {
                                        "type": "boolean"
                                    },
                                    "isChangeable": {
                                        "type": "boolean"
                                    },
                                    "changeState": {
                                        "enum": [
                                            "Changeable",
                                            "NonChangeable",
                                            "Started",
                                            "Failed",
                                            "null"
                                        ]
                                    },
                                    "changeReason": {
                                        "description": "Changeability reason code, i.e. NONE, REFUNDED, NON_ADVANCE",
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "pattern": "[A-Z0-9][A-Z0-9_]+[A-Z0-9]"
                                    },
                                    "changeReasonText": {
                                        "description": "Textual description of changeability reason.",
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "amountForChange": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    }
                                },
                                "required": [
                                    "product",
                                    "refundStatus",
                                    "refundableAmount"
                                ]
                            }
                        },
                        "refunds": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "uuid": {
                                        "description": "UUID v4",
                                        "type": [
                                            "string"
                                        ],
                                        "pattern": "[0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12}"
                                    },
                                    "order": {
                                        "type": [
                                            "string"
                                        ],
                                        "pattern": "/order/[0-9]+"
                                    },
                                    "orderId": {
                                        "description": "This field is deprecated and should not be used by API clients",
                                        "type": [
                                            "string",
                                            "number"
                                        ],
                                        "pattern": "[0-9]+"
                                    },
                                    "state": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "cancelBooking": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "createBooking": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "modifyBooking": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "refundPayment": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "lennonUpdate": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "tvdUpdate": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "coJOrderPaymentState": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "ticketUpdate": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "resetTicket": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "updatedOn": {
                                        "description": "Numeric timestamp",
                                        "type": [
                                            "number"
                                        ]
                                    }
                                },
                                "required": [
                                    "uuid",
                                    "order",
                                    "orderId",
                                    "state",
                                    "cancelBooking",
                                    "createBooking",
                                    "refundPayment",
                                    "lennonUpdate",
                                    "tvdUpdate",
                                    "ticketUpdate",
                                    "resetTicket",
                                    "updatedOn"
                                ]
                            }
                        }
                    },
                    "required": [
                        "order",
                        "orderId",
                        "refundType",
                        "products",
                        "refunds"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "order": "/order/1",
        "orderId": "1",
        "refundType": "PartialRefund",
        "products": [
            {
                "product": "/ticket/1",
                "refundStatus": "AutoRefundable",
                "reason": "IS_ALLOWED",
                "reasonText": "Refunding is allowed",
                "refundAmount": 19000,
                "booking_reference": null,
                "refundId": null,
                "isRefundable": true,
                "isChangeable": true,
                "changeState": "Changeable",
                "changeReason": "NONE",
                "changeReasonText": "No reason",
                "amountForChange": 19000
            },
            {
                "product": "/supplement/1",
                "refundStatus": "AutoRefundable",
                "reason": "IS_ALLOWED",
                "reasonText": "Refunding is allowed",
                "refundAmount": 0,
                "booking_reference": null,
                "refundId": null,
                "isRefundable": true,
                "isChangeable": true,
                "changeState": null,
                "changeReason": null,
                "changeReasonText": null,
                "amountForChange": null
            },
            {
                "product": "/supplement/2",
                "refundStatus": "AutoRefundable",
                "reason": "IS_ALLOWED",
                "reasonText": "Refunding is allowed",
                "refundAmount": 0,
                "booking_reference": null,
                "refundId": null,
                "isRefundable": true,
                "isChangeable": false,
                "changeState": "NonChangeable",
                "changeReason": "NONE",
                "changeReasonText": "No reason",
                "amountForChange": null
            }
        ],
        "refunds": [
            {
                "uuid": "12345678-9abc-def1-2345-6789abcdef12",
                "order": "/order/1",
                "orderId": "1",
                "state": "Successful",
                "cancelBooking": "Successful",
                "createBooking": "Successful",
                "modifyBooking": null,
                "refundPayment": "Successful",
                "lennonUpdate": "Successful",
                "tvdUpdate": null,
                "coJOrderPaymentState": null,
                "ticketUpdate": null,
                "resetTicket": null,
                "updatedOn": 1465359416,
                "agent": "/tbo-user/1",
                "reason": 1
            }
        ]
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with error",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Order \"123\" not found"
}

GET /refund/order/{orderId}/history

Read full history of refund for particular order. Because whole refund engine is based on event source architecure, we can see sequences of commands and events executed for particular order. This endpoint is usefull mostly for debugg/report purposes.

Parameters

string agent (required)

Example: /user/1

200 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with data",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "$allOf": [
                            {
                                "type": "object",
                                "properties": {
                                    "uuid": {
                                        "description": "UUID v4",
                                        "type": [
                                            "string"
                                        ],
                                        "pattern": "[0-9a-f]{8}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{4}\\-[0-9a-f]{12}"
                                    },
                                    "order": {
                                        "type": [
                                            "string"
                                        ],
                                        "pattern": "/order/[0-9]+"
                                    },
                                    "orderId": {
                                        "description": "This field is deprecated and should not be used by API clients",
                                        "type": [
                                            "string",
                                            "number"
                                        ],
                                        "pattern": "[0-9]+"
                                    },
                                    "state": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "cancelBooking": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "createBooking": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "modifyBooking": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "refundPayment": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "lennonUpdate": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "tvdUpdate": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "coJOrderPaymentState": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "ticketUpdate": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "resetTicket": {
                                        "description": "Status of operation progress.'Started' means operation has been started and was not yet finish due to asynchronous nature of refund process.'Successful' means operation has been successfully completed.'Failed' means operation was not completed. Some of failure details can be found under /refund/order/{orderId}/history endpoint.",
                                        "type": {
                                            "enum": [
                                                "Started",
                                                "Successful",
                                                "Failed",
                                                null
                                            ]
                                        }
                                    },
                                    "updatedOn": {
                                        "description": "Numeric timestamp",
                                        "type": [
                                            "number"
                                        ]
                                    }
                                },
                                "required": [
                                    "uuid",
                                    "order",
                                    "orderId",
                                    "state",
                                    "cancelBooking",
                                    "createBooking",
                                    "refundPayment",
                                    "lennonUpdate",
                                    "tvdUpdate",
                                    "ticketUpdate",
                                    "resetTicket",
                                    "updatedOn"
                                ]
                            },
                            {
                                "type": "object",
                                "properties": {
                                    "commands": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string"
                                                },
                                                "isSuccess": {
                                                    "type": "boolean"
                                                },
                                                "loggedOn": {
                                                    "type": "integer"
                                                }
                                            },
                                            "required": [
                                                "type",
                                                "isSuccess",
                                                "loggedOn"
                                            ],
                                            "additionalProperties": true
                                        }
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "type": {
                                                    "type": "string"
                                                }
                                            },
                                            "required": [
                                                "type"
                                            ],
                                            "additionalProperties": true
                                        }
                                    }
                                },
                                "required": [
                                    "commands",
                                    "events"
                                ]
                            }
                        ]
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        {
            "uuid": "007aa348-334e-4d23-beb8-6d5adfdd1678",
            "order": "/order/1",
            "orderId": "1",
            "state": "Successful",
            "cancelBooking": "Successful",
            "createBooking": "Successful",
            "modifyBooking": null,
            "refundPayment": "Successful",
            "lennonUpdate": "Successful",
            "ticketUpdate": "Successful",
            "tvdUpdate": "Successful",
            "coJOrderPaymentState": null,
            "resetTicket": null,
            "updatedOn": 1464947417,
            "agent": "/tbo-user/1",
            "reason": 1,
            "commands": [
                {
                    "type": "StartRefund",
                    "isSuccess": true,
                    "loggedOn": 1468832960,
                    "agent": "/user/1",
                    "reason": 5,
                    "adminFee": 0,
                    "products": [
                        {
                            "product": "/ticket/1",
                            "refundAmount": 17100
                        },
                        {
                            "product": "/sundry/1",
                            "refundAmount": 2000
                        }
                    ]
                }
            ],
            "events": [
                {
                    "type": "RefundStarted",
                    "agent": "/user/1",
                    "reason": 5,
                    "adminFee": 0,
                    "products": [
                        {
                            "product": "/ticket/1",
                            "refundAmount": 17100
                        },
                        {
                            "product": "/sundry/1",
                            "refundAmount": 2000
                        }
                    ],
                    "rebookedTickets": {
                        "2": "male",
                        "3": "child"
                    }
                },
                {
                    "type": "CancelBookingStarted",
                    "bookingReference": "XC315981"
                },
                {
                    "type": "SendingEmailFailed"
                }
            ]
        }
    ]
}
401 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with error",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "error",
    "message": "Agent /user/1 is not authorized to refund order 45",
    "code": "ERR-AUTHORIZATION"
}
404 application/json
Response schema (show)
{
    "$allOf": [
        {
            "description": "Response with error",
            "$allOf": [
                {
                    "description": "A standard JSON response",
                    "type": "object",
                    "required": [
                        "status"
                    ],
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        }
                    }
                },
                {
                    "required": [
                        "message"
                    ]
                }
            ]
        }
    ]
}
Response example (show)
{
    "status": "fail",
    "message": "Order \"123\" not found"
}

Discounts

Discount API

The discount endpoints allow CRUD access to discounts that may be applied during the journey planning process.

Manage discounts

GET /discount

Search discounts.

Parameters

integer limit (required)

Maximum number of results

Example: 10

integer page (required)

Pagination index, 1-based

Example: 1

string routeCode

Route code

Example: 00345

string lennonCode

Lennon code

Example: 1234

string promoCode

Promo code

Example: SUMMER15

string ticketCode

Ticket code

Example: SSJ

string origin

Origin NLC code

Example: 1044

string destination

Destination NLC code

Example: 2101

string travelStartDate

Start of travel availability

Pattern: [0-9]{4}\-[0-9]{2}\-[0-9]{2}

Example: 2015-10-15

string travelEndDate

End of travel availability

Pattern: [0-9]{4}\-[0-9]{2}\-[0-9]{2}

Example: 2015-10-25

string purchaseStartDate

Start of purchase availability

Pattern: [0-9]{4}\-[0-9]{2}\-[0-9]{2}

Example: 2015-10-15

string purchaseEndDate

End of purchase availability

Pattern: [0-9]{4}\-[0-9]{2}\-[0-9]{2}

Example: 2015-10-25

boolean isAppliedWithRailcard (required)

Example: 1

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "allOf": [
                {
                    "type": "object",
                    "description": "A standard JSON response",
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "array",
                                "object"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved links",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    },
                    "required": [
                        "status"
                    ]
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "_page": {
                            "type": "integer",
                            "description": "Actual page"
                        },
                        "_limit": {
                            "type": "integer",
                            "description": "Limit for this pages"
                        },
                        "_pages": {
                            "type": "integer",
                            "description": "Amount of pages with this limit"
                        },
                        "_amount": {
                            "type": "integer",
                            "description": "Amount of all results in storage for this search"
                        },
                        "results": {
                            "type": "array",
                            "items": {
                                "description": "Discount data including id.",
                                "allOf": [
                                    {
                                        "description": "Common discount fields",
                                        "type": "object",
                                        "properties": {
                                            "uri": {
                                                "description": "Record URI.",
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "pattern": "^/discount/[0-9]+$"
                                            },
                                            "userGroupId": {
                                                "description": "Record ID.",
                                                "type": [
                                                    "number",
                                                    "null"
                                                ],
                                                "pattern": "^[0-9]+$"
                                            },
                                            "id": {
                                                "description": "Record ID.",
                                                "type": [
                                                    "number",
                                                    "null"
                                                ],
                                                "pattern": "^[0-9]+$"
                                            },
                                            "routeCode": {
                                                "type": "string",
                                                "minLength": 5,
                                                "maxLength": 5
                                            },
                                            "isAppliedWithRailcard": {
                                                "type": "boolean"
                                            },
                                            "lennonCode": {
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "minLength": 4,
                                                        "maxLength": 4
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "promoCode": {
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "minLength": 4,
                                                        "maxLength": 255
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "ticketCode": {
                                                "oneOf": [
                                                    {
                                                        "description": "A ticket code.",
                                                        "type": "string",
                                                        "maxLength": 4
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "percent": {
                                                "description": "Number of percentage points, between 1 and 100.",
                                                "type": "integer",
                                                "minLength": 1,
                                                "maxLength": 100
                                            },
                                            "tag": {
                                                "oneOf": [
                                                    {
                                                        "description": "A single categorization, like a colour.",
                                                        "type": "string",
                                                        "maxLength": 255
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "origin": {
                                                "description": "Origin NLC code.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "minLength": 4,
                                                        "maxLength": 4
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "destination": {
                                                "description": "Destination NLC code.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "minLength": 4,
                                                        "maxLength": 4
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "origins": {
                                                "description": "Origin NLC codes list which match the discount.",
                                                "oneOf": [
                                                    {
                                                        "type": "array"
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "destinations": {
                                                "description": "Destination NLC codes list which match the discount.",
                                                "oneOf": [
                                                    {
                                                        "type": "array"
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "shortDescription": {
                                                "description": "A short description, a name.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "maxLength": 30
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "longDescription": {
                                                "description": "A long description.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "maxLength": 65535
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "travelStartDate": {
                                                "description": "If specified, discount is valid for travel dates starting with this date.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "travelEndDate": {
                                                "description": "If specified, discount is valid for travel dates before or on this date.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "purchaseStartDate": {
                                                "description": "If specified, discount is valid for purchase dates starting with this date.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "purchaseEndDate": {
                                                "description": "If specified, discount is valid for purchase dates before or on this date.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "toc": {
                                                "description": "If specified, discount is valid for this TOC.",
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "minLength": 2,
                                                        "maxLength": 2
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "channel": {
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "maxLength": 100
                                                    },
                                                    {
                                                        "type": "null"
                                                    }
                                                ]
                                            },
                                            "isEnabled": {
                                                "type": "boolean",
                                                "description": "define whether discount is still enabled or not. Will be 'false' if discount has been deleted."
                                            }
                                        },
                                        "required": [
                                            "ticketCode",
                                            "percent",
                                            "isAppliedWithRailcard",
                                            "origin",
                                            "destination",
                                            "shortDescription",
                                            "longDescription",
                                            "travelStartDate",
                                            "travelEndDate",
                                            "purchaseStartDate",
                                            "purchaseEndDate"
                                        ]
                                    },
                                    {
                                        "required": [
                                            "uri"
                                        ]
                                    }
                                ]
                            },
                            "minItems": 0,
                            "uniqueItems": true
                        }
                    },
                    "required": [
                        "_page",
                        "_limit",
                        "_pages",
                        "_amount",
                        "results"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "_page": 1,
        "_limit": 10,
        "_pages": 1,
        "_amount": 1,
        "results": [
            {
                "uri": "/discount/1",
                "routeCode": "00345",
                "lennonCode": "2345",
                "promoCode": "SUMMER15",
                "ticketCode": "SSK",
                "percent": 10,
                "origin": "1444",
                "destination": "1234",
                "origins": [
                    "1444"
                ],
                "destinations": [
                    "2345"
                ],
                "travelStartDate": "2015-12-01",
                "travelEndDate": "2016-01-01",
                "shortDescription": "Christmas occasion",
                "longDescription": "We have christmas! We are better then Santa! whoop! whoop!",
                "purchaseStartDate": "2015-11-01",
                "purchaseEndDate": "2015-11-30",
                "toc": "AB",
                "isAppliedWithRailcard": true,
                "userGroupId": 123
            }
        ]
    }
}
400 application/json
Response schema (show)
{
    "type": "object",
    "description": "A standard JSON response",
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": "object"
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    },
    "required": [
        "status",
        "message"
    ]
}
Response example (show)
{
    "status": "fail",
    "code": "ERR-VALIDATION",
    "data": {
        "page": "This value should not be blank.",
        "limit": "This value should not be blank."
    },
    "message": "Input validation failed"
}

POST /discount

Create a discount

Request schema (show)
{
    "description": "Adding a discount",
    "allOf": [
        {
            "description": "Common discount fields",
            "type": "object",
            "properties": {
                "uri": {
                    "description": "Record URI.",
                    "type": [
                        "string",
                        "null"
                    ],
                    "pattern": "^/discount/[0-9]+$"
                },
                "userGroupId": {
                    "description": "Record ID.",
                    "type": [
                        "number",
                        "null"
                    ],
                    "pattern": "^[0-9]+$"
                },
                "id": {
                    "description": "Record ID.",
                    "type": [
                        "number",
                        "null"
                    ],
                    "pattern": "^[0-9]+$"
                },
                "routeCode": {
                    "type": "string",
                    "minLength": 5,
                    "maxLength": 5
                },
                "isAppliedWithRailcard": {
                    "type": "boolean"
                },
                "lennonCode": {
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 4,
                            "maxLength": 4
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "promoCode": {
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 4,
                            "maxLength": 255
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "ticketCode": {
                    "oneOf": [
                        {
                            "description": "A ticket code.",
                            "type": "string",
                            "maxLength": 4
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "percent": {
                    "description": "Number of percentage points, between 1 and 100.",
                    "type": "integer",
                    "minLength": 1,
                    "maxLength": 100
                },
                "tag": {
                    "oneOf": [
                        {
                            "description": "A single categorization, like a colour.",
                            "type": "string",
                            "maxLength": 255
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "origin": {
                    "description": "Origin NLC code.",
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 4,
                            "maxLength": 4
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "destination": {
                    "description": "Destination NLC code.",
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 4,
                            "maxLength": 4
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "origins": {
                    "description": "Origin NLC codes list which match the discount.",
                    "oneOf": [
                        {
                            "type": "array"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "destinations": {
                    "description": "Destination NLC codes list which match the discount.",
                    "oneOf": [
                        {
                            "type": "array"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "shortDescription": {
                    "description": "A short description, a name.",
                    "oneOf": [
                        {
                            "type": "string",
                            "maxLength": 30
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "longDescription": {
                    "description": "A long description.",
                    "oneOf": [
                        {
                            "type": "string",
                            "maxLength": 65535
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "travelStartDate": {
                    "description": "If specified, discount is valid for travel dates starting with this date.",
                    "oneOf": [
                        {
                            "type": "string",
                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "travelEndDate": {
                    "description": "If specified, discount is valid for travel dates before or on this date.",
                    "oneOf": [
                        {
                            "type": "string",
                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "purchaseStartDate": {
                    "description": "If specified, discount is valid for purchase dates starting with this date.",
                    "oneOf": [
                        {
                            "type": "string",
                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "purchaseEndDate": {
                    "description": "If specified, discount is valid for purchase dates before or on this date.",
                    "oneOf": [
                        {
                            "type": "string",
                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "toc": {
                    "description": "If specified, discount is valid for this TOC.",
                    "oneOf": [
                        {
                            "type": "string",
                            "minLength": 2,
                            "maxLength": 2
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "channel": {
                    "oneOf": [
                        {
                            "type": "string",
                            "maxLength": 100
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "isEnabled": {
                    "type": "boolean",
                    "description": "define whether discount is still enabled or not. Will be 'false' if discount has been deleted."
                }
            },
            "required": [
                "ticketCode",
                "percent",
                "isAppliedWithRailcard",
                "origin",
                "destination",
                "shortDescription",
                "longDescription",
                "travelStartDate",
                "travelEndDate",
                "purchaseStartDate",
                "purchaseEndDate"
            ]
        }
    ]
}
Request example (show)
{
    "routeCode": "00345",
    "lennonCode": "2345",
    "promoCode": null,
    "ticketCode": null,
    "percent": 12,
    "shortDescription": "A simple discount.",
    "purchaseStartDate": "2015-10-01",
    "purchaseEndDate": "2015-10-31",
    "tag": null,
    "origin": null,
    "destination": null,
    "origins": null,
    "destinations": null,
    "longDescription": null,
    "travelStartDate": null,
    "travelEndDate": null,
    "toc": null,
    "isAppliedWithRailcard": true,
    "userGroupId": 123
}
201 application/json
Response headers

string location

URI pointing to the location of the newly created discount

Pattern: ^/discount/[\d]+$

Example: http://discount-service/discount/123

Response schema (show)
{
    "description": "Get discount data",
    "allOf": [
        {
            "allOf": [
                {
                    "type": "object",
                    "description": "A standard JSON response",
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "array",
                                "object"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved links",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    },
                    "required": [
                        "status"
                    ]
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "description": "Discount data including id.",
                    "allOf": [
                        {
                            "description": "Common discount fields",
                            "type": "object",
                            "properties": {
                                "uri": {
                                    "description": "Record URI.",
                                    "type": [
                                        "string",
                                        "null"
                                    ],
                                    "pattern": "^/discount/[0-9]+$"
                                },
                                "userGroupId": {
                                    "description": "Record ID.",
                                    "type": [
                                        "number",
                                        "null"
                                    ],
                                    "pattern": "^[0-9]+$"
                                },
                                "id": {
                                    "description": "Record ID.",
                                    "type": [
                                        "number",
                                        "null"
                                    ],
                                    "pattern": "^[0-9]+$"
                                },
                                "routeCode": {
                                    "type": "string",
                                    "minLength": 5,
                                    "maxLength": 5
                                },
                                "isAppliedWithRailcard": {
                                    "type": "boolean"
                                },
                                "lennonCode": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "minLength": 4,
                                            "maxLength": 4
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "promoCode": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "minLength": 4,
                                            "maxLength": 255
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "ticketCode": {
                                    "oneOf": [
                                        {
                                            "description": "A ticket code.",
                                            "type": "string",
                                            "maxLength": 4
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "percent": {
                                    "description": "Number of percentage points, between 1 and 100.",
                                    "type": "integer",
                                    "minLength": 1,
                                    "maxLength": 100
                                },
                                "tag": {
                                    "oneOf": [
                                        {
                                            "description": "A single categorization, like a colour.",
                                            "type": "string",
                                            "maxLength": 255
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "origin": {
                                    "description": "Origin NLC code.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "minLength": 4,
                                            "maxLength": 4
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "destination": {
                                    "description": "Destination NLC code.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "minLength": 4,
                                            "maxLength": 4
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "origins": {
                                    "description": "Origin NLC codes list which match the discount.",
                                    "oneOf": [
                                        {
                                            "type": "array"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "destinations": {
                                    "description": "Destination NLC codes list which match the discount.",
                                    "oneOf": [
                                        {
                                            "type": "array"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "shortDescription": {
                                    "description": "A short description, a name.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "maxLength": 30
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "longDescription": {
                                    "description": "A long description.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "maxLength": 65535
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "travelStartDate": {
                                    "description": "If specified, discount is valid for travel dates starting with this date.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "travelEndDate": {
                                    "description": "If specified, discount is valid for travel dates before or on this date.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "purchaseStartDate": {
                                    "description": "If specified, discount is valid for purchase dates starting with this date.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "purchaseEndDate": {
                                    "description": "If specified, discount is valid for purchase dates before or on this date.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "toc": {
                                    "description": "If specified, discount is valid for this TOC.",
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "minLength": 2,
                                            "maxLength": 2
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "channel": {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "maxLength": 100
                                        },
                                        {
                                            "type": "null"
                                        }
                                    ]
                                },
                                "isEnabled": {
                                    "type": "boolean",
                                    "description": "define whether discount is still enabled or not. Will be 'false' if discount has been deleted."
                                }
                            },
                            "required": [
                                "ticketCode",
                                "percent",
                                "isAppliedWithRailcard",
                                "origin",
                                "destination",
                                "shortDescription",
                                "longDescription",
                                "travelStartDate",
                                "travelEndDate",
                                "purchaseStartDate",
                                "purchaseEndDate"
                            ]
                        },
                        {
                            "required": [
                                "uri"
                            ]
                        }
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "uri": "/discount/1",
        "id": 1,
        "routeCode": "00345",
        "lennonCode": "2345",
        "promoCode": null,
        "ticketCode": "ABC",
        "percent": 12,
        "origin": "1444",
        "destination": "1234",
        "origins": [
            "1444"
        ],
        "destinations": [
            "1234"
        ],
        "travelStartDate": "2015-12-01",
        "travelEndDate": "2016-01-01",
        "shortDescription": "Christmas occasion",
        "longDescription": "We have christmas! We are better then Santa! whoop! whoop!",
        "purchaseStartDate": "2015-11-01",
        "purchaseEndDate": "2015-11-30",
        "toc": "AB",
        "isAppliedWithRailcard": true,
        "userGroupId": 123
    }
}
400 application/json
Response schema (show)
{
    "type": "object",
    "description": "A standard JSON response",
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": "object"
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    },
    "required": [
        "status",
        "message"
    ]
}
Response example (show)
{
    "status": "fail",
    "code": "ERR-VALIDATION",
    "data": {
        "routeCode": "This value should have exactly 5 characters.",
        "percent": "Value not defined",
        "lennonCode": "This value should have exactly 4 characters.",
        "promoCode": "This value should be of type string.",
        "ticketCode": "This value should be of type string.",
        "tag": "Value not defined",
        "origin": "Value not defined",
        "destination": "Value not defined",
        "shortDescription": "Value not defined",
        "longDescription": "Value not defined",
        "travelStartDate": "This value is not a valid date.",
        "travelEndDate": "This value is not a valid date.",
        "purchaseStartDate": "This value is not a valid date.",
        "purchaseEndDate": "This value is not a valid date.",
        "toc": "This value should be of type string.",
        "isAppliedWithRailcard": "This value should be of type bool."
    },
    "message": "Input validation failed"
}

GET /discount/match

Match the best discount to the connection.

Parameters

string routeCode (required)

Route code

Example: 00345

string promoCode

Promo code

Example: SUMMER15

string ticketCodes (required)

Comma-separated list of ticket codes

Example: SSJ,SSK,SSL

string origin (required)

Origin NLC code

Example: 1044

string destination (required)

Destination NLC code

Example: 2101

string travelDate (required)

Travel date

Pattern: [0-9]{4}\-[0-9]{2}\-[0-9]{2}

Example: 2015-10-20

string purchaseDate (required)

Purchase date

Pattern: [0-9]{4}\-[0-9]{2}\-[0-9]{2}

Example: 2015-10-20

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "allOf": [
                {
                    "type": "object",
                    "description": "A standard JSON response",
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "array",
                                "object"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved links",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    },
                    "required": [
                        "status"
                    ]
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "patternProperties": {
                        "^.{3,4}$": {
                            "oneOf": [
                                {
                                    "description": "Discount data including id.",
                                    "allOf": [
                                        {
                                            "description": "Common discount fields",
                                            "type": "object",
                                            "properties": {
                                                "uri": {
                                                    "description": "Record URI.",
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "pattern": "^/discount/[0-9]+$"
                                                },
                                                "userGroupId": {
                                                    "description": "Record ID.",
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ],
                                                    "pattern": "^[0-9]+$"
                                                },
                                                "id": {
                                                    "description": "Record ID.",
                                                    "type": [
                                                        "number",
                                                        "null"
                                                    ],
                                                    "pattern": "^[0-9]+$"
                                                },
                                                "routeCode": {
                                                    "type": "string",
                                                    "minLength": 5,
                                                    "maxLength": 5
                                                },
                                                "isAppliedWithRailcard": {
                                                    "type": "boolean"
                                                },
                                                "lennonCode": {
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "minLength": 4,
                                                            "maxLength": 4
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "promoCode": {
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "minLength": 4,
                                                            "maxLength": 255
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "ticketCode": {
                                                    "oneOf": [
                                                        {
                                                            "description": "A ticket code.",
                                                            "type": "string",
                                                            "maxLength": 4
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "percent": {
                                                    "description": "Number of percentage points, between 1 and 100.",
                                                    "type": "integer",
                                                    "minLength": 1,
                                                    "maxLength": 100
                                                },
                                                "tag": {
                                                    "oneOf": [
                                                        {
                                                            "description": "A single categorization, like a colour.",
                                                            "type": "string",
                                                            "maxLength": 255
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "origin": {
                                                    "description": "Origin NLC code.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "minLength": 4,
                                                            "maxLength": 4
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "destination": {
                                                    "description": "Destination NLC code.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "minLength": 4,
                                                            "maxLength": 4
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "origins": {
                                                    "description": "Origin NLC codes list which match the discount.",
                                                    "oneOf": [
                                                        {
                                                            "type": "array"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "destinations": {
                                                    "description": "Destination NLC codes list which match the discount.",
                                                    "oneOf": [
                                                        {
                                                            "type": "array"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "shortDescription": {
                                                    "description": "A short description, a name.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "maxLength": 30
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "longDescription": {
                                                    "description": "A long description.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "maxLength": 65535
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "travelStartDate": {
                                                    "description": "If specified, discount is valid for travel dates starting with this date.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "travelEndDate": {
                                                    "description": "If specified, discount is valid for travel dates before or on this date.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "purchaseStartDate": {
                                                    "description": "If specified, discount is valid for purchase dates starting with this date.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "purchaseEndDate": {
                                                    "description": "If specified, discount is valid for purchase dates before or on this date.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "toc": {
                                                    "description": "If specified, discount is valid for this TOC.",
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "minLength": 2,
                                                            "maxLength": 2
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "channel": {
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "maxLength": 100
                                                        },
                                                        {
                                                            "type": "null"
                                                        }
                                                    ]
                                                },
                                                "isEnabled": {
                                                    "type": "boolean",
                                                    "description": "define whether discount is still enabled or not. Will be 'false' if discount has been deleted."
                                                }
                                            },
                                            "required": [
                                                "ticketCode",
                                                "percent",
                                                "isAppliedWithRailcard",
                                                "origin",
                                                "destination",
                                                "shortDescription",
                                                "longDescription",
                                                "travelStartDate",
                                                "travelEndDate",
                                                "purchaseStartDate",
                                                "purchaseEndDate"
                                            ]
                                        },
                                        {
                                            "required": [
                                                "uri"
                                            ]
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "SSJ": null,
        "SSK": {
            "uri": "/discount/1",
            "routeCode": "00345",
            "lennonCode": "2345",
            "promoCode": "SUMMER15",
            "ticketCode": "SSK",
            "percent": 10,
            "origin": "1444",
            "destination": "2345",
            "origins": [
                "1444"
            ],
            "destinations": [
                "2345"
            ],
            "travelStartDate": "2015-12-01",
            "travelEndDate": "2016-01-01",
            "shortDescription": "Christmas occasion",
            "longDescription": "We have christmas! We are better then Santa! whoop! whoop!",
            "purchaseStartDate": "2015-11-01",
            "purchaseEndDate": "2015-11-30",
            "toc": "AB",
            "isAppliedWithRailcard": true,
            "userGroupId": 123
        },
        "SSL": {
            "uri": "/discount/1",
            "routeCode": "00345",
            "lennonCode": "2345",
            "promoCode": "SUMMER15",
            "ticketCode": "SSK",
            "percent": 10,
            "origin": "1444",
            "destination": "2345",
            "origins": [
                "1444"
            ],
            "destinations": [
                "2345"
            ],
            "travelStartDate": "2015-12-01",
            "travelEndDate": "2016-01-01",
            "shortDescription": "Christmas occasion",
            "longDescription": "We have christmas! We are better then Santa! whoop! whoop!",
            "purchaseStartDate": "2015-11-01",
            "purchaseEndDate": "2015-11-30",
            "toc": "AB",
            "isAppliedWithRailcard": false,
            "userGroupId": 123
        }
    }
}
400 application/json
Response schema (show)
{
    "type": "object",
    "description": "A standard JSON response",
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": "object"
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    },
    "required": [
        "status",
        "message"
    ]
}
Response example (show)
{
    "status": "fail",
    "code": "ERR-VALIDATION",
    "data": {
        "routeCode": "This value should not be blank.",
        "origin": "This value should not be blank.",
        "destination": "This value should not be blank.",
        "travelDate": "This value should not be blank.",
        "purchaseDate": "This value should not be blank."
    },
    "message": "Input validation failed"
}

Manage many discounts at once

POST /discounts

Upload bulk discount

Request schema (show)
{
    "description": "Adding group of discounts",
    "type": "array",
    "items": {
        "allOf": [
            {
                "description": "Common discount fields",
                "type": "object",
                "properties": {
                    "uri": {
                        "description": "Record URI.",
                        "type": [
                            "string",
                            "null"
                        ],
                        "pattern": "^/discount/[0-9]+$"
                    },
                    "userGroupId": {
                        "description": "Record ID.",
                        "type": [
                            "number",
                            "null"
                        ],
                        "pattern": "^[0-9]+$"
                    },
                    "id": {
                        "description": "Record ID.",
                        "type": [
                            "number",
                            "null"
                        ],
                        "pattern": "^[0-9]+$"
                    },
                    "routeCode": {
                        "type": "string",
                        "minLength": 5,
                        "maxLength": 5
                    },
                    "isAppliedWithRailcard": {
                        "type": "boolean"
                    },
                    "lennonCode": {
                        "oneOf": [
                            {
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 4
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "promoCode": {
                        "oneOf": [
                            {
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 255
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "ticketCode": {
                        "oneOf": [
                            {
                                "description": "A ticket code.",
                                "type": "string",
                                "maxLength": 4
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "percent": {
                        "description": "Number of percentage points, between 1 and 100.",
                        "type": "integer",
                        "minLength": 1,
                        "maxLength": 100
                    },
                    "tag": {
                        "oneOf": [
                            {
                                "description": "A single categorization, like a colour.",
                                "type": "string",
                                "maxLength": 255
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "origin": {
                        "description": "Origin NLC code.",
                        "oneOf": [
                            {
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 4
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "destination": {
                        "description": "Destination NLC code.",
                        "oneOf": [
                            {
                                "type": "string",
                                "minLength": 4,
                                "maxLength": 4
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "origins": {
                        "description": "Origin NLC codes list which match the discount.",
                        "oneOf": [
                            {
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "destinations": {
                        "description": "Destination NLC codes list which match the discount.",
                        "oneOf": [
                            {
                                "type": "array"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "shortDescription": {
                        "description": "A short description, a name.",
                        "oneOf": [
                            {
                                "type": "string",
                                "maxLength": 30
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "longDescription": {
                        "description": "A long description.",
                        "oneOf": [
                            {
                                "type": "string",
                                "maxLength": 65535
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "travelStartDate": {
                        "description": "If specified, discount is valid for travel dates starting with this date.",
                        "oneOf": [
                            {
                                "type": "string",
                                "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "travelEndDate": {
                        "description": "If specified, discount is valid for travel dates before or on this date.",
                        "oneOf": [
                            {
                                "type": "string",
                                "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "purchaseStartDate": {
                        "description": "If specified, discount is valid for purchase dates starting with this date.",
                        "oneOf": [
                            {
                                "type": "string",
                                "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "purchaseEndDate": {
                        "description": "If specified, discount is valid for purchase dates before or on this date.",
                        "oneOf": [
                            {
                                "type": "string",
                                "pattern": "^[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}$"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "toc": {
                        "description": "If specified, discount is valid for this TOC.",
                        "oneOf": [
                            {
                                "type": "string",
                                "minLength": 2,
                                "maxLength": 2
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "channel": {
                        "oneOf": [
                            {
                                "type": "string",
                                "maxLength": 100
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "isEnabled": {
                        "type": "boolean",
                        "description": "define whether discount is still enabled or not. Will be 'false' if discount has been deleted."
                    }
                },
                "required": [
                    "ticketCode",
                    "percent",
                    "isAppliedWithRailcard",
                    "origin",
                    "destination",
                    "shortDescription",
                    "longDescription",
                    "travelStartDate",
                    "travelEndDate",
                    "purchaseStartDate",
                    "purchaseEndDate"
                ]
            }
        ]
    },
    "minItems": 1,
    "uniqueItems": false
}
Request example (show)
[
    {
        "routeCode": "00345",
        "lennonCode": "2345",
        "promoCode": null,
        "ticketCode": null,
        "percent": 12,
        "shortDescription": "A simple discount.",
        "purchaseStartDate": "2015-10-01",
        "purchaseEndDate": "2015-10-31",
        "tag": null,
        "origin": null,
        "destination": null,
        "longDescription": null,
        "travelStartDate": null,
        "travelEndDate": null,
        "toc": null,
        "isAppliedWithRailcard": true,
        "userGroupId": 123
    },
    {
        "routeCode": "00346",
        "lennonCode": "2346",
        "promoCode": null,
        "ticketCode": null,
        "percent": 12,
        "shortDescription": "A simple discount.",
        "purchaseStartDate": "2015-10-01",
        "purchaseEndDate": "2015-10-31",
        "tag": null,
        "origin": null,
        "destination": null,
        "longDescription": null,
        "travelStartDate": null,
        "travelEndDate": null,
        "toc": null,
        "isAppliedWithRailcard": true,
        "userGroupId": 123
    }
]
201 application/json
Response schema (show)
{
    "description": "Get discounts urls",
    "allOf": [
        {
            "allOf": [
                {
                    "type": "object",
                    "description": "A standard JSON response",
                    "properties": {
                        "status": {
                            "description": "Response status",
                            "enum": [
                                "success",
                                "fail",
                                "error"
                            ]
                        },
                        "data": {
                            "description": "Response data",
                            "type": [
                                "array",
                                "object"
                            ]
                        },
                        "code": {
                            "description": "Response error code",
                            "type": "string"
                        },
                        "message": {
                            "description": "Response error message",
                            "type": "string"
                        },
                        "links": {
                            "description": "Resolved links",
                            "type": [
                                "array",
                                "object"
                            ]
                        }
                    },
                    "required": [
                        "status"
                    ]
                },
                {
                    "required": [
                        "data"
                    ]
                }
            ]
        },
        {
            "properties": {
                "data": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "uri": {
                                "description": "Record URI.",
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "pattern": "^/discount/[0-9]+$"
                            }
                        }
                    }
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        {
            "uri": "/discount/72"
        },
        {
            "uri": null
        }
    ],
    "links": {
        "/discount/72": {
            "routeCode": "78896",
            "lennonCode": "2345",
            "promoCode": null,
            "ticketCode": null,
            "percent": 12,
            "tag": null,
            "origin": null,
            "destination": null,
            "origins": null,
            "destinations": null,
            "shortDescription": "A simple discount.",
            "longDescription": null,
            "travelStartDate": null,
            "travelEndDate": null,
            "purchaseStartDate": "2015-10-01",
            "purchaseEndDate": "2015-10-31",
            "toc": null,
            "isAppliedWithRailcard": true,
            "channel": null,
            "uri": "/discount/72",
            "id": 72,
            "userGroupId": 123
        }
    }
}
400 application/json
Response schema (show)
{
    "type": "object",
    "description": "A standard JSON response",
    "properties": {
        "status": {
            "description": "Response status",
            "enum": [
                "success",
                "fail",
                "error"
            ]
        },
        "data": {
            "description": "Response data",
            "type": "object"
        },
        "code": {
            "description": "Response error code",
            "type": "string"
        },
        "message": {
            "description": "Response error message",
            "type": "string"
        }
    },
    "required": [
        "status",
        "message"
    ]
}
Response example (show)
{
    "status": "fail",
    "code": "ERR-VALIDATION",
    "message": "No correct discounts to save"
}

Customers

CustomerService API

CustomerService performs all operations concerning user or customer (user with orders) and its dependencies like address, cards and facebook account.

Search customers

GET /customer/search

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "description": "Array of customer links",
                    "type": "array"
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": [
        "/customer/13931"
    ],
    "links": {
        "/customer/13931": {
            "id": 13931,
            "title": "Mr",
            "firstNames": "Test",
            "surname": "Behat",
            "email": "test@assertis.co.uk",
            "emailMarketing": true,
            "smsMarketing": true,
            "telephoneNumber": "666999000",
            "created": "2017-08-25T17:10:28+0100",
            "login": "2017-08-28T11:38:57+0100",
            "updated": null,
            "firstPurchase": null,
            "addresses": null,
            "cards": null
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

Get Customer details

GET /customer

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "id": {
                            "type": "number"
                        },
                        "title": {
                            "type": "string"
                        },
                        "firstNames": {
                            "type": "string"
                        },
                        "surname": {
                            "type": "string"
                        },
                        "email": {
                            "type": "email"
                        },
                        "emailMarketing": {
                            "type": "boolean"
                        },
                        "smsMarketing": {
                            "type": "boolean"
                        },
                        "telephoneNumber": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "login": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "updated": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "firstPurchase": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "addresses": {
                            "type": "array",
                            "description": "Empty array for backward compatibility"
                        },
                        "cards": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "nickname": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "reference": {
                                        "type": "string"
                                    },
                                    "cardType": {
                                        "type": "string"
                                    },
                                    "holderName": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "pan": {
                                        "type": "string",
                                        "pattern": "^\\d{6}[#]{6}\\d{4}$"
                                    },
                                    "expiry": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{2}/\\d{4}$"
                                            }
                                        ]
                                    }
                                }
                            }
                        },
                        "typedAddresses": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "business": {
                            "oneOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "number"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "email": {
                                            "type": "string"
                                        },
                                        "address": {
                                            "type": "object",
                                            "properties": {
                                                "address1": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address2": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address3": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "town": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "county": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "postCode": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "telephoneNumber": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "travelPolicy": {
                                                    "type": "object",
                                                    "properties": {
                                                        "isFirstClassAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "maxPricePerTicket": {
                                                            "type": [
                                                                "number",
                                                                "null"
                                                            ]
                                                        },
                                                        "maxDailyAmount": {
                                                            "type": [
                                                                "number",
                                                                "null"
                                                            ]
                                                        },
                                                        "isSeasonAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentOnAccountAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithConfermaAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithOwnCardAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithWarrantAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isSuperUser": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        }
                    },
                    "required": [
                        "id",
                        "title",
                        "firstNames",
                        "surname",
                        "email",
                        "emailMarketing",
                        "smsMarketing",
                        "telephoneNumber",
                        "created",
                        "login",
                        "updated",
                        "firstPurchase",
                        "addresses",
                        "cards"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "id": 13931,
        "title": "Mr",
        "firstNames": "Test",
        "surname": "Behat",
        "email": "test@assertis.co.uk",
        "emailMarketing": true,
        "smsMarketing": true,
        "telephoneNumber": "666999000",
        "created": "2017-08-25T17:10:28+0100",
        "login": "2017-08-28T11:38:57+0100",
        "updated": null,
        "firstPurchase": null,
        "addresses": [],
        "cards": [
            {
                "address": null,
                "nickname": null,
                "reference": "23-23-223234",
                "cardType": "VISA_CREDIT",
                "holderName": "Behat Selenium",
                "pan": "412100######0021",
                "expiry": "04/2017"
            }
        ],
        "typedAddresses": {
            "Delivery": "/address/7756",
            "Billing": "/address/7757"
        },
        "business": {
            "name": "Some company name",
            "email": "boss@example.com",
            "address": {
                "address1": "Addr 1",
                "address2": "Addr 2",
                "address3": null,
                "town": null,
                "postCode": "ECS 43W",
                "county": null,
                "telephoneNumber": ""
            },
            "travelPolicy": {
                "isFirstClassAllowed": false,
                "maxPricePerTicket": 1000,
                "maxDailyAmount": null,
                "isSeasonAllowed": true,
                "isPaymentOnAccountAllowed": true,
                "isPaymentWithConfermaAllowed": false,
                "isPaymentWithOwnCardAllowed": false,
                "isPaymentWithWarrantAllowed": false,
                "isSuperUser": false
            }
        }
    },
    "links": {
        "/address/27847": {
            "title": "",
            "firstNames": "",
            "surname": "",
            "address1": "Avenue 1",
            "address2": "Avenue 2",
            "address3": "Avenue 3",
            "town": "London",
            "county": "County of London",
            "postCode": "EC1",
            "country": "Great Britain",
            "telephoneNumber": null
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

PUT /customer

Create or retrieve customer

Request schema (show)
{
    "type": "object",
    "properties": {
        "title": {
            "type": "string"
        },
        "firstNames": {
            "type": "string"
        },
        "surname": {
            "type": "string"
        },
        "email": {
            "type": "email"
        }
    },
    "required": [
        "title",
        "firstNames",
        "surname",
        "email"
    ]
}
Request example (show)
{
    "title": "Mr",
    "firstNames": "Test",
    "surname": "Behat",
    "email": "test@assertis.co.uk"
}
200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "id": {
                            "type": "number"
                        },
                        "title": {
                            "type": "string"
                        },
                        "firstNames": {
                            "type": "string"
                        },
                        "surname": {
                            "type": "string"
                        },
                        "email": {
                            "type": "email"
                        },
                        "emailMarketing": {
                            "type": "boolean"
                        },
                        "smsMarketing": {
                            "type": "boolean"
                        },
                        "telephoneNumber": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "login": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "updated": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "firstPurchase": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "addresses": {
                            "type": "array",
                            "description": "Empty array for backward compatibility"
                        },
                        "cards": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "nickname": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "reference": {
                                        "type": "string"
                                    },
                                    "cardType": {
                                        "type": "string"
                                    },
                                    "holderName": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "pan": {
                                        "type": "string",
                                        "pattern": "^\\d{6}[#]{6}\\d{4}$"
                                    },
                                    "expiry": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{2}/\\d{4}$"
                                            }
                                        ]
                                    }
                                }
                            }
                        },
                        "typedAddresses": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "business": {
                            "oneOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "number"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "email": {
                                            "type": "string"
                                        },
                                        "address": {
                                            "type": "object",
                                            "properties": {
                                                "address1": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address2": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address3": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "town": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "county": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "postCode": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "telephoneNumber": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "travelPolicy": {
                                                    "type": "object",
                                                    "properties": {
                                                        "isFirstClassAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "maxPricePerTicket": {
                                                            "type": [
                                                                "number",
                                                                "null"
                                                            ]
                                                        },
                                                        "maxDailyAmount": {
                                                            "type": [
                                                                "number",
                                                                "null"
                                                            ]
                                                        },
                                                        "isSeasonAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentOnAccountAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithConfermaAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithOwnCardAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithWarrantAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isSuperUser": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        }
                    },
                    "required": [
                        "id",
                        "title",
                        "firstNames",
                        "surname",
                        "email",
                        "emailMarketing",
                        "smsMarketing",
                        "telephoneNumber",
                        "created",
                        "login",
                        "updated",
                        "firstPurchase",
                        "addresses",
                        "cards"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "id": 13931,
        "title": "Mr",
        "firstNames": "Test",
        "surname": "Behat",
        "email": "test@assertis.co.uk",
        "emailMarketing": true,
        "smsMarketing": true,
        "telephoneNumber": "666999000",
        "created": "2017-08-25T17:10:28+0100",
        "login": "2017-08-28T11:38:57+0100",
        "updated": null,
        "firstPurchase": null,
        "addresses": [],
        "cards": [
            {
                "address": null,
                "nickname": null,
                "reference": "23-23-223234",
                "cardType": "VISA_CREDIT",
                "holderName": "Behat Selenium",
                "pan": "412100######0021",
                "expiry": "04/2017"
            }
        ],
        "typedAddresses": {
            "Delivery": "/address/7756",
            "Billing": "/address/7757"
        },
        "business": {
            "name": "Some company name",
            "email": "boss@example.com",
            "address": {
                "address1": "Addr 1",
                "address2": "Addr 2",
                "address3": null,
                "town": null,
                "postCode": "ECS 43W",
                "county": null,
                "telephoneNumber": ""
            },
            "travelPolicy": {
                "isFirstClassAllowed": false,
                "maxPricePerTicket": 1000,
                "maxDailyAmount": null,
                "isSeasonAllowed": true,
                "isPaymentOnAccountAllowed": true,
                "isPaymentWithConfermaAllowed": false,
                "isPaymentWithOwnCardAllowed": false,
                "isPaymentWithWarrantAllowed": false,
                "isSuperUser": false
            }
        }
    },
    "links": {
        "/address/27847": {
            "title": "",
            "firstNames": "",
            "surname": "",
            "address1": "Avenue 1",
            "address2": "Avenue 2",
            "address3": "Avenue 3",
            "town": "London",
            "county": "County of London",
            "postCode": "EC1",
            "country": "Great Britain",
            "telephoneNumber": null
        }
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /customer/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "id": {
                            "type": "number"
                        },
                        "title": {
                            "type": "string"
                        },
                        "firstNames": {
                            "type": "string"
                        },
                        "surname": {
                            "type": "string"
                        },
                        "email": {
                            "type": "email"
                        },
                        "emailMarketing": {
                            "type": "boolean"
                        },
                        "smsMarketing": {
                            "type": "boolean"
                        },
                        "telephoneNumber": {
                            "oneOf": [
                                {
                                    "type": "string",
                                    "pattern": "^\\d+$"
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "created": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "login": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "updated": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "firstPurchase": {
                            "oneOf": [
                                {
                                    "oneOf": [
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                        },
                                        {
                                            "type": "string",
                                            "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                        }
                                    ]
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        },
                        "addresses": {
                            "type": "array",
                            "description": "Empty array for backward compatibility"
                        },
                        "cards": {
                            "type": "array",
                            "items": {
                                "type": "object",
                                "properties": {
                                    "address": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "nickname": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "reference": {
                                        "type": "string"
                                    },
                                    "cardType": {
                                        "type": "string"
                                    },
                                    "holderName": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "pan": {
                                        "type": "string",
                                        "pattern": "^\\d{6}[#]{6}\\d{4}$"
                                    },
                                    "expiry": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{2}/\\d{4}$"
                                            }
                                        ]
                                    }
                                }
                            }
                        },
                        "typedAddresses": {
                            "type": [
                                "object",
                                "array"
                            ]
                        },
                        "business": {
                            "oneOf": [
                                {
                                    "type": "object",
                                    "properties": {
                                        "id": {
                                            "type": "number"
                                        },
                                        "name": {
                                            "type": "string"
                                        },
                                        "email": {
                                            "type": "string"
                                        },
                                        "address": {
                                            "type": "object",
                                            "properties": {
                                                "address1": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address2": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "address3": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "town": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "county": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "postCode": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "telephoneNumber": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "travelPolicy": {
                                                    "type": "object",
                                                    "properties": {
                                                        "isFirstClassAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "maxPricePerTicket": {
                                                            "type": [
                                                                "number",
                                                                "null"
                                                            ]
                                                        },
                                                        "maxDailyAmount": {
                                                            "type": [
                                                                "number",
                                                                "null"
                                                            ]
                                                        },
                                                        "isSeasonAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentOnAccountAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithConfermaAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithOwnCardAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isPaymentWithWarrantAllowed": {
                                                            "type": "boolean"
                                                        },
                                                        "isSuperUser": {
                                                            "type": "boolean"
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                },
                                {
                                    "type": "null"
                                }
                            ]
                        }
                    },
                    "required": [
                        "id",
                        "title",
                        "firstNames",
                        "surname",
                        "email",
                        "emailMarketing",
                        "smsMarketing",
                        "telephoneNumber",
                        "created",
                        "login",
                        "updated",
                        "firstPurchase",
                        "addresses",
                        "cards"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "id": 13931,
        "title": "Mr",
        "firstNames": "Test",
        "surname": "Behat",
        "email": "test@assertis.co.uk",
        "emailMarketing": true,
        "smsMarketing": true,
        "telephoneNumber": "666999000",
        "created": "2017-08-25T17:10:28+0100",
        "login": "2017-08-28T11:38:57+0100",
        "updated": null,
        "firstPurchase": null,
        "addresses": [],
        "cards": [
            {
                "address": null,
                "nickname": null,
                "reference": "23-23-223234",
                "cardType": "VISA_CREDIT",
                "holderName": "Behat Selenium",
                "pan": "412100######0021",
                "expiry": "04/2017"
            }
        ],
        "typedAddresses": {
            "Delivery": "/address/7756",
            "Billing": "/address/7757"
        },
        "business": {
            "name": "Some company name",
            "email": "boss@example.com",
            "address": {
                "address1": "Addr 1",
                "address2": "Addr 2",
                "address3": null,
                "town": null,
                "postCode": "ECS 43W",
                "county": null,
                "telephoneNumber": ""
            },
            "travelPolicy": {
                "isFirstClassAllowed": false,
                "maxPricePerTicket": 1000,
                "maxDailyAmount": null,
                "isSeasonAllowed": true,
                "isPaymentOnAccountAllowed": true,
                "isPaymentWithConfermaAllowed": false,
                "isPaymentWithOwnCardAllowed": false,
                "isPaymentWithWarrantAllowed": false,
                "isSuperUser": false
            }
        }
    },
    "links": {
        "/address/27847": {
            "title": "",
            "firstNames": "",
            "surname": "",
            "address1": "Avenue 1",
            "address2": "Avenue 2",
            "address3": "Avenue 3",
            "town": "London",
            "county": "County of London",
            "postCode": "EC1",
            "country": "Great Britain",
            "telephoneNumber": null
        }
    }
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /customer/upcoming-journeys

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "meta": {
                            "type": "object",
                            "properties": {
                                "page": {
                                    "type": "integer"
                                },
                                "perPage": {
                                    "type": "integer"
                                },
                                "lastPage": {
                                    "type": "integer"
                                }
                            }
                        },
                        "data": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "pattern": "^/station/[A-Z0-9]+$"
                                    },
                                    "destination": {
                                        "type": "string",
                                        "pattern": "^/station/[A-Z0-9]+$"
                                    },
                                    "departure": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "arrival": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "accommodationType": {
                                        "type": "string"
                                    },
                                    "adults": {
                                        "type": "integer"
                                    },
                                    "children": {
                                        "type": "number"
                                    },
                                    "bikes": {
                                        "type": "integer"
                                    },
                                    "bikesInBag": {
                                        "type": "integer"
                                    },
                                    "leadPassenger": {
                                        "type": "string",
                                        "pattern": "^/passenger/[0-9]+$"
                                    },
                                    "tickets": {
                                        "type": "array"
                                    },
                                    "order": {
                                        "type": "string",
                                        "pattern": "^/order/[0-9]+$"
                                    },
                                    "channel": {
                                        "type": "string"
                                    },
                                    "hash": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "origin",
                                    "destination",
                                    "departure",
                                    "arrival",
                                    "accommodationType",
                                    "adults",
                                    "children",
                                    "bikes",
                                    "bikesInBags",
                                    "pets",
                                    "leadPassenger",
                                    "tickets",
                                    "order",
                                    "channel",
                                    "hash"
                                ]
                            }
                        }
                    }
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "meta": {
            "page": 1,
            "perPage": 10,
            "lastPage": 1
        },
        "data": [
            {
                "origin": "/station/1444",
                "destination": "/station/9328",
                "departure": "2023-01-26T23:50:00+00:00",
                "arrival": "2023-01-27T07:30:00+00:00",
                "accommodationType": "Flexible Caledonian Double Solo",
                "adults": 1,
                "children": 0,
                "bikes": 0,
                "bikesInBags": 0,
                "pets": 0,
                "leadPassenger": "/passenger/99290",
                "tickets": [
                    "/ticket/139403"
                ],
                "order": "/order/11111111",
                "channel": "CSW",
                "hash": "abcdef1234567890abcdef1234567890"
            }
        ]
    },
    "links": {
        "/station/1444": {
            "name": {
                "station": "LONDON EUSTON",
                "location": "LONDON EUSTON",
                "display": "London Euston",
                "print": "London Euston"
            },
            "code": {
                "nlc": "1444",
                "uic": "7014440",
                "crs": "EUS",
                "tiploc": null,
                "atco": null
            },
            "latitude": null,
            "longitude": null,
            "facilities": [
                "TVM",
                "L",
                "LI",
                "LI",
                "LI",
                "G",
                "V"
            ],
            "groups": "/station/1444/groups",
            "members": [],
            "londonTerminals": [],
            "isGoldCardLocation": true,
            "lul": "NNNNNN-169000000000-_-0Y006009S0",
            "zoneNo": "0027",
            "zoneInd": "1 ",
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "1072"
        },
        "/station/9328": {
            "name": {
                "station": "EDINBURGH",
                "location": "EDINBURGH",
                "display": "Edinburgh",
                "print": "Edinburgh"
            },
            "code": {
                "nlc": "9328",
                "uic": "7093280",
                "crs": "EDB",
                "tiploc": null,
                "atco": null
            },
            "latitude": null,
            "longitude": null,
            "facilities": [
                "TVM",
                "BO",
                "L",
                "LI",
                "LI"
            ],
            "groups": "/station/9328/groups",
            "members": [],
            "londonTerminals": "/station/9328/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "9328"
        },
        "/passenger/99290": {
            "title": "Mr",
            "initials": "Andrzej",
            "surname": "Sprzenski",
            "photocardNumber": null
        },
        "/ticket/139403": {
            "fare": "/fare/132202",
            "adults": 1,
            "children": 0,
            "transactionNumber": "18024",
            "reservation": "/reservation/TV452908",
            "utn": "C1DN99WZ39R",
            "outwardValidity": {
                "validFrom": "2023-01-26",
                "validUntil": "2023-01-26"
            },
            "returnValidity": null,
            "outwardPortion": "/journey/149506",
            "returnPortion": null,
            "supplements": [],
            "seats": [
                {
                    "seat": "/seat-reservation/101353",
                    "leg": "/leg/137580",
                    "supplement": "/supplement/120433"
                }
            ],
            "passenger": "/passenger/99290"
        },
        "/fare/132202": {
            "ticketType": "/ticket-type/1D0",
            "origin": "/station/1444",
            "destination": "/station/9328",
            "price": 34500,
            "originalPrice": 34500,
            "railcard": null,
            "restrictionCode": "U7",
            "route": "/route/00346",
            "statusCode": "000",
            "fareSetter": null,
            "xLondon": 0,
            "isPlusBus": false,
            "discount": null,
            "childStatusDescription": null,
            "adultStatusDescription": null,
            "labels": [],
            "assistedCode": null
        },
        "/ticket-type/1D0": {
            "name": {
                "display": "Flexible Caledonian Double Solo",
                "print": "Flexible Caledonian Double Solo",
                "description": "SOLO CAL DOUBLE"
            },
            "ccstFormat": "X12",
            "code": "1D0",
            "validity": "/validity-type/64",
            "isReturn": false,
            "isSeason": false,
            "isAdvance": true,
            "isPackage": false,
            "isCarnet": false,
            "isFirstClass": true,
            "reservationType": "B",
            "maxPassengers": 1,
            "minPassengers": 1,
            "minAdults": 0,
            "maxAdults": 1,
            "minChildren": 0,
            "maxChildren": 1,
            "utsCode": 0,
            "timeRestriction": 0,
            "capriCode": "ESV",
            "canBeRetailed": true,
            "ticketCategory": "advance",
            "reservationSupplement": "/supplement-type/CAU"
        },
        "/validity-type/64": {
            "code": "64",
            "outward": {
                "days": 1,
                "months": 0,
                "break": false,
                "description": "BOOKDTRAINONLY"
            },
            "return": {
                "days": 0,
                "months": 0,
                "break": false,
                "description": "INVALID"
            },
            "returnMustBeAfter": {
                "days": 0,
                "months": 0,
                "dayOfWeek": null
            }
        },
        "/route/00346": {
            "code": "00346",
            "name": {
                "description": "CAL SLEEPER.",
                "aaaDescription": null,
                "print": "Valid on Caledonian Sleeper only",
                "display": "Valid only on the Caledonian Sleeper service."
            },
            "included": [],
            "excluded": [],
            "lul": "NNNNNN-000000000000-_"
        },
        "/seat-reservation/101353": {
            "coach": "B",
            "seat": "05R",
            "leg": "/leg/137580",
            "supplement": "/supplement/120433",
            "reservation": "/reservation/TV452908"
        },
        "/supplement/120433": {
            "type": "/supplement-type/CAU",
            "transactionNumber": "18025",
            "price": 0,
            "isBerth": true
        }
    }
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /customer/past-journeys

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "meta": {
                            "type": "object",
                            "properties": {
                                "page": {
                                    "type": "integer"
                                },
                                "perPage": {
                                    "type": "integer"
                                },
                                "lastPage": {
                                    "type": "integer"
                                }
                            }
                        },
                        "data": {
                            "type": "array",
                            "items": {
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "pattern": "^/station/[A-Z0-9]+$"
                                    },
                                    "destination": {
                                        "type": "string",
                                        "pattern": "^/station/[A-Z0-9]+$"
                                    },
                                    "departure": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "arrival": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}:\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\+\\d{2}\\d{2}$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"
                                            },
                                            {
                                                "type": "string",
                                                "pattern": "^\\d{4}\\d{2}\\d{2}T\\d{2}\\d{2}\\d{2}Z$"
                                            }
                                        ]
                                    },
                                    "accommodationType": {
                                        "type": "string"
                                    },
                                    "adults": {
                                        "type": "integer"
                                    },
                                    "children": {
                                        "type": "number"
                                    },
                                    "bikes": {
                                        "type": "integer"
                                    },
                                    "bikesInBag": {
                                        "type": "integer"
                                    },
                                    "leadPassenger": {
                                        "type": "string",
                                        "pattern": "^/passenger/[0-9]+$"
                                    },
                                    "tickets": {
                                        "type": "array"
                                    },
                                    "order": {
                                        "type": "string",
                                        "pattern": "^/order/[0-9]+$"
                                    },
                                    "channel": {
                                        "type": "string"
                                    },
                                    "hash": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "origin",
                                    "destination",
                                    "departure",
                                    "arrival",
                                    "accommodationType",
                                    "adults",
                                    "children",
                                    "bikes",
                                    "bikesInBags",
                                    "pets",
                                    "leadPassenger",
                                    "tickets",
                                    "order",
                                    "channel",
                                    "hash"
                                ]
                            }
                        }
                    }
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "meta": {
            "page": 1,
            "perPage": 10,
            "lastPage": 1
        },
        "data": [
            {
                "origin": "/station/1444",
                "destination": "/station/9328",
                "departure": "2023-01-26T23:50:00+00:00",
                "arrival": "2023-01-27T07:30:00+00:00",
                "accommodationType": "Flexible Caledonian Double Solo",
                "adults": 1,
                "children": 0,
                "bikes": 0,
                "bikesInBags": 0,
                "pets": 0,
                "leadPassenger": "/passenger/99290",
                "tickets": [
                    "/ticket/139403"
                ],
                "order": "/order/11111111",
                "channel": "CSW",
                "hash": "abcdef1234567890abcdef1234567890"
            }
        ]
    },
    "links": {
        "/station/1444": {
            "name": {
                "station": "LONDON EUSTON",
                "location": "LONDON EUSTON",
                "display": "London Euston",
                "print": "London Euston"
            },
            "code": {
                "nlc": "1444",
                "uic": "7014440",
                "crs": "EUS",
                "tiploc": null,
                "atco": null
            },
            "latitude": null,
            "longitude": null,
            "facilities": [
                "TVM",
                "L",
                "LI",
                "LI",
                "LI",
                "G",
                "V"
            ],
            "groups": "/station/1444/groups",
            "members": [],
            "londonTerminals": [],
            "isGoldCardLocation": true,
            "lul": "NNNNNN-169000000000-_-0Y006009S0",
            "zoneNo": "0027",
            "zoneInd": "1 ",
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "1072"
        },
        "/station/9328": {
            "name": {
                "station": "EDINBURGH",
                "location": "EDINBURGH",
                "display": "Edinburgh",
                "print": "Edinburgh"
            },
            "code": {
                "nlc": "9328",
                "uic": "7093280",
                "crs": "EDB",
                "tiploc": null,
                "atco": null
            },
            "latitude": null,
            "longitude": null,
            "facilities": [
                "TVM",
                "BO",
                "L",
                "LI",
                "LI"
            ],
            "groups": "/station/9328/groups",
            "members": [],
            "londonTerminals": "/station/9328/london-terminals",
            "isGoldCardLocation": false,
            "lul": "NNNNNN-000000000000-_-0N009006S0",
            "zoneNo": null,
            "zoneInd": null,
            "locIdTypes": [
                "S"
            ],
            "fareGroup": "9328"
        },
        "/passenger/99290": {
            "title": "Mr",
            "initials": "Andrzej",
            "surname": "Sprzenski",
            "photocardNumber": null
        },
        "/ticket/139403": {
            "fare": "/fare/132202",
            "adults": 1,
            "children": 0,
            "transactionNumber": "18024",
            "reservation": "/reservation/TV452908",
            "utn": "C1DN99WZ39R",
            "outwardValidity": {
                "validFrom": "2023-01-26",
                "validUntil": "2023-01-26"
            },
            "returnValidity": null,
            "outwardPortion": "/journey/149506",
            "returnPortion": null,
            "supplements": [],
            "seats": [
                {
                    "seat": "/seat-reservation/101353",
                    "leg": "/leg/137580",
                    "supplement": "/supplement/120433"
                }
            ],
            "passenger": "/passenger/99290"
        },
        "/fare/132202": {
            "ticketType": "/ticket-type/1D0",
            "origin": "/station/1444",
            "destination": "/station/9328",
            "price": 34500,
            "originalPrice": 34500,
            "railcard": null,
            "restrictionCode": "U7",
            "route": "/route/00346",
            "statusCode": "000",
            "fareSetter": null,
            "xLondon": 0,
            "isPlusBus": false,
            "discount": null,
            "childStatusDescription": null,
            "adultStatusDescription": null,
            "labels": [],
            "assistedCode": null
        },
        "/ticket-type/1D0": {
            "name": {
                "display": "Flexible Caledonian Double Solo",
                "print": "Flexible Caledonian Double Solo",
                "description": "SOLO CAL DOUBLE"
            },
            "ccstFormat": "X12",
            "code": "1D0",
            "validity": "/validity-type/64",
            "isReturn": false,
            "isSeason": false,
            "isAdvance": true,
            "isPackage": false,
            "isCarnet": false,
            "isFirstClass": true,
            "reservationType": "B",
            "maxPassengers": 1,
            "minPassengers": 1,
            "minAdults": 0,
            "maxAdults": 1,
            "minChildren": 0,
            "maxChildren": 1,
            "utsCode": 0,
            "timeRestriction": 0,
            "capriCode": "ESV",
            "canBeRetailed": true,
            "ticketCategory": "advance",
            "reservationSupplement": "/supplement-type/CAU"
        },
        "/validity-type/64": {
            "code": "64",
            "outward": {
                "days": 1,
                "months": 0,
                "break": false,
                "description": "BOOKDTRAINONLY"
            },
            "return": {
                "days": 0,
                "months": 0,
                "break": false,
                "description": "INVALID"
            },
            "returnMustBeAfter": {
                "days": 0,
                "months": 0,
                "dayOfWeek": null
            }
        },
        "/route/00346": {
            "code": "00346",
            "name": {
                "description": "CAL SLEEPER.",
                "aaaDescription": null,
                "print": "Valid on Caledonian Sleeper only",
                "display": "Valid only on the Caledonian Sleeper service."
            },
            "included": [],
            "excluded": [],
            "lul": "NNNNNN-000000000000-_"
        },
        "/seat-reservation/101353": {
            "coach": "B",
            "seat": "05R",
            "leg": "/leg/137580",
            "supplement": "/supplement/120433",
            "reservation": "/reservation/TV452908"
        },
        "/supplement/120433": {
            "type": "/supplement-type/CAU",
            "transactionNumber": "18025",
            "price": 0,
            "isBerth": true
        }
    }
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /customer/orders

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "type": "object",
                    "properties": {
                        "meta": {
                            "type": "object",
                            "properties": {
                                "page": {
                                    "type": "integer"
                                },
                                "perPage": {
                                    "type": "integer"
                                },
                                "lastPage": {
                                    "type": "integer"
                                }
                            }
                        },
                        "data": {
                            "type": "array",
                            "items": {
                                "type": "string",
                                "pattern": "^/order/[0-9]+$"
                            }
                        }
                    }
                },
                "links": {
                    "type": [
                        "object",
                        "array"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "meta": {
            "page": 1,
            "perPage": 10,
            "lastPage": 10
        },
        "data": [
            "/order/0001018025",
            "/order/0001018024"
        ]
    },
    "links": {
        "/order/0001018025": []
    }
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /customer/flexipass-orders

200 application/json
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /customer/flexipass-used

200 application/json
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /customer/flexipass-unused

200 application/json
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

Get Address details

GET /address/{id}

200 application/json
Response schema (show)
{
    "allOf": [
        {
            "description": "Extended response",
            "type": "object",
            "required": [
                "status",
                "data",
                "links"
            ],
            "properties": {
                "status": {
                    "description": "Response status",
                    "enum": [
                        "success",
                        "error"
                    ]
                },
                "data": {
                    "description": "Response data",
                    "type": [
                        "object",
                        "array"
                    ]
                },
                "links": {
                    "description": "Response links",
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        },
        {
            "properties": {
                "data": {
                    "properties": {
                        "title": {
                            "type": "string"
                        },
                        "firstNames": {
                            "type": "string"
                        },
                        "surname": {
                            "type": "string"
                        },
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": "string"
                        },
                        "address3": {
                            "type": "string"
                        },
                        "town": {
                            "type": "string"
                        },
                        "county": {
                            "type": "string"
                        },
                        "postCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "telephoneNumber": {
                            "type": [
                                "number",
                                "null"
                            ]
                        },
                        "email": {
                            "type": [
                                "string"
                            ]
                        }
                    },
                    "required": [
                        "title",
                        "firstNames",
                        "surname",
                        "address1",
                        "address2",
                        "address3",
                        "town",
                        "county",
                        "postCode",
                        "country",
                        "telephoneNumber",
                        "email"
                    ]
                },
                "links": {
                    "type": [
                        "array",
                        "object"
                    ]
                }
            }
        }
    ]
}
Response example (show)
{
    "status": "success",
    "data": {
        "title": "",
        "firstNames": "",
        "surname": "",
        "address1": "Avenue 1",
        "address2": "Avenue 2",
        "address3": "Avenue 3",
        "town": "London",
        "county": "County of London",
        "postCode": "EC1",
        "country": "Great Britain",
        "telephoneNumber": null,
        "email": "info@assertis.co.uk"
    },
    "links": []
}
404 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

Operation on User

POST /users

Register new user

Request schema (show)
{
    "allOf": [
        {
            "type": "object",
            "properties": {
                "id": {
                    "type": "number"
                },
                "title": {
                    "enum": [
                        "Mr",
                        "Mrs",
                        "Ms",
                        "Miss",
                        "Dr",
                        "Lord",
                        "Lady",
                        "Sir",
                        "Dame"
                    ]
                },
                "firstNames": {
                    "type": "string"
                },
                "surname": {
                    "type": "string"
                },
                "email": {
                    "type": "email"
                },
                "phone": {
                    "type": "string"
                },
                "marketingSignUp": {
                    "type": "boolean"
                },
                "mobileDeviceId": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "preTripMailFourWeeks": {
                    "type": "boolean"
                },
                "preTripMailOneWeek": {
                    "type": "boolean"
                },
                "baseAddress": {
                    "type": "object",
                    "properties": {
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": "string"
                        },
                        "address3": {
                            "type": "string"
                        },
                        "town": {
                            "type": "string"
                        },
                        "postCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "county": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "address1",
                        "address2",
                        "address3",
                        "town",
                        "postCode",
                        "country",
                        "county"
                    ]
                }
            },
            "required": [
                "title",
                "firstNames",
                "surname",
                "email",
                "phone",
                "marketingSignUp",
                "baseAddress"
            ]
        },
        {
            "properties": {
                "password": {
                    "type": "string",
                    "pattern": ".{6,}"
                }
            },
            "required": [
                "password"
            ]
        }
    ]
}
Request example (show)
{
    "title": "Mr",
    "firstNames": "Test",
    "surname": "Behat",
    "email": "test@assertis.co.uk",
    "password": "over6longPassword",
    "phone": "666999000",
    "marketingSignUp": true,
    "mobileDeviceId": null,
    "baseAddress": {
        "address1": "Avenue 1",
        "address2": "Avenue 2",
        "address3": "Avenue 3",
        "town": "London",
        "postCode": "EC1",
        "country": "Great Britain",
        "county": "County of London"
    }
}
201 application/json
Response schema (show)
{
    "description": "User response",
    "allOf": [
        {
            "type": "object",
            "properties": {
                "id": {
                    "type": "number"
                },
                "title": {
                    "enum": [
                        "Mr",
                        "Mrs",
                        "Ms",
                        "Miss",
                        "Dr",
                        "Lord",
                        "Lady",
                        "Sir",
                        "Dame"
                    ]
                },
                "firstNames": {
                    "type": "string"
                },
                "surname": {
                    "type": "string"
                },
                "email": {
                    "type": "email"
                },
                "phone": {
                    "type": "string"
                },
                "marketingSignUp": {
                    "type": "boolean"
                },
                "mobileDeviceId": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "preTripMailFourWeeks": {
                    "type": "boolean"
                },
                "preTripMailOneWeek": {
                    "type": "boolean"
                },
                "baseAddress": {
                    "type": "object",
                    "properties": {
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": "string"
                        },
                        "address3": {
                            "type": "string"
                        },
                        "town": {
                            "type": "string"
                        },
                        "postCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "county": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "address1",
                        "address2",
                        "address3",
                        "town",
                        "postCode",
                        "country",
                        "county"
                    ]
                }
            },
            "required": [
                "title",
                "firstNames",
                "surname",
                "email",
                "phone",
                "marketingSignUp",
                "baseAddress"
            ]
        },
        {
            "properties": {
                "_links": {
                    "type": "object",
                    "properties": {
                        "self": {
                            "type": "string",
                            "pattern": "/users/[0-9]+"
                        },
                        "cards": {
                            "type": "string",
                            "pattern": "/users/[0-9]+/cards"
                        }
                    },
                    "required": [
                        "self",
                        "cards"
                    ]
                }
            },
            "required": [
                "_links"
            ]
        }
    ]
}
Response example (show)
{
    "id": 13931,
    "title": "Mr",
    "firstNames": "Test",
    "surname": "Behat",
    "email": "test@assertis.co.uk",
    "phone": "666999000",
    "marketingSignUp": true,
    "mobileDeviceId": null,
    "preTripMailFourWeeks": true,
    "preTripMailOneWeek": true,
    "baseAddress": {
        "address1": "Avenue 1",
        "address2": "Avenue 2",
        "address3": "Avenue 3",
        "town": "London",
        "postCode": "EC1",
        "country": "Great Britain",
        "county": "County of London"
    },
    "_links": {
        "self": "/users/13931",
        "cards": "/users/13931/cards"
    }
}

PATCH /users

Change user password

Request schema (show)
{
    "properties": {
        "password": {
            "type": "string",
            "pattern": ".{6,}"
        }
    },
    "required": [
        "password"
    ]
}
Request example (show)
{
    "password": "over6longPassword"
}
200 application/json
Response schema (show)
{
    "description": "User response",
    "allOf": [
        {
            "type": "object",
            "properties": {
                "id": {
                    "type": "number"
                },
                "title": {
                    "enum": [
                        "Mr",
                        "Mrs",
                        "Ms",
                        "Miss",
                        "Dr",
                        "Lord",
                        "Lady",
                        "Sir",
                        "Dame"
                    ]
                },
                "firstNames": {
                    "type": "string"
                },
                "surname": {
                    "type": "string"
                },
                "email": {
                    "type": "email"
                },
                "phone": {
                    "type": "string"
                },
                "marketingSignUp": {
                    "type": "boolean"
                },
                "mobileDeviceId": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "preTripMailFourWeeks": {
                    "type": "boolean"
                },
                "preTripMailOneWeek": {
                    "type": "boolean"
                },
                "baseAddress": {
                    "type": "object",
                    "properties": {
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": "string"
                        },
                        "address3": {
                            "type": "string"
                        },
                        "town": {
                            "type": "string"
                        },
                        "postCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "county": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "address1",
                        "address2",
                        "address3",
                        "town",
                        "postCode",
                        "country",
                        "county"
                    ]
                }
            },
            "required": [
                "title",
                "firstNames",
                "surname",
                "email",
                "phone",
                "marketingSignUp",
                "baseAddress"
            ]
        },
        {
            "properties": {
                "_links": {
                    "type": "object",
                    "properties": {
                        "self": {
                            "type": "string",
                            "pattern": "/users/[0-9]+"
                        },
                        "cards": {
                            "type": "string",
                            "pattern": "/users/[0-9]+/cards"
                        }
                    },
                    "required": [
                        "self",
                        "cards"
                    ]
                }
            },
            "required": [
                "_links"
            ]
        }
    ]
}
Response example (show)
{
    "id": 13931,
    "title": "Mr",
    "firstNames": "Test",
    "surname": "Behat",
    "email": "test@assertis.co.uk",
    "phone": "666999000",
    "marketingSignUp": true,
    "mobileDeviceId": null,
    "preTripMailFourWeeks": true,
    "preTripMailOneWeek": true,
    "baseAddress": {
        "address1": "Avenue 1",
        "address2": "Avenue 2",
        "address3": "Avenue 3",
        "town": "London",
        "postCode": "EC1",
        "country": "Great Britain",
        "county": "County of London"
    },
    "_links": {
        "self": "/users/13931",
        "cards": "/users/13931/cards"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}
Response example (show)
{
    "status": "error",
    "code": "ERR-VALIDATION",
    "message": "Input validation failed",
    "fields": {
        "password": "Password should contains at least 6 letters."
    }
}

GET /users/{id}

Get user details

200 application/json
Response schema (show)
{
    "description": "User response",
    "allOf": [
        {
            "type": "object",
            "properties": {
                "id": {
                    "type": "number"
                },
                "title": {
                    "enum": [
                        "Mr",
                        "Mrs",
                        "Ms",
                        "Miss",
                        "Dr",
                        "Lord",
                        "Lady",
                        "Sir",
                        "Dame"
                    ]
                },
                "firstNames": {
                    "type": "string"
                },
                "surname": {
                    "type": "string"
                },
                "email": {
                    "type": "email"
                },
                "phone": {
                    "type": "string"
                },
                "marketingSignUp": {
                    "type": "boolean"
                },
                "mobileDeviceId": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "preTripMailFourWeeks": {
                    "type": "boolean"
                },
                "preTripMailOneWeek": {
                    "type": "boolean"
                },
                "baseAddress": {
                    "type": "object",
                    "properties": {
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": "string"
                        },
                        "address3": {
                            "type": "string"
                        },
                        "town": {
                            "type": "string"
                        },
                        "postCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "county": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "address1",
                        "address2",
                        "address3",
                        "town",
                        "postCode",
                        "country",
                        "county"
                    ]
                }
            },
            "required": [
                "title",
                "firstNames",
                "surname",
                "email",
                "phone",
                "marketingSignUp",
                "baseAddress"
            ]
        },
        {
            "properties": {
                "_links": {
                    "type": "object",
                    "properties": {
                        "self": {
                            "type": "string",
                            "pattern": "/users/[0-9]+"
                        },
                        "cards": {
                            "type": "string",
                            "pattern": "/users/[0-9]+/cards"
                        }
                    },
                    "required": [
                        "self",
                        "cards"
                    ]
                }
            },
            "required": [
                "_links"
            ]
        }
    ]
}
Response example (show)
{
    "id": 13931,
    "title": "Mr",
    "firstNames": "Test",
    "surname": "Behat",
    "email": "test@assertis.co.uk",
    "phone": "666999000",
    "marketingSignUp": true,
    "mobileDeviceId": null,
    "preTripMailFourWeeks": true,
    "preTripMailOneWeek": true,
    "baseAddress": {
        "address1": "Avenue 1",
        "address2": "Avenue 2",
        "address3": "Avenue 3",
        "town": "London",
        "postCode": "EC1",
        "country": "Great Britain",
        "county": "County of London"
    },
    "_links": {
        "self": "/users/13931",
        "cards": "/users/13931/cards"
    }
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

PUT /users/{id}

Update user

Request schema (show)
{
    "type": "object",
    "properties": {
        "id": {
            "type": "number"
        },
        "title": {
            "enum": [
                "Mr",
                "Mrs",
                "Ms",
                "Miss",
                "Dr",
                "Lord",
                "Lady",
                "Sir",
                "Dame"
            ]
        },
        "firstNames": {
            "type": "string"
        },
        "surname": {
            "type": "string"
        },
        "email": {
            "type": "email"
        },
        "phone": {
            "type": "string"
        },
        "marketingSignUp": {
            "type": "boolean"
        },
        "mobileDeviceId": {
            "type": [
                "string",
                "null"
            ]
        },
        "preTripMailFourWeeks": {
            "type": "boolean"
        },
        "preTripMailOneWeek": {
            "type": "boolean"
        },
        "baseAddress": {
            "type": "object",
            "properties": {
                "address1": {
                    "type": "string"
                },
                "address2": {
                    "type": "string"
                },
                "address3": {
                    "type": "string"
                },
                "town": {
                    "type": "string"
                },
                "postCode": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "county": {
                    "type": "string"
                }
            },
            "required": [
                "address1",
                "address2",
                "address3",
                "town",
                "postCode",
                "country",
                "county"
            ]
        }
    },
    "required": [
        "title",
        "firstNames",
        "surname",
        "email",
        "phone",
        "marketingSignUp",
        "baseAddress"
    ]
}
Request example (show)
{
    "title": "Mr",
    "firstNames": "Test",
    "surname": "Behat",
    "email": "test@assertis.co.uk",
    "phone": "666999000",
    "marketingSignUp": true,
    "mobileDeviceId": null,
    "preTripMailFourWeeks": true,
    "preTripMailOneWeek": true,
    "baseAddress": {
        "address1": "Avenue 1",
        "address2": "Avenue 2",
        "address3": "Avenue 3",
        "town": "London",
        "postCode": "EC1",
        "country": "Great Britain",
        "county": "County of London"
    }
}
200 application/json
Response schema (show)
{
    "description": "User response",
    "allOf": [
        {
            "type": "object",
            "properties": {
                "id": {
                    "type": "number"
                },
                "title": {
                    "enum": [
                        "Mr",
                        "Mrs",
                        "Ms",
                        "Miss",
                        "Dr",
                        "Lord",
                        "Lady",
                        "Sir",
                        "Dame"
                    ]
                },
                "firstNames": {
                    "type": "string"
                },
                "surname": {
                    "type": "string"
                },
                "email": {
                    "type": "email"
                },
                "phone": {
                    "type": "string"
                },
                "marketingSignUp": {
                    "type": "boolean"
                },
                "mobileDeviceId": {
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "preTripMailFourWeeks": {
                    "type": "boolean"
                },
                "preTripMailOneWeek": {
                    "type": "boolean"
                },
                "baseAddress": {
                    "type": "object",
                    "properties": {
                        "address1": {
                            "type": "string"
                        },
                        "address2": {
                            "type": "string"
                        },
                        "address3": {
                            "type": "string"
                        },
                        "town": {
                            "type": "string"
                        },
                        "postCode": {
                            "type": "string"
                        },
                        "country": {
                            "type": "string"
                        },
                        "county": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "address1",
                        "address2",
                        "address3",
                        "town",
                        "postCode",
                        "country",
                        "county"
                    ]
                }
            },
            "required": [
                "title",
                "firstNames",
                "surname",
                "email",
                "phone",
                "marketingSignUp",
                "baseAddress"
            ]
        },
        {
            "properties": {
                "_links": {
                    "type": "object",
                    "properties": {
                        "self": {
                            "type": "string",
                            "pattern": "/users/[0-9]+"
                        },
                        "cards": {
                            "type": "string",
                            "pattern": "/users/[0-9]+/cards"
                        }
                    },
                    "required": [
                        "self",
                        "cards"
                    ]
                }
            },
            "required": [
                "_links"
            ]
        }
    ]
}
Response example (show)
{
    "id": 13931,
    "title": "Mr",
    "firstNames": "Test",
    "surname": "Behat",
    "email": "test@assertis.co.uk",
    "phone": "666999000",
    "marketingSignUp": true,
    "mobileDeviceId": null,
    "preTripMailFourWeeks": true,
    "preTripMailOneWeek": true,
    "baseAddress": {
        "address1": "Avenue 1",
        "address2": "Avenue 2",
        "address3": "Avenue 3",
        "town": "London",
        "postCode": "EC1",
        "country": "Great Britain",
        "county": "County of London"
    },
    "_links": {
        "self": "/users/13931",
        "cards": "/users/13931/cards"
    }
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

Authenticate customer

POST /check-user

200 application/json
Response schema (show)
{
    "description": "Post token response",
    "type": "object",
    "required": [
        "user-id"
    ],
    "properties": {
        "user-id": {
            "type": "string"
        }
    }
}
Response example (show)
{
    "user-id": "/users/1"
}
400 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}
401 application/json
Response schema (show)
{
    "description": "Response with error",
    "type": "object",
    "properties": {
        "status": {
            "description": "Response status",
            "pattern": "error"
        },
        "code": {
            "description": "Error code",
            "type": "string"
        },
        "message": {
            "description": "Error message",
            "type": "string"
        },
        "fields": {
            "description": "Detailed info about missing fields",
            "type": "object"
        }
    },
    "required": [
        "status",
        "code",
        "message"
    ]
}

GET /goldstar-tickets/search

Search tickets directly in GoldStar API

Parameters

string photocardId (required)

Example: ZXY1234

string postCode (required)

Example: EC4N 7AE

string responses