Introduction
Welcome to the Intercity API! You can use our API to access Intercity endpoints.
You can view code examples and responses in the dark area to the right.
Authentication
API token
Verification of api calls is done via api token in X-API-Authentication header.
X-API-Authentication: <API AUTH TOKEN>
User authentication
Endpoints that require user authentication, must be accessed with an included Authorization header, using the token bearer format:
"Authorization: Bearer <USER AUTH TOKEN>"
This token is acquired from the user login request.
Accessing an endpoint that requires user token authentication without providing the token or by providing a bad or expired token, the response will be 401 Unauthorized. In such case a fresh token should be acquired from the /user/login endpoint.
Driver authentication
Endpoints that require driver authentication, must be accessed with an included Authorization header, using the token bearer format:
"Authorization: Bearer <DRIVER AUTH TOKEN>"
This token is acquired from the driver login request.
Accessing an endpoint that requires driver token authentication without providing the token or by providing a bad or expired token, the response will be 401 Unauthorized. In such case a fresh token should be acquired from the /driver/login endpoint.
Requests & Responses
Primary content type, unless otherwise stated, for both requests and response payloads is application/json. Most endpoints should also accept application/x-www-form-urlencoded as request content type, but this is not guaranteed.
All requests with a body must have a Content-Type header set!
Internationalization
Internationalization of resources like sent emails and returned pdfs is done in the backend based on the language code provided in Accept-Language header of the corresponding request.
Default language
Default language of resources is english. This language is used if the value of Accept-Language header is "en", or if the value of Accept-Language is not one of the supported languages.
Accept-Language Request Header
Accept-Language http request header example: Accept-Language: <Supported Alpha-2 Code>
Currently supported languages
This is a list of languages that we currently translate resources into.
| Alpha-2 Code | Language |
|---|---|
| en | English |
| sl | Slovenian |
| hr | Croatian |
| de | German |
| hu | Hungarian |
| sk | Slovak |
| it | Italian |
Network
List Stations
Request examples
curl -X GET
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H "Cache-Control: no-cache"
"https://apitest.nomago.dev/stations"
200 Successful response example
[
{
"id": "109",
"name": "Autobusni kolodvor Novigrad",
"address": "Murve 15",
"city": "Novigrad",
"city_id": "32039",
"country": "HR",
"country_id": "1",
"latitude": "45.3188",
"longitude": "13.5683",
"country_name": "Croatia"
},
{
"id": "125",
"name": "Autobusni kolodvor Poreč",
"address": "Ulica Karla Huguesa 432",
"city": "Poreč",
"city_id": "31991",
"country": "HR",
"country_id": "1",
"latitude": "45.2249",
"longitude": "13.5972",
"country_name": "Croatia"
},
{
"id": "127",
"name": "Autobusni kolodvor Pula",
"address": "Trg 1. istarske brigade 1",
"city": "Pula",
"city_id": "31980",
"country": "HR",
"country_id": "1",
"latitude": "44.8769",
"longitude": "13.8542",
"country_name": "Croatia"
},
{
"id": "131",
"name": "Autobusni kolodvor Rovinj",
"address": "Ulica Mattea Benussia 508",
"city": "Rovinj",
"city_id": "31964",
"country": "HR",
"country_id": "1",
"latitude": "45.0807",
"longitude": "13.6394",
"country_name": "Croatia"
},...
]
For retrieving station list. Returns 100 results at a time when offset parameter is present. Returns all results if offset parameter is omitted.
HTTP Request
GEThttps://apitest.nomago.dev/stations
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| offset | string | no | Number of records from the beginning to skip |
Response message
| Property | Type | Description |
|---|---|---|
| id | int | Station id |
| name | string | Full name of station |
| address | string | Address of station (can be null) |
| latitude | string | Latitude point of station |
| longitude | string | Longitude point of station |
| city | string | Name of city where station is located |
| city_id | int | City id from the database |
| country | string | ISO code of country where stations is located |
| country_id | int | Country id from the database |
| country_name | string | Country name in english |
List Cities
Request examples
curl -X GET
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H "Cache-Control: no-cache"
"https://apitest.nomago.dev/cities"
200 Successful response example
[
{
"id": "1",
"name": "Xarrë",
"country": "AL",
"country_id": "14",
"latitude": "39.72833",
"longitude": "20.05444"
},
{
"id": "2",
"name": "Sarandë",
"country": "AL",
"country_id": "14",
"latitude": "39.87556",
"longitude": "20.00528"
},
{
"id": "3",
"name": "Mesopotam",
"country": "AL",
"country_id": "14",
"latitude": "39.91028",
"longitude": "20.09222"
},
{
"id": "4",
"name": "Markat",
"country": "AL",
"country_id": "14",
"latitude": "39.73278",
"longitude": "20.19528"
},
{
"id": "5",
"name": "Livadhja",
"country": "AL",
"country_id": "14",
"latitude": "39.78917",
"longitude": "20.12194"
},...
For retrieving city list. Returns 100 results at a time when offset parameter is present. Returns all results if offset parameter is omitted.
HTTP Request
GEThttps://apitest.nomago.dev/cities
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| offset | string | no | Number of records from the beginning to skip |
Response message
| Property | Type | Description |
|---|---|---|
| id | int | City id |
| name | string | Full name of the city |
| latitude | string | Latitude point of the city |
| longitude | string | Longitude point of the city |
| country | string | ISO code of country where city is located |
| country_id | int | Country id from the database |
Search Station
Request examples
curl -X GET
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H "Cache-Control: no-cache"
"https://apitest.nomago.dev/station/search?term=ljubljana"
200 Successful response example
[
{
"id": "375",
"name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"city": "Ljubljana",
"city_id": "51370",
"country": "SI",
"country_id": "4",
"latitude": "46.0577",
"longitude": "14.5095"
},
{
"id": "26959",
"name": "Ljubljana Dolgi most",
"address": "",
"city": "Ljubljana",
"city_id": "51370",
"country": "SI",
"country_id": "4",
"latitude": "46.0369",
"longitude": "14.4635"
}
]
For retrieving station list for term provided.
HTTP Request
GEThttps://apitest.nomago.dev/station/search
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| term | string | Yes | Search term, must be at least 3 characters. |
Response message
| Property | Type | Description |
|---|---|---|
| id | int | Station id |
| name | string | Full name of station |
| address | string | Address of station (can be null) |
| latitude | string | Latitude point of station |
| longitude | string | Longitude point of station |
| city | string | Name of city where station is located |
| city_id | int | City id from the database |
| country | string | ISO code of country where stations is located |
| country_id | int | Country id from the database |
Search City
Request examples
curl -X GET
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H "Cache-Control: no-cache"
"https://apitest.nomago.dev/city/search?term=ljublj"
200 Successful response example
[
{
"id": 51370,
"name": "Ljubljana",
"latitude": "46.05108",
"longitude": "14.50513",
"country": "SI",
"country_id": "4"
}
]
For retrieving city list for term provided.
HTTP Request
GEThttps://apitest.nomago.dev/city/search
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| term | string | Yes | Search term, must be at least 3 characters. |
Response message
| Property | Type | Description |
|---|---|---|
| id | int | City id |
| name | string | Full name of the city |
| latitude | string | Latitude point of the city |
| longitude | string | Longitude point of the city |
| country | string | ISO code of country where city is located |
| country_id | int | Country id from the database |
Available Trip Connections
Request examples
curl -X GET
https://apitest.nomago.dev/trip/search/connections
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example
{
"connections": [
{
"start_id": "1",
"end_id": "2",
"is_inter": false
},
{
"start_id": "1",
"end_id": "3",
"is_inter": false
},
{
"start_id": "2",
"end_id": "3",
"is_inter": false
}
]
}
For getting all available connection combinations..
HTTP Request
GET https://apitest.nomago.dev/trip/search/connections
This endpoint is not paged and will return all results matching the provided parameters. Returns up to 100 results if the offset parameter is present
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| offset | int | No | Number of records to skip from the start |
| date | string | No | Date for which available interconnections should be returned |
| location_type | string | No | Specify the type of results you would like to receive ('city' or 'station'). Returns station ids by default |
Response
Returns a list of start_id and end_id combinations. start_id and end_id are station or city ids, depending on the location_type parameter.
Available Trip Interconnections
Request examples
curl -X GET
https://apitest.nomago.dev/trip/search/interconnections
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example
{
"interconnections": [
{
"start_id": "1",
"end_id": "2",
"is_inter": true
},
{
"start_id": "1",
"end_id": "3",
"is_inter": true
},
{
"start_id": "2",
"end_id": "3",
"is_inter": true
}
]
}
For getting all available interconnection combinations.
HTTP Request
GET https://apitest.nomago.dev/trip/search/interconnections
This endpoint is not paged and will return all results matching the provided parameters. If offset is provided, the response returns up to 100 results.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| offset | int | No | Number of records to skip from the start |
| date | string | No | Date for which available connections should be returned |
| location_type | string | No | Specify the type of results you would like to receive ('city' or 'station'). Returns station ids by default |
Response
Returns a list of start_id and end_id combinations. start_id and end_id are station or city ids, depending on the location_type parameter.
Get Station Connections
Request examples
curl -X GET
https://apitest.nomago.dev/station/connections?station_id=375&direction=from&departure_date=2019-06-01
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example of direct lines
{
"results": [
{
"trip_uid": "direct:a8d7033986f3bc50fb31cb8e77012dd9:2019-06-20",
"from": {
"id": 375,
"name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"city": "Ljubljana",
"country": "Slovenija",
"location": "46.0577, 14.5095"
},
"to": {
"id": 15157,
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"location": "48.1423, 11.5494"
},
"departure": {
"time": "2019-06-20 06:00:00",
"timezone": "Europe/Ljubljana"
},
"arrival": {
"time": "2019-06-20 10:00:00",
"timezone": "Europe/Berlin",
"next_day": false
},
"transborder": true,
"duration": 14400,
"stops": 0,
"currency": "EUR",
"category": {
"premium": {
"capacity": 12,
"adult_price": 125
},
"economy": {
"capacity": 14,
"adult_price": 100
},
"family": {
"capacity": 12,
"adult_price": 75
}
},
"type": "direct"
}
]
}
200 Successful response example of interconnect lines
{
"results": [
{
"trip_uid": "inter:324c1bdd7c7a7da38eae7da0fffaab3c:2019-06-22",
"from": {
"id": 171,
"name": "Kolodvor Zagreb",
"address": "Avenija Marina Držića 4",
"city": "Zagreb",
"country": "Hrvatska",
"location": "45.8036, 15.9936"
},
"to": {
"id": 15157,
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"location": "48.1423, 11.5494"
},
"departure": {
"time": "2019-06-22 07:00:00",
"timezone": "Europe/Zagreb"
},
"arrival": {
"time": "2019-06-22 14:00:00",
"timezone": "Europe/Berlin",
"next_day": false
},
"transborder": true,
"duration": 25200,
"stops": 4,
"transfers": [
{
"arrival_time": "2019-06-22 09:30:00",
"departure_time": "2019-06-22 10:00:00",
"waiting_time": 1800,
"station": {
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"location": "48.1423, 11.5494"
}
}
],
"connections": [
{
"trip_uid": "direct:7f289762cccd607b9caf1d431b1ae936:2019-06-22",
"departure": {
"departure_time": "2019-06-22 07:00:00",
"departure_station": {
"station_name": "Kolodvor Zagreb",
"address": "Avenija Marina Držića 4",
"latitude": "45.8036",
"longitude": "15.9936",
"city": "Zagreb",
"asciiname": "Zagreb",
"city_id": "31863",
"country": "Hrvatska",
"cc": "HR"
}
},
"arrival": {
"arrival_time": "2019-06-22 09:30:00",
"arrival_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI"
}
},
"waiting_time": 0
},
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-22",
"departure": {
"departure_time": "2019-06-22 10:00:00",
"departure_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI"
}
},
"arrival": {
"arrival_time": "2019-06-22 14:00:00",
"arrival_station": {
"station_name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"latitude": "48.1423",
"longitude": "11.5494",
"city": "Munich",
"asciiname": "Munich",
"city_id": "9529",
"country": "Germany",
"cc": "DE"
}
},
"waiting_time": 1800
}
],
"type": "inter",
"category": {
"premium": {
"capacity": 8,
"adult_price": 288.6
},
"economy": {
"capacity": 10,
"adult_price": 222
},
"family": {
"capacity": 8,
"adult_price": 170.6
}
}
}
]
}
For getting all available connections to/from a station on a given date.
HTTP Request
GET https://apitest.nomago.dev/station/connections
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| station_id | int | Yes | Destination station id. |
| direction | string | Yes | "to" or "from" |
| departure_date | string | Yes | Date of departure , format YYYY-mm-dd |
| trip_id | int | No | Trip id, to filter the results by |
Response message
| Property | Type | Description |
|---|---|---|
| results | array | Result array of Trip objects |
Search Trip
Request examples
curl -X POST
https://apitest.nomago.dev/trip/search
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-H 'content-type: application/json;
-d '{
"from_id": 375,
"destination_id": 15157,
"departure_date": "2019-06-30",
"adult": 1,
"currency": "EUR",
"location_type": "station"
}'
200 Successful response example of direct lines
{
"results": [
{
"trip_uid": "direct:2ba5bbe6deadbab839bf5468224bd694:2019-06-16",
"from": {
"id": 109,
"name": "Autobusni kolodvor Novigrad",
"address": "Murve 15",
"city": "Novigrad",
"country": "Croatia",
"location": "45.3188, 13.5683"
},
"to": {
"id": 375,
"name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"city": "Ljubljana",
"country": "Slovenia",
"location": "46.0577, 14.5095"
},
"departure": {
"time": "2019-06-16 04:50:00",
"timezone": "Europe/Zagreb"
},
"arrival": {
"time": "2019-06-16 07:50:00",
"timezone": "Europe/Ljubljana",
"next_day": false
},
"transborder": true,
"duration": 10800,
"distance": 167,
"stops": 2,
"currency": "EUR",
"type": "direct",
"category": {
"premium": {
"capacity": 12,
"free_seats": 12,
"adult_price": 12.64
},
"economy": {
"capacity": 32,
"free_seats": 24,
"adult_price": 10.99
},
"family": {
"capacity": 8,
"free_seats": 8,
"adult_price": 11.87
}
},
"link": "https://tickets.intercity.nomago.eu/web/search/intercept?from_id=109&to_id=375&type=oneway&departure_date=2019-06-16&adults=1&children=0&comfort=&from_name=Autobusni%20kolodvor%20Novigrad&to_name=Avtobusna%20Postaja%20Ljubljana"
}
]
}
200 Successful response example of interconnect lines
{
"results": [
{
"trip_uid": "inter:324c1bdd7c7a7da38eae7da0fffaab3c:2019-06-22",
"from": {
"id": 171,
"name": "Kolodvor Zagreb",
"address": "Avenija Marina Držića 4",
"city": "Zagreb",
"country": "Hrvatska",
"location": "45.8036, 15.9936"
},
"to": {
"id": 15157,
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"location": "48.1423, 11.5494"
},
"departure": {
"time": "2019-06-22 07:00:00",
"timezone": "Europe/Zagreb"
},
"arrival": {
"time": "2019-06-22 14:00:00",
"timezone": "Europe/Berlin",
"next_day": false
},
"transborder": true,
"duration": 25200,
"stops": 4,
"transfers": [
{
"arrival_time": "2019-06-22 09:30:00",
"departure_time": "2019-06-22 10:00:00",
"waiting_time": 1800,
"station": {
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"location": "48.1423, 11.5494"
}
}
],
"connections": [
{
"trip_uid": "direct:7f289762cccd607b9caf1d431b1ae936:2019-06-22",
"departure": {
"departure_time": "2019-06-22 07:00:00",
"departure_station": {
"station_name": "Kolodvor Zagreb",
"address": "Avenija Marina Držića 4",
"latitude": "45.8036",
"longitude": "15.9936",
"city": "Zagreb",
"asciiname": "Zagreb",
"city_id": "31863",
"country": "Hrvatska",
"cc": "HR"
}
},
"arrival": {
"arrival_time": "2019-06-22 09:30:00",
"arrival_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI"
}
},
"waiting_time": 0
},
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-22",
"departure": {
"departure_time": "2019-06-22 10:00:00",
"departure_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI"
}
},
"arrival": {
"arrival_time": "2019-06-22 14:00:00",
"arrival_station": {
"station_name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"latitude": "48.1423",
"longitude": "11.5494",
"city": "Munich",
"asciiname": "Munich",
"city_id": "9529",
"country": "Germany",
"cc": "DE"
}
},
"waiting_time": 1800
}
],
"type": "inter",
"category": {
"premium": {
"capacity": 8,
"adult_price": 288.6
},
"economy": {
"capacity": 10,
"adult_price": 222
},
"family": {
"capacity": 8,
"adult_price": 170.6
}
}
}
]
}
For getting all available connections between two locations on given date.
HTTP Request
POST https://apitest.nomago.dev/trip/search
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | string | No | Type of trips to search for, can be direct or inter. If left empty, searches for both types. |
| from_id | int | Yes | Departure station/city id. |
| destination_id | int | Yes | Destination station/city id. |
| location_type | string | Yes | Defines if the locations are stations or cities. city for cities, station for stations. |
| departure_date | string | Yes | Date of departure , format YYYY-mm-dd |
| adult | int | Yes | Number of adult passengers. |
| children | int | No | Number of children passengers. |
| category | string | No | Defines which category of seats for passengers to search for. Possible values (economy,family,premium). If left empty, all categories are searched. |
| currency | string | No | Currency that should be used to calculate the prices. ISO 4217 currency code. |
Response message
| Property | Type | Description |
|---|---|---|
| results | array | Result array of Trip objects |
Get Trip Data
Request examples
curl -X GET
'https://apitest.nomago.dev/trip/get?trip_uid=trip:17fa909143ca819e604be4ffa0078038:2019-03-01'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example for direct line
{
"trip_uid": "direct:c4c2cc067956c6c329e2e0d75e6164ca:2019-07-25",
"type": "direct",
"departure": {
"departure_time": "2019-07-25 23:15:00",
"departure_station": {
"id": 171,
"station_name": "Zagreb Bus Station",
"address": "Avenija Marina Držića 4",
"latitude": 45.8036,
"longitude": 15.9936,
"city": "Zagreb",
"asciiname": "Zagreb",
"city_id": 31863,
"country": "Croatia",
"cc": "HR",
"country_id": 1,
"platform": "201"
}
},
"arrival": {
"arrival_time": "2019-07-26 13:45:00",
"arrival_station": {
"id": 15157,
"station_name": "Munich ZOB",
"address": "Arnulfstraße 21",
"latitude": 48.1424,
"longitude": 11.5498,
"city": "Munich",
"asciiname": "Munich",
"city_id": 9529,
"country": "Germany",
"cc": "DE",
"country_id": 9,
"platform": "101"
}
},
"duration": "52200",
"distance": "1097574",
"prices": {
"economy": [
{
"id": "normal",
"title": "Normal ticket",
"price": 19.99
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 9.8
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 13.79
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 15.59
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 15.79
}
],
"family": [
{
"id": "normal",
"title": "Normal ticket",
"price": 21.59
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 10.58
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 14.9
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 16.84
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 17.06
}
],
"premium": [
{
"id": "normal",
"title": "Normal ticket",
"price": 22.99
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 11.27
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 15.86
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 17.93
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 18.16
}
]
},
"currency": "EUR"
}
200 Successful response example for interconnection
{
"trip_uid": "inter:324c1bdd7c7a7da38eae7da0fffaab3c:2019-06-20",
"type": "inter",
"departure": {
"departure_time": "2019-06-20 07:00:00",
"departure_station": {
"station_name": "Kolodvor Zagreb",
"address": "Avenija Marina Držića 4",
"latitude": "45.8036",
"longitude": "15.9936",
"city": "Zagreb",
"asciiname": "Zagreb",
"city_id": "31863",
"country": "Hrvatska",
"cc": "HR",
"country_id": 1,
"platform": "201"
}
},
"arrival": {
"arrival_time": "2019-06-20 14:00:00",
"arrival_station": {
"station_name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"latitude": "48.1423",
"longitude": "11.5494",
"city": "Munich",
"asciiname": "Munich",
"city_id": "9529",
"country": "Germany",
"cc": "DE",
"country_id": 9,
"platform": "101"
}
},
"interconnections": [
{
"search_id": "7f289762cccd607b9caf1d431b1ae936",
"departure": {
"departure_time": "2019-06-20 07:00:00",
"departure_station": {
"station_name": "Kolodvor Zagreb",
"address": "Avenija Marina Držića 4",
"latitude": "45.8036",
"longitude": "15.9936",
"city": "Zagreb",
"asciiname": "Zagreb",
"city_id": "31863",
"country": "Hrvatska",
"cc": "HR",
"country_id": 1,
"platform": "201"
}
},
"arrival": {
"arrival_time": "2019-06-20 09:30:00",
"arrival_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI",
"country_id": 4,
"platform": "1"
}
},
"waiting_time": 0
},
{
"search_id": "f2df31c3e7a1ade33138c08b0c60a538",
"departure": {
"departure_time": "2019-06-20 10:00:00",
"departure_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI",
"country_id": 4,
"platform": "1"
}
},
"arrival": {
"arrival_time": "2019-06-20 14:00:00",
"arrival_station": {
"station_name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"latitude": "48.1423",
"longitude": "11.5494",
"city": "Munich",
"asciiname": "Munich",
"city_id": "9529",
"country": "Germany",
"cc": "DE",
"country_id": 9,
"platform": "101"
}
},
"waiting_time": 1800
}
],
"duration": "25200",
"distance": "1162942"
}
For retrieving trip detailed information.
HTTP Request
GEThttps://apitest.nomago.dev/trip/get
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| trip_uid | string | Yes | Trip unique id |
| currency | string | No | Currency that should be used to calculate the prices. ISO 4217 currency code. |
Response message
| Property | Type | Description |
|---|---|---|
| trip | array | Trip data object |
Get Stations
Request examples
curl -X GET
'https://apitest.nomago.dev/trip/stations?trip_uid=trip:17fa909143ca819e604be4ffa0078038:2019-03-01'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example for direct line
{
"stations": [
{
"id": 375,
"station_name": "Avtobusna Postaja Ljubljana",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"country": "Slovenija",
"departure_time": "10:00:00",
"arrival_time": "00:00:00",
"timezone": "Europe/Ljubljana"
},
{
"id": 2758,
"station_name": "Bus station Wien VIB Terminal",
"latitude": "48.1908",
"longitude": "16.4142",
"city": "Vienna",
"country": "Austria",
"departure_time": "12:14:00",
"arrival_time": "12:00:00",
"timezone": "Europe/Vienna"
},
{
"id": 15157,
"station_name": "München Main Bus Station",
"latitude": "48.1423",
"longitude": "11.5494",
"city": "Munich",
"country": "Germany",
"departure_time": "00:00:00",
"arrival_time": "14:00:00",
"timezone": "Europe/Berlin"
}
]
}
200 Successful response example for inter line
{
"stations": [
{
"id": 171,
"station_name": "Kolodvor Zagreb",
"latitude": "45.8036",
"longitude": "15.9936",
"city": "Zagreb",
"country": "Hrvatska",
"departure_time": "07:00:00",
"arrival_time": "00:00:00",
"timezone": "Europe/Zagreb"
},
{
"id": 155,
"station_name": "Autobusni kolodvor Varaždin",
"latitude": "46.3042",
"longitude": "16.3342",
"city": "Varaždin",
"country": "Hrvatska",
"departure_time": "08:20:00",
"arrival_time": "08:10:00",
"timezone": "Europe/Zagreb"
},
{
"id": 434,
"station_name": "Dolnja Težka Voda",
"latitude": "45.7682",
"longitude": "15.195",
"city": "Novo Mesto",
"country": "Slovenija",
"departure_time": "08:50:00",
"arrival_time": "08:45:00",
"timezone": "Europe/Ljubljana"
},
{
"id": 375,
"station_name": "Avtobusna Postaja Ljubljana",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"country": "Slovenija",
"departure_time": "10:00:00",
"arrival_time": "09:30:00",
"timezone": "Europe/Ljubljana",
"waiting_time": 1800,
"is_transfer": true
},
{
"id": 2758,
"station_name": "Bus station Wien VIB Terminal",
"latitude": "48.1908",
"longitude": "16.4142",
"city": "Vienna",
"country": "Austria",
"departure_time": "12:14:00",
"arrival_time": "12:00:00",
"timezone": "Europe/Vienna"
},
{
"id": 15157,
"station_name": "München Main Bus Station",
"latitude": "48.1423",
"longitude": "11.5494",
"city": "Munich",
"country": "Germany",
"departure_time": "00:00:00",
"arrival_time": "14:00:00",
"timezone": "Europe/Berlin"
}
]
}
For getting all stops on a trip.
HTTP Request
GEThttps://apitest.nomago.dev/trip/stations
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| trip_uid | string | Yes | Trip unique id |
Response message
| Property | Type | Description |
|---|---|---|
| stations | array | Array of station objects, starting with departure station and ending with last stop. |
List station connections
Request examples
curl -X POST \
https://apitest.nomago.dev/station/connections
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-F station_id=375
-F departure_date=01/07/2019
-F direction=to
200 Successful response example
{
"results": [
{
"trip_uid": "direct:a8d7033986f3bc50fb31cb8e77012dd9:2019-06-20",
"from": {
"id": 375,
"name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"city": "Ljubljana",
"country": "Slovenija",
"location": "46.0577, 14.5095"
},
"to": {
"id": 15157,
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"location": "48.1423, 11.5494"
},
"departure": {
"time": "2019-06-20 06:00:00",
"timezone": "Europe/Ljubljana"
},
"arrival": {
"time": "2019-06-20 10:00:00",
"timezone": "Europe/Berlin",
"next_day": false
},
"transborder": true,
"duration": 14400,
"stops": 0,
"currency": "EUR",
"category": {
"premium": {
"capacity": 12,
"adult_price": 125
},
"economy": {
"capacity": 14,
"adult_price": 100
},
"family": {
"capacity": 12,
"adult_price": 75
}
},
"type": "direct"
}
]
}
For getting all connections from/to station.
HTTP Request
POSThttps://apitest.nomago.dev/station/connections
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| station_id | string | Yes | Station id |
| direction | string | Yes | Either from or to. Determines direction of connections to list. |
| departure_date | string | Yes | Date of departures , format dd/mm/YYYY |
Response message
| Property | Type | Description |
|---|---|---|
| results | array | Result array of Trip objects |
Get minimal price
Request examples
curl -X GET
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H "Cache-Control: no-cache"
"https://apitest.nomago.dev/price/get-min"
200 Successful response example
{
"price": 8.99
}
For getting minimal possible price between two stations. This price is without dynamic price rules applied (base price). If no price set, error is returned.
HTTP Request
GEThttps://apitest.nomago.dev/price/get-min?start_id=375&end_id=171
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| start_id | int | yes | Start station id |
| end_id | int | yes | End station id |
Response message
| Property | Type | Description |
|---|---|---|
| price | float | Minimal price for this station pair |
Get incoming busses
Request examples
curl -X GET
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H "Cache-Control: no-cache"
"https://apitest.nomago.dev/location/incoming"
200 Successful response example
[
{
"trip_id": 85,
"trip": "Frankfurt - Zagreb",
"latency": 1148,
"timetable_arrival": "2019-12-19 14:20",
"timetable_departure": "2019-12-19 14:30",
"arriving_at": "2019-12-19 14:39",
"departing_at": "2019-12-19 14:49",
"kilometers_left": 36.8,
"station_list": {
"1": "Frankfurt Central Station",
"2": "Frankfurt Airport Bus Terminal (FRA)",
"3": "Mannheim ZOB",
"4": "Karlsruhe Bus station (Hbf)",
"5": "Stuttgart Airport (SAB)",
"6": "Ulm Bus Station ",
"7": "Augsburg P+R North",
"8": "Munich ZOB",
"9": "Salzburg P&R South",
"10": "Villach Bus Station",
"11": "Bled Bus Station",
"12": "Ljubljana Bus station",
"13": "Zagreb Bus Station"
}
},
{
"trip_id": 83,
"trip": "Zagreb - Frankfurt",
"latency": -732,
"timetable_arrival": "2019-12-19 14:20",
"timetable_departure": "2019-12-19 14:30",
"arriving_at": "2019-12-19 14:07",
"departing_at": "2019-12-19 14:17",
"kilometers_left": 0.3,
"station_list": {
"1": "Zagreb Bus Station",
"2": "Ljubljana Bus station",
"3": "Bled Bus Station",
"4": "Villach Bus Station",
"5": "Salzburg P&R South",
"6": "Munich ZOB",
"7": "Augsburg P+R North",
"8": "Ulm Bus Station ",
"9": "Stuttgart Airport (SAB)",
"10": "Karlsruhe Bus station (Hbf)",
"11": "Mannheim ZOB",
"12": "Frankfurt Airport Bus Terminal (FRA)",
"13": "Frankfurt Central Station"
}
}
]
For getting full list of busses incoming to station with their latencies and approximate arrival times.
HTTP Request
GEThttps://apitest.nomago.dev/location/incoming
Response message
| Property | Type | Description |
|---|---|---|
| trip_id | int | Unique trip identifier |
| trip | string | Description of trip |
| latency | int | Latency of bus defined in seconds, can be negative meaning that bus is running ahead of schedule. |
| timetable_arrival | string | Timetable arrival time in station timezone. |
| timetable_departure | string | Timetable departure time in station timezone. |
| arriving_at | string | Approximate arrival time with latency included in station timezone. |
| departing_at | string | Approximate departure time with latency included in station timezone. |
| kilometers_left | float | Approximate kilometers left before arrival to station. |
| station_list | array | List of all stations sorted in the bus timeline. |
Reservations
Add Trip (Create Reservation)
Request examples
curl -X PUT
https://apitest.nomago.dev/trip/add
-H 'Content-Type: application/json'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-d '{
"trip_uid":"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-26",
"adult":2,
"children":1,
"currency": "EUR",
"category": "economy"
}'
200 Successful response example for direct trip
{
"trips": [
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-26",
"from": {
"address": "Trg Osvobodilne fronte 4",
"city": "Ljubljana",
"country": "Slovenija",
"id": 375,
"location": "46.0577, 14.5095",
"name": "Avtobusna Postaja Ljubljana"
},
"to": {
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"id": 15157,
"location": "48.1423, 11.5494",
"name": "München Main Bus Station"
},
"departure": {
"time": "2019-06-26 10:00:00",
"timezone": "Europe/Ljubljana"
},
"arrival": {
"next_day": false,
"time": "2019-06-26 14:00:00",
"timezone": "Europe/Berlin"
},
"transborder": true,
"duration": 14400,
"stops": 1,
"currency": "EUR",
"price": {
"adult_price": 197.6,
"category": "premium",
"children_price": 138.32,
"number_of_passengers": 2
},
"price_groups": [
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 98.8
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 138.32
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 158.08
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 158.08
}
],
"type": "direct"
}
],
"pricing": {
"cart": [
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-26",
"type": "ticket",
"price": 197.6,
"passenger_type": "adult",
"passenger_id": 0
},
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-26",
"type": "ticket",
"price": 138.32,
"passenger_type": "children",
"passenger_id": 1
}
],
"total_price": 335.92,
"currency": "EUR"
},
"reservation": {
"token": "5bea5d4702b28e54ce890f0b20408496",
"expires": 1553594964,
"timezone": "UTC",
"is_expired": false,
"completed": false
}
}
200 Successful response example for inter trip
{
"trips": [
{
"trip_uid": "inter:324c1bdd7c7a7da38eae7da0fffaab3c:2019-06-25",
"from": {
"address": "Avenija Marina Držića 4",
"city": "Zagreb",
"country": "Hrvatska",
"id": 171,
"location": "45.8036, 15.9936",
"name": "Kolodvor Zagreb"
},
"to": {
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"id": 15157,
"location": "48.1423, 11.5494",
"name": "München Main Bus Station"
},
"departure": {
"time": "2019-06-25 07:00:00",
"timezone": "Europe/Zagreb"
},
"arrival": {
"next_day": false,
"time": "2019-06-25 14:00:00",
"timezone": "Europe/Berlin"
},
"transborder": true,
"duration": 25200,
"stops": 4,
"transfers": [
{
"arrival_time": "2019-06-25 09:30:00",
"departure_time": "2019-06-25 10:00:00",
"waiting_time": 1800,
"station": {
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"location": "48.1423, 11.5494"
}
}
],
"connections": [
{
"trip_uid": "direct:7f289762cccd607b9caf1d431b1ae936:2019-06-25",
"departure": {
"departure_time": "2019-06-25 07:00:00",
"departure_station": {
"station_name": "Kolodvor Zagreb",
"address": "Avenija Marina Držića 4",
"latitude": "45.8036",
"longitude": "15.9936",
"city": "Zagreb",
"asciiname": "Zagreb",
"city_id": "31863",
"country": "Hrvatska",
"cc": "HR"
}
},
"arrival": {
"arrival_time": "2019-06-25 09:30:00",
"arrival_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI"
}
},
"waiting_time": 0
},
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-25",
"departure": {
"departure_time": "2019-06-25 10:00:00",
"departure_station": {
"station_name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"latitude": "46.0577",
"longitude": "14.5095",
"city": "Ljubljana",
"asciiname": "Ljubljana",
"city_id": "51370",
"country": "Slovenija",
"cc": "SI"
}
},
"arrival": {
"arrival_time": "2019-06-25 14:00:00",
"arrival_station": {
"station_name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"latitude": "48.1423",
"longitude": "11.5494",
"city": "Munich",
"asciiname": "Munich",
"city_id": "9529",
"country": "Germany",
"cc": "DE"
}
},
"waiting_time": 1800
}
],
"price": {
"adult_price": 288.6,
"category": "premium",
"children_price": 202.02,
"number_of_passengers": 2
},
"price_groups": [
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 144.3
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 202.02
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 230.88
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 230.88
}
],
"type": "inter"
}
],
"pricing": {
"cart": [
{
"trip_uid": "inter:324c1bdd7c7a7da38eae7da0fffaab3c:2019-06-25",
"type": "ticket",
"price": 288.6,
"passenger_type": "adult",
"passenger_id": 0
},
{
"trip_uid": "inter:324c1bdd7c7a7da38eae7da0fffaab3c:2019-06-25",
"type": "ticket",
"price": 202.02,
"passenger_type": "children",
"passenger_id": 1
}
],
"total_price": 490.62,
"currency": "EUR"
},
"reservation": {
"token": "6f7e8d5b404b74e38f0c199c1dc1397e",
"expires": 1553696600,
"timezone": "UTC",
"is_expired": false,
"completed": false
}
}
Method for creating reservation for number of passengers on desired trip(s). Each reservation is valid for 30 minutes after creating, its expiry time is defined by timestamp in response [reservation] array. After 30 minutes it can't be used for completing orders or adding additional trips to it.
One reservation token can hold multiple trips. Trips can also be removed from reservation.
HTTP Request
PUThttps://apitest.nomago.dev/trip/add
Driver authentication is possible for this endpoint!
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | No | If you already have a reservation, you can add new trips to the existing reservation by passing the reservation token. |
| trip_uid | string | Yes | Trip id. Can be obtained from Search Trip |
| adult | int | Yes | Number of adult passengers. |
| children | int | No | Number of children passengers. |
| currency | string | Yes | Currency that should be used to calculate the prices. ISO 4217 currency code. |
| category | string | Yes | Category of seats. Possible values (economy,family,premium). |
Response message
| Property | Type | Description |
|---|---|---|
| trips | array | Array of Trip objects that are selected for current reservation. |
| pricing | array | Pricing object. |
| passengers | array | Passenger info, numerated array with passenger_id keys. |
| reservation | array | Reservation details. |
Remove Trip
Request examples
curl -X DELETE \
https://apitest.nomago.dev/trip/remove \
-H 'Content-Type: application/json' \
-H 'X-API-Authentication: <API AUTH TOKEN>' \
-H 'cache-control: no-cache' \
-d '{
"trip_uid":"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-23",
"reservation_token":"0440c9e1692930759be722c556b52aad"
}'
200 Successful response example
{
"trips": [
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-25",
"from": {
"address": "Trg Osvobodilne fronte 4",
"city": "Ljubljana",
"country": "Slovenija",
"id": 375,
"location": "46.0577, 14.5095",
"name": "Avtobusna Postaja Ljubljana"
},
"to": {
"address": "Hackerbrücke 4",
"city": "Munich",
"country": "Germany",
"id": 15157,
"location": "48.1423, 11.5494",
"name": "München Main Bus Station"
},
"departure": {
"time": "2019-06-25 10:00:00",
"timezone": "Europe/Ljubljana"
},
"arrival": {
"next_day": false,
"time": "2019-06-25 14:00:00",
"timezone": "Europe/Berlin"
},
"transborder": true,
"duration": 14400,
"stops": 1,
"currency": "EUR",
"price": {
"adult_price": 197.6,
"category": "premium",
"children_price": 138.32,
"number_of_passengers": 2
},
"price_groups": [
{
"id": "children_0_2",
"price": 98.8,
"title": "Children 0-2"
},
{
"id": "children_2_12",
"price": 138.32,
"title": "Children 2-12"
},
{
"id": "students_12_26",
"price": 158.08,
"title": "Students 12-26"
},
{
"id": "retired_65",
"price": 158.08,
"title": "Retired 65+"
}
],
"type": "direct"
}
],
"pricing": {
"cart": [
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-25",
"type": "ticket",
"price": 197.6,
"passenger_type": "adult"
},
{
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-25",
"type": "ticket",
"price": 138.32,
"passenger_type": "children"
}
],
"total_price": 335.92,
"currency": "EUR"
},
"reservation": {
"token": "4654feb25d6bf77c7895e5e518e896ce",
"expires": 1553593381,
"timezone": "UTC",
"is_expired": false,
"completed": false
}
}
Used for removing trips added to reservation.
HTTP Request
DELETEhttps://apitest.nomago.dev/trip/remove
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Reservation token used to add trips. |
| trip_uid | string | Yes | Trip ID that is to be removed. You can get it from Search Trips |
Response message
| Property | Type | Description |
|---|---|---|
| trips | array | Array of Trip objects that are selected for current reservation. |
| pricing | array | Pricing details. |
| passengers | array | Passenger info, contains seat reservation numbers, each key is the trip uid and value is the seat number. |
| reservation | array | Reservation details. |
Add Passenger Data
Request example
curl -X POST
https://apitest.nomago.dev/trip/passengers
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-H 'content-type: multipart/form-data'
-F 'passengers[0][first_name]=John'
-F 'passengers[0][last_name]=Doe'
-F 'passengers[0][phone]=+234234234'
-F 'passengers[0][email]=example@nomago.si'
-F 'passengers[0][type]=adult'
-F 'passengers[0][passenger_id]=0'
-F 'passengers[1][first_name]=Child'
-F 'passengers[1][last_name]=Doe'
-F 'passengers[1][birthdate]=01/05/2010'
-F 'passengers[1][type]=children'
-F 'passengers[1][passenger_id]=1'
-F 'passengers[1][price_group]=children_0_2'
-F 'reservation_token=87334c8118fc6602e559460979bd7d83'
200 Successful response example
{
"passengers": [
{
"first_name": "John",
"last_name": "Doe",
"phone": "+234234234",
"email": "ruskia2@gmail.com",
"type": "adult",
"passenger_id": 0
},
{
"first_name": "Child",
"last_name": "Doe",
"birthdate": "01/05/2010",
"type": "children",
"passenger_id": 1,
"price_group": "children_0_2"
}
],
"reservation": {
"token": "87334c8118fc6602e559460979bd7d83",
"expires": 1553693802,
"timezone": "UTC",
"is_expired": false,
"completed": true
}
}
For adding passenger data for reservation.
Each passenger has ID, starting with 0, ex. (0,1,2,3).
For updating passenger data, just send the request again with proper passenger_id set.
If everything is ok with passenger fields and each passenger data is complete, then completed param in reservation array in response message will be set to true. If completed is false then at least one of the passenegers data is incomplete or missing.
HTTP Request
POST https://apitest.nomago.dev/trip/passengers
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| passengers | array | Yes | Passenger Data array of Passenger objects. |
| reservation_token | string | Yes | Obtained from trip/select method. |
Response message
| Property | Type | Description |
|---|---|---|
| reservation | array | Reservation details. |
Get Passenger Data
Request examples
curl -X GET
'https://apitest.nomago.dev/passenger/get?reservation_token=07681ce687d16c69c1113b1d74522183'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example
{
"passengers": [
{
"type": "adult",
"email": "ruskia2@gmail.com",
"phone": "+234234234",
"last_name": "Doe",
"first_name": "John",
"passenger_id": 0
},
{
"type": "children",
"birthdate": "01/05/2010",
"last_name": "Doe",
"first_name": "Child",
"price_group": "children_0_2",
"passenger_id": 1
}
],
"reservation": {
"token": "dcfd3d821a353f205b945546a69fa1fe",
"expires": 1553701334,
"timezone": "UTC",
"is_expired": "0",
"completed": true
}
}
For listing passenger data added to specified reservation.
HTTP Request
GEThttps://apitest.nomago.dev/passenger/get
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Obtained from trip/add method. |
Response message
| Property | Type | Description |
|---|---|---|
| passengers | array | Array of Passenger data. |
| reservation | array | Reservation details. |
Get Bus Layout (Seat map)
Request examples
curl -X GET
'https://apitest.nomago.dev/bus/getmap?trip_uid=trip:17fa909143ca819e604be4ffa0078038:2019-03-01
&reservation_token=76f27bbfb934ef74ed9b6d590329cd8a'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache,no-cache'
200 Successful response example for direct trip
{
"seats": {
"1": {
"seat_number": 1,
"price": 125,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 1,
"taken_as_empty": false,
"reservation_cost": 4
},
"2": {
"seat_number": 2,
"price": 125,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 2,
"taken_as_empty": false,
"reservation_cost": 5
},
"3": {
"seat_number": 3,
"price": 125,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 3,
"taken_as_empty": false,
"reservation_cost": 4
},
"4": {
"seat_number": 4,
"price": 125,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 4,
"taken_as_empty": false,
"reservation_cost": 5
},
"5": {
"seat_number": 5,
"price": 125,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 2,
"column": 1,
"taken_as_empty": false,
"reservation_cost": 1
}
}
}
200 Successful response example for interconnection trip
{
"interconnections": {
"direct:7f289762cccd607b9caf1d431b1ae936:2019-06-22": {
"seats": {
"1": {
"seat_number": 1,
"price": 91,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 1,
"taken_as_empty": false,
"reservation_cost": 5
},
"2": {
"seat_number": 2,
"price": 91,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 2,
"taken_as_empty": false,
"reservation_cost": 5
},
"3": {
"seat_number": 3,
"price": 91,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 3,
"taken_as_empty": false,
"reservation_cost": 5
},
"4": {
"seat_number": 4,
"price": 91,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 4,
"taken_as_empty": false,
"reservation_cost": 5
},
"5": {
"seat_number": 5,
"price": 91,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 2,
"column": 1,
"taken_as_empty": false,
"reservation_cost": 1
}
}
},
"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-22": {
"seats": {
"1": {
"seat_number": 1,
"price": 197.6,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 1,
"taken_as_empty": false,
"reservation_cost": 1
},
"2": {
"seat_number": 2,
"price": 197.6,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 2,
"taken_as_empty": false,
"reservation_cost": 1
},
"3": {
"seat_number": 3,
"price": 197.6,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 3,
"taken_as_empty": false,
"reservation_cost": 1
},
"4": {
"seat_number": 4,
"price": 197.6,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 1,
"column": 4,
"taken_as_empty": false,
"reservation_cost": 1
},
"5": {
"seat_number": 5,
"price": 197.6,
"current_reservation": false,
"available": true,
"category": "premium",
"seat_label": "P",
"row": 2,
"column": 1,
"taken_as_empty": false,
"reservation_cost": 1
}
}
}
}
}
Method for retrieving bus map (layout of seats) on specified date, related to reservation token.
HTTP Request
GEThttps://apitest.nomago.dev/bus/getmap
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| trip_uid | string | Yes | Trip unique ID, obtained from trip/search method. |
| reservation_token | string | No | Obtained from trip/add method. |
| currency | string | no | Valid currency string, for price recalculation. Default value used is EUR. |
Response message for direct trip
| Property | Type | Description |
|---|---|---|
| seats | array | Contains list of Seat on the bus. |
Response message for interconnection trip
| Property | Type | Description |
|---|---|---|
| interconnections | array | List of all connections that are making this interconnection trip, ordered by trips coming up first. For interconnection trips there is an option to book seats only for certain number of trips inside the connection. Each trip trip_uid is sent as a key for seats array and is used in seat booking process. |
Book Passenger Seat
Request example for direct connection
curl -X PUT
https://apitest.nomago.dev/passenger/setseat
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache,no-cache'
-d 'reservation_token=ab0df1d1ef793df5f6477c5a940e3df1
&trip_uid=direct%3Af2df31c3e7a1ade33138c08b0c60a538%3A2019-06-22
&passenger_id=0
&seat_number=1'
200 Successful response example for direct connection
{
"status": true,
"seating": {
"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-22": [
{
"passenger_id": 0,
"seat_number": "1",
"category": "premium",
"reservation_cost": 1
}
]
}
}
Request example for interconnection
curl -X PUT
https://api.nomago.io/passenger/setseat
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache,no-cache'
-d 'reservation_token=942ac52f2d95be323f33aa4fd968184a
&trip_uid=direct%3A7f289762cccd607b9caf1d431b1ae936%3A2019-06-22
&passenger_id=0
&seat_number=1
&inter_uid=inter%3A324c1bdd7c7a7da38eae7da0fffaab3c%3A2019-06-22'
200 Successful response example for intreconnection
{
"status": true,
"seating": {
"inter:324c1bdd7c7a7da38eae7da0fffaab3c:2019-06-22": {
"direct:7f289762cccd607b9caf1d431b1ae936:2019-06-22": [
{
"passenger_id": 0,
"seat_number": "1",
"category": "premium",
"reservation_cost": 5
}
]
}
}
}
Used for booking seats for each passenger separately. Each seat reservation cost is individual and is displayed in Seat object.
For booking seats on interconnection, each of the connections need to be booked separately, using the trip_uid of connection retrieved from Get Bus Layout endpoint. Result array seating displays only passengers that have a seat reservation.
If the seat is already taken by another passenger they will be shuffled and reasinged seat for secondary passenger.
HTTP Request
PUThttps://apitest.nomago.dev/passenger/setseat
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Reservation token, obtained from trip/add method. |
| trip_uid | string | Yes | Trip unique ID, obtained from trip/search method (in case of interconnection use keys from Get Bus Layout endpoint. |
| inter_uid | string | No | Only if reserving seat for interconnection, use this param for sending the interconnection uid. |
| passenger_id | int | Yes | Passenger ID in current reservation. |
| seat_number | int | Yes | Can be obtained from bus/getmap method |
Response message
| Property | Type | Description |
|---|---|---|
| status | bool | Defines if the seat reservation was successfull. |
| seating | array | Shows each connection seat reservations nested under trip_uid for each passenger as an array of Seating objects. In case of interconnection there is an additional level of nesting that displays the interconnection identifier and all connections contained inside for each passenger. |
Remove Passenger Seat
Request example for direct connection
curl -X DELETE \
https://api.nomago.io/passenger/setseat
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache,no-cache'
-d 'reservation_token=ab0df1d1ef793df5f6477c5a940e3df1
&trip_uid=direct%3Af2df31c3e7a1ade33138c08b0c60a538%3A2019-06-22
&passenger_id=0&seat_number=3'
200 Successful response example for direct connection when no seat reservations remaining
{
"status": true,
"seating": []
}
200 Successful response example for direct connection when there is remaining seat reservations
{
"status": true,
"seating": {
"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-22": {
"1": {
"category": "premium",
"seat_number": "2",
"passenger_id": 1,
"reservation_cost": 1
}
}
}
}
Used for canceling a seat reservation for specified passenger.
HTTP Request
DELETEhttps://apitest.nomago.dev/passenger/setseat
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Reservation token, obtained from trip/add method. |
| trip_uid | string | Yes | Trip unique ID, obtained from trip/search method (in case of interconnection use keys from Get Bus Layout endpoint. |
| inter_uid | string | No | Only in case of interconnection, use this param for sending the interconnection uid. |
| passenger_id | int | Yes | Passenger ID in current reservation. |
Response message
| Property | Type | Description |
|---|---|---|
| status | bool | Defines if the seat cancelation was successfull. |
| seating | array | Shows each connection seat reservation nested under trip_uid for each passenger. In case of interconnection there is an additional level of nesting that displays the interconnection identifier and all connections contained inside for each passenger. Will be empty in case of no seat reservations. |
Get Reservation Data
Request examples
curl -X GET
'https://apitest.nomago.dev/reservation/get?reservation_token=ec945e5d82f618c9cd01c1e2b8198cb5'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example for direct connection
{
"trips": [
{
"to": {
"id": 15157,
"city": "Munich",
"name": "München Main Bus Station",
"address": "Hackerbrücke 4",
"country": "Germany",
"location": "48.1423, 11.5494"
},
"from": {
"id": 375,
"city": "Ljubljana",
"name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"country": "Slovenija",
"location": "46.0577, 14.5095"
},
"type": "direct",
"price": {
"category": "premium",
"adult_price": 197.6,
"children_price": 138.32,
"number_of_passengers": 2
},
"stops": 1,
"arrival": {
"time": "2019-06-22 14:00:00",
"next_day": false,
"timezone": "Europe/Berlin"
},
"currency": "EUR",
"duration": 14400,
"trip_uid": "direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-22",
"departure": {
"time": "2019-06-22 10:00:00",
"timezone": "Europe/Ljubljana"
},
"transborder": true,
"price_groups": [
{
"id": "children_0_2",
"price": 98.8,
"title": "Children 0-2"
},
{
"id": "children_2_12",
"price": 138.32,
"title": "Children 2-12"
},
{
"id": "students_12_26",
"price": 158.08,
"title": "Students 12-26"
},
{
"id": "retired_65",
"price": 158.08,
"title": "Retired 65+"
}
]
}
],
"passengers": [
{
"type": "adult",
"email": "ruskia2@gmail.com",
"phone": "+234234234",
"last_name": "Horvat",
"first_name": "Hrvoje",
"passenger_id": 0
},
{
"type": "children",
"birthdate": "01/05/2010",
"last_name": "Peric",
"first_name": "Pero",
"passenger_id": 1
}
],
"seating": {
"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-22": {
"0": {
"category": "premium",
"seat_number": "1",
"passenger_id": "0",
"reservation_cost": 1
},
"1": {
"category": "premium",
"seat_number": "2",
"passenger_id": "1",
"reservation_cost": 1
}
}
},
"pricing": {
"adult": 1,
"children": 1,
"currency": "EUR",
"total_price": 335.92,
"number_of_tickets": 2
},
"invoice_data": {
"vat_id": "SI12345678",
"company": "Nomago d.o.o.",
"last_name": "Nomago",
"first_name": "Mister",
"address_city": "Ljubljana",
"address_street": "Vošnjakova ulica 3",
"address_country": "Slovenija",
"address_postal_code": "1000"
},
"currency": "EUR",
"updated": "2019-12-18 10:45:34",
"reservation": {
"token": "ab0df1d1ef793df5f6477c5a940e3df1",
"expires": 1553530828,
"timezone": "UTC",
"is_expired": false,
"completed": true
}
}
For getting detailed info on reservation.
HTTP Request
GEThttps://apitest.nomago.dev/reservation/get
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Obtained from trip/add method. |
Response message
| Property | Type | Description |
|---|---|---|
| trips | array | Array of Trip objects that are selected for current reservation. |
| pricing | array | Pricing details. |
| passengers | array | Passenger info, numerated array with passenger_id keys. |
| seating | array | Shows each connection seat reservations nested under trip_uid for each passenger as an array of Seating objects. In case of interconnection there is an additional level of nesting that displays the interconnection identifier and all connections contained inside for each passenger. |
| reservation | array | Reservation details. |
| invoice_data | object | Reservation invoice data object, representing the customer data that will be displayed on the invoice. Full API users only. |
Cancel Reservation
Request examples
curl -X DELETE
'https://apitest.nomago.dev/reservation'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-H 'Content-Type: application/json'
-d '{
"reservation_token":"<reservation_token>"
}'
200 Successful response example
{
"status": true,
"message": "Reservation canceled"
}
200 Error response examples
{
"error": "reservation_finalized",
"message": "Cannot cancel a finalized reservation. Use /order/cancel if you want to cancel an order."
}
{
"error": "reservation_expired",
"message": "Reservation is already expired"
}
Cancel a reservation
HTTP Request
DELETEhttps://apitest.nomago.dev/reservation
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Obtained from trip/add method. |
Response message
A successful response will contain a status field with value true
Add Voucher
Request examples
curl -X PUT
https://apitest.nomago.dev/reservation/voucher
-H 'Content-Type: application/json'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-d '{
"reservation_token":"a0f6ada39b4df3d506f76938ce2764fa",
"voucher_id":"R4A44JHZ"
}'
200 Successful response example
{
"amount": 33.75,
"currency": "EUR",
"voucher_id": "R4A44JHZ",
"status": true
}
Adding vouchers to order. Reduces the price that needs to be paid by the amount of voucher.
HTTP Request
PUT https://apitest.nomago.dev/reservation/voucher
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Reservation token. |
| voucher_id | string | Yes | Obrained from cancel order / cancel ticket actions. |
Response message
| Property | Type | Description |
|---|---|---|
| amount | float | Amount that will be deducted from total_price. |
| currency | string | Currency used/ matches the order currency. |
| voucher_id | string | Voucher ID that was used. |
| status | bool | Defines if voucher was successfully added to reservation. |
Remove Voucher
Request examples
curl -X DELETE
https://apitest.nomago.dev/reservation/voucher
-H 'Content-Type: application/json'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-d '{
"reservation_token":"a0f6ada39b4df3d506f76938ce2764fa",
"voucher_id":"R4A44JHZ"
}'
200 Successful response example
{
"status": true,
"message": "Voucher removed."
}
Adding vouchers to order. Reduces the price that needs to be paid by the amount of voucher.
HTTP Request
DELETE https://apitest.nomago.dev/reservation/voucher
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Reservation token. |
| voucher_id | string | Yes | Obtained from cancel order / cancel ticket actions. |
Response message
| Property | Type | Description |
|---|---|---|
| status | bool | Defines if removal of voucher went successfully. |
| message | string | Descriptive message. |
Ancillaries
Get Ancillary Offers
Request examples
curl -X GET
'https://apitest.nomago.dev/trip/ancillary?trip_uid=direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-26'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache,no-cache'
200 Successful response example
{
"ancillary_offer": [
{
"ancillary_id": 1,
"price": 2,
"limit_per_passenger": 2,
"max_available": 20,
"name": "Luggage",
"desciption": "Extra luggage (1 piece)"
},
{
"ancillary_id": 2,
"price": 5,
"limit_per_passenger": 1,
"max_available": 10,
"name": "Sport equipment",
"desciption": "Sports equipment (max. 30 kg, 160 x 48 x 35 cm)"
},
{
"ancillary_id": 4,
"price": 7,
"limit_per_passenger": 1,
"max_available": 5,
"name": "Bicycle",
"desciption": "Bicycles must be folded and packed safely in boxes or carrying bags"
}
]
}
For getting ancillary offer for trips.
HTTP Request
GEThttps://apitest.nomago.dev/trip/ancillary
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| trip_uid | string | Yes | Trip unique identification. |
| currency | string | No | Currency code to convert the prices. Default EUR. |
Response message
| Property | Type | Description |
|---|---|---|
| ancillary_offer | array | Array of Ancillary objects. |
Add Ancillaries
Request examples
curl -X PUT \
https://api.nomago.io/trip/ancillary
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'Postman-Token: bceaa65d-7437-474a-8cd2-ba12648a3f88'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache,no-cache'
-d 'trip_uid=direct%3Af2df31c3e7a1ade33138c08b0c60a538%3A2019-06-26
&reservation_token=9dce609344a8376f26925034154d9726
&ancillary_id=1&amount=1&passenger_id=0'
200 Successful response example
{
"ancillaries": {
"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-27": [
{
"name": "Luggage",
"price": 2,
"amount": 1,
"ancillary_id": 1,
"passenger_id": 1
},
{
"name": "Luggage",
"ancillary_id": 1,
"passenger_id": 0,
"price": 2,
"amount": 1
}
]
}
}
For adding ancillaries to reservations.
HTTP Request
PUThttps://apitest.nomago.dev/trip/ancillary
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| trip_uid | string | Yes | Trip unique identification. |
| reservation_token | string | Yes | Obtained from trip/add method. |
| ancillary_id | int | Yes | Ancillary identification. Obtained in Get Ancillary method. |
| amount | int | No | Defines how many of ancillary offer to add for passenger, if not sent defaults to 1. |
| passenger_id | int | No | Defines passenger to attach the ancillary to. If not sent then passenger with id 0 gets the offers added. |
Response message
| Property | Type | Description |
|---|---|---|
| ancillaries | array | Array of Selected Ancillary objects. |
Ancillary prices are returned in the currency of the reservation
Remove Ancillaries
Request examples
curl -X DELETE
https://apitest.nomago.dev/trip/ancillary
-H 'Content-Type: application/x-www-form-urlencoded'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache,no-cache'
-d 'trip_uid=direct%3Af2df31c3e7a1ade33138c08b0c60a538%3A2019-06-27
&reservation_token=7057f0f3588a89d79546f518ee92a9cf
&ancillary_id=1&passenger_id=0'
200 Successful response example
{
"ancillaries": {
"direct:f2df31c3e7a1ade33138c08b0c60a538:2019-06-27": [
{
"name": "Luggage",
"price": 2,
"amount": 1,
"ancillary_id": 1,
"passenger_id": 1
}
]
}
}
For removing ancillaries from reservations. Displays what is left of ancillaries selected, or if none left displays empty array in response.
HTTP Request
DELETE https://apitest.nomago.dev/trip/ancillary
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| trip_uid | string | Yes | Trip unique identification. |
| reservation_token | string | Yes | Obtained from trip/add method. |
| ancillary_id | int | Yes | Ancillary identification. Obtained in Get Ancillary method. |
| amount | int | No | Defines how many of ancillary offer to remove for passenger, if not sent defaults to total amount that is added. |
| passenger_id | int | Yes | Defines passenger from who to remove the ancillary. |
Response message
| Property | Type | Description |
|---|---|---|
| ancillaries | array | Array of Selected Ancillary objects. |
Orders
Finalize Order
Request examples
curl -X POST
https://apitest.nomago.dev/order/finalize
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'content-type: multipart/form-data;
-F reservation_token=6327ef7ad753b1f2fbf57ee4b973be1b
200 Successful response example
{
"order": {
"id": "f6d3003c806b580f0f87ad5e4c2561bc",
"bruto_price": "208",
"neto_price": "166.4",
"voucher_amount": "0.00",
"tax": "0.00",
"currency": "EUR",
"created": "2019-08-08 09:43:32",
"order_number": "1065-1-2-2019",
"download_hash": "62ad3f163029ce2e069ed56a08bff648",
"cancellation": {
"canceled": false,
"cancellable": true,
"return_type": "cashback",
"return_amount": 8.09
},
"status": true
}
}
This is the final step in process of ticket reservation. Uses only reservation token which is obtained form select trip method. Returns order details.
HTTP Request
POST https://apitest.nomago.dev/order/finalize
Optional user authentication is possible for this endpoint, to connect the reservation to the user! Optional driver authentication is possible for this endpoint, to make driver sale!
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reservation_token | string | Yes | Reservation token, obtained from Trip methods. |
| nonce | string | No | Only required for full integration process. Not used in case of agent sale. |
| agent_sale | bool | No | Only in case its a full integration and sales are done by an registered agent. In case of agent sale, agent authentication via auth header is required. |
| save_payment_method | bool | No | Add to store successful payment methods. Default is false. (Full integration only) |
| payment_method | string | No | "cash" or "card". Only used with driver sale (Full integration only) |
Response message
| Property | Type | Description |
|---|---|---|
| order | object | Order object. |
Get Order
Request examples
curl -X GET
'https://apitest.nomago.dev/order/get?api_v=2&order_id=f6d3003c806b580f0f87ad5e4c2561bc'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example
{
"order": {
"id": "f6d3003c806b580f0f87ad5e4c2561bc",
"bruto_price": "208",
"neto_price": "166.4",
"voucher_amount": "0.00",
"tax": "0.00",
"currency": "EUR",
"created": "2019-08-08 09:43:32",
"order_number": "1065-1-2-2019",
"download_hash": "62ad3f163029ce2e069ed56a08bff648",
"cancellation": {
"canceled": false,
"cancellable": true,
"return_type": "cashback",
"return_amount": 8.09
},
"status": true
},
"tickets": [
{
"id": "5",
"full_price": "20.00",
"discount": "0.00",
"price": "20.00",
"first_name": "<first_name>",
"last_name": "<last_name>",
"canceled": false,
"used_at": "2019-07-08 13:23:33"
},
{
"id": "6",
"full_price": "10.00",
"discount": "0.00",
"price": "10.00",
"first_name": "<first_name>",
"last_name": "<last_name>",
"canceled": true,
"used_at": null
}
]
}
This call is made for getting all the necessary info regarding an order. Its invoked via order_id param which is acquired earlier in Finalize Order call.
HTTP Request
GEThttps://apitest.nomago.dev/order/get?api_v=2
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| order_id | string | Yes | Order id |
| api_v | int | No | This endpoint is versioned. Current version is 2. Version 1 was deprecated on 2019-12-06 and removed on 2020-01-29 |
Response message
| Property | Type | Description |
|---|---|---|
| order | object | Order object. |
| tickets | array | Contains tickets. Every ticket has its unique id which is in the details of each ticket (needed for further manipulation of tickets). |
Cancel Order
Request examples
curl -X DELETE
https://apitest.nomago.dev/order/cancel
-H 'Content-Type: application/json'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-d '{
"order_id":"7f8a3ea2ae9874798e735a1c161b29cc"
}'
200 Successful response example ("full" integration)
{
"voucher_id": "UHBI8MSS",
"voucher_amount": 50,
"currency": "EUR"
}
200 Successful response example ("partner" integration)
{
"return_amount": 48.58,
"currency": "EUR"
}
Used for canceling orders. Cancels all tickets inside an order. If some tickets are already canceled, skips those and returns a list of tickets that were not canceled with reasons.
For "full" type integrations, a voucher is created and returned. For "partner" type integrations, the returned amount is deducted from total sales sum. This amount is returned in the response of this endpoint.
HTTP Request
DELETE https://apitest.nomago.dev/order/cancel
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| order_id | string | Yes | Order id |
| force | boolean | No | Attempt a forced 100% refund cancellation READ BELOW |
Order cancellation with full refund
Order cancellation with full 100% refund is only available on a per partner basis after being agreed upon with Nomago sales and IT departments. When enabled, order cancellation with full 100% refund is only possible within the first 30 minutes after order finalization. If a full refund cancellation request is made and not all requirements are met, the cancellation will be made using the standard cancellation policy. The amount returned is to be considered as the real refund amount, that will also be present on the end of month sales reports and invoices.
Response message (full)
| Property | Type | Description |
|---|---|---|
| voucher_id | string | Voucher id. Used as form of payment when creating new reservations. |
| voucher_amount | float | Amount on voucher. |
| currency | string | Currency of the voucher. |
Response message (partner)
| Property | Type | Description |
|---|---|---|
| return_amount | float | Amount on voucher. |
| currency | string | Currency of the voucher. |
Get full order details
Request examples
curl -X GET
https://apitest.nomago.dev/order?id=<order_id>
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
200 Successful response example
{full_order}
Returns full order details including tickets with seats and ancillaries
HTTP Request
GET https://apitest.nomago.dev/order
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | Order id |
Response message
Response will contain an json full order object
Tickets
Ticket list
Request examples
curl -X GET https://apitest.nomago.dev/ticket/list
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-H 'Authorization: Bearer <USER AUTH TOKEN>
200 Successful response example
{
"token": "<USER AUTH TOKEN>",
"tickets": [
{
"id": 1147,
"to": {
"cc": "SI",
"id": 375,
"city": "Ljubljana",
"name": "Ljubljana Bus station",
"address": "Trg Osvobodilne fronte 4",
"country": "Slovenia",
"latitude": 46.057701110839844,
"platform": null,
"longitude": 14.509499549865723
},
"gsm": "+386234234",
"from": {
"cc": "HR",
"id": 171,
"city": "Zagreb",
"name": "Zagreb Bus Station",
"address": "Avenija Marina Držića 4",
"country": "Croatia",
"latitude": 45.8036003112793,
"platform": "1,2",
"longitude": 15.993599891662598,
"interchangeable": false
},
"type": "adult",
"used": "0",
"email": "anze.kozar@nomago.si",
"price": 66.96,
"arrival": {
"time": "2019-11-09 07:35:00",
"timezone": "Europe/Ljubljana"
},
"created": "2019-11-06 00:22:58",
"trip_id": 16,
"canceled": "0",
"category": "economy",
"currency": "HRK",
"duration": 8400,
"trip_uid": "direct:0e7d5091e84ed3ed214cda290d144f30:2019-11-09",
"departure": {
"time": "2019-11-09 05:15:00",
"timezone": "Europe/Zagreb"
},
"full_name": "Mister Nomago",
"last_name": "Nomago",
"transfers": [],
"first_name": "Mister",
"seat_number": "41",
"passenger_id": 0,
"checksum_hash": "1b695696ae89bc7e877ccef8370143fa",
"ticket_number": "1573000925",
"country_legs": [
{
"length": "27190",
"country_id": "1",
"percentage": "0.196969",
"cardinality": "1",
"total_length": "138042",
"is_transit": "1",
"country_name": "Croatia",
"country_code": "HR"
},
{
"length": "110852",
"country_id": "4",
"percentage": "0.803031",
"cardinality": "2",
"total_length": "138042",
"is_transit": "1",
"country_name": "Slovenia",
"country_code": "SI"
}
],
"interconnections": []
},...
]
}
Get the list of authenticated user's tickets. This endpoint returns up to 30 results at the time. Use the offset parameter to retrieve additional results.
HTTP Request
GET https://apitest.nomago.dev/ticket/list
User authentication is possible for this endpoint!
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| used | int | no | 0 to return only unused tickets, 1 to return only used tickets. Returns all tickets by default |
| expired | int | no | 1 to return only expired tickets (arrival time in the past). Returns only unexpired ones by default |
| offset | int | no | Positive integer specifying how many tickets to skip |
| order_ids | string | Order ids, separated by _ (underscore) sign, whose tickets should be returned. If this parameter is present, user authentication should be omitted. |
Response
Returns a list of ticket objects
Get ticket
Request examples
curl -X GET https://apitest.nomago.dev/ticket?ticket_id=<ticket_id>
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'cache-control: no-cache'
-H 'Authorization: Bearer <USER AUTH TOKEN>'
200 Successful response example
{
"token": "<USER AUTH TOKEN>",
"ticket": {
"id": 1147,
"to": {
"cc": "SI",
"id": 375,
"city": "Ljubljana",
"name": "Ljubljana Bus station",
"address": "Trg Osvobodilne fronte 4",
"country": "Slovenia",
"latitude": 46.057701110839844,
"platform": null,
"longitude": 14.509499549865723
},
"gsm": "+386234234",
"from": {
"cc": "HR",
"id": 171,
"city": "Zagreb",
"name": "Zagreb Bus Station",
"address": "Avenija Marina Držića 4",
"country": "Croatia",
"latitude": 45.8036003112793,
"platform": "1,2",
"longitude": 15.993599891662598,
"interchangeable": false
},
"type": "adult",
"used": "0",
"email": "anze.kozar@nomago.si",
"price": 66.96,
"arrival": {
"time": "2019-11-09 07:35:00",
"timezone": "Europe/Ljubljana"
},
"created": "2019-11-06 00:22:58",
"trip_id": 16,
"canceled": "0",
"category": "economy",
"currency": "HRK",
"duration": 8400,
"trip_uid": "direct:0e7d5091e84ed3ed214cda290d144f30:2019-11-09",
"departure": {
"time": "2019-11-09 05:15:00",
"timezone": "Europe/Zagreb"
},
"full_name": "Mister Nomago",
"last_name": "Nomago",
"transfers": [],
"first_name": "Mister",
"seat_number": "41",
"passenger_id": 0,
"checksum_hash": "1b695696ae89bc7e877ccef8370143fa",
"ticket_number": "1573000925",
"country_legs": [
{
"length": "27190",
"country_id": "1",
"percentage": "0.196969",
"cardinality": "1",
"total_length": "138042",
"is_transit": "1",
"country_name": "Croatia",
"country_code": "HR"
},
{
"length": "110852",
"country_id": "4",
"percentage": "0.803031",
"cardinality": "2",
"total_length": "138042",
"is_transit": "1",
"country_name": "Slovenia",
"country_code": "SI"
}
],
"interconnections": []
}
}
200 Error response example
{
"error": "ticket_not_found",
"message": "The requested ticket either doesn't exits or does not belong to the authenticated user."
}
Get the ticket by id
HTTP Request
GET https://apitest.nomago.dev/ticket?ticket_id=<ticket_id>
User authentication is possible for this endpoint!
Request parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticket_id | int | Yes | Id of the ticket to be returned |
| order_ids | string | No* | Order ids, separated by _ (underscore) sign, whose tickets should be returned. If this parameter is present, user authentication can be omitted, if user auth is not present, this parameter is required. |
Response
Returns a ticket object
Send ticket as gift
Request examples
curl -X POST
'https://apitest.nomago.dev/ticket/gift/send'
-H 'Cache-Control: no-cache'
-H 'Content-Type: application/json'
-H 'X-API-Authentication: <API AUTH TOKEN>'
-H 'Authorization: Bearer <USER AUTH TOKEN>'
-d '{
"ticket_id":100,
"target_email": "example1@nomago.si",
"message": "Have a nice trip"
}'
200 Successful response example
{
"token": <USER_AUTH_TOKEN>,
"message": "Ticket sent!"
}
200 Error response examples
{
"error": "invalid_target_user",
"message": "Provided target user can't be the same as authenticated user!"
}
Returned when the target_email belongs to the current user
{
"error": "invalid_email",
"message": "User with this email does not exist!"
}
Returned when the target_email is not registered with any user
{
"error": "invalid_gift_ticket",
"message": "The requested ticket can't be sent as a gift, as it has already been used!"
}
Returned when the ticket has already been used
{
"error": "ticket_not_found",
"message": "The requested ticket either doesn't exist or does not belong to the authenticated user."
}
Returned when the ticket id is invalid or belongs to a ticket not owned by the authenticated user
Transfer a ticket from one user to another, as a gift.
HTTP Request
POST https://apitest.nomago.dev/ticket/gift/send
User authentication is required for this endpoint!
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticket_id | int | Yes | Ticket ID |
| target_email | string | Yes | Email of the target user |
| message | string | Yes | Gift message |
Print Ticket
Request examples
curl -X GET
'https://apitest.nomago.dev/ticket/print?ticket_id=100'
-H 'Cache-Control: no-cache'
-H 'X-API-Authentication: <API AUTH TOKEN>'
Using this you can download PDF ticket file.
HTTP Request
GET https://apitest.nomago.dev/ticket/print
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticket_id | string | Yes | Ticket ID |
| lang | string | No | Will be removed in the future. Use Accept-Language header instead ISO 639-1 language code of the language the returned ticket should be in. See list of supported languages. |
Language selection is done through the use of Accept-Language header.
Response message
| Property | Type | Description |
|---|---|---|
| ticket.pdf | Ticket pdf document. |
Supported ticket languages
| Language | Code |
|---|---|
| English (default) | en |
| Slovenian | sl |
Get bus location
Request examples
curl -X GET
'https://apitest.nomago.dev/ticket/bus/location?trip_id=26'
-H 'Cache-Control: no-cache'
-H 'X-API-Authentication: <API AUTH TOKEN>'
200 Successful response example
{
"latitude": "46.38333180",
"longitude": "13.83333000",
"altitude": "2864",
"accuracy": "2",
"trip_id": "6",
"created": "2019-06-12 09:02:07"
}
200 Location not found response example
{
"error": "location_not_found",
"message": "No location found for provided trip"
}
Using this you can retrieve location of the bus on a trip
HTTP Request
GET https://apitest.nomago.dev/ticket/bus/location?trip_id=26
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| trip_id | int | Yes | Trip id, whose bus location should be returned |
Response message
| Parameter | Type | Description |
|---|---|---|
| trip_id | string | Trip id on which the location was recorded |
| latitude | string | GPS latitude |
| longitude | string | GPS longitude |
| altitude | string | GPS altitude in meters |
| accuracy | string | GPS accuracy in meters |
| created | string | Timestamp of record creation |
Cancel Ticket
Request examples
curl -X DELETE
https://apitest.nomago.dev/ticket/cancel
-H 'Content-Type: application/json'
-H 'X-API-Authentication: 8e962201c848d2c0306133c88c7fa08e'
-H 'cache-control: no-cache'
-d '{
"ticket_id":"1"
}'
200 Successful response example ("full" integration)
{
"voucher_id": "I70DYTBY",
"voucher_amount": 100.00,
"currency": "EUR"
}
200 Successful response example ("partner" integration)
{
"return_amount": 48.582,
"currency": "EUR"
}
For canceling a single ticket.
For "full" type integrations, a voucher is created and returned. For "partner" type integrations, the returned amount is deducted from total sales sum. This amount is returned in the response of this endpoint.
HTTP Request
DELETE https://apitest.nomago.dev/ticket/cancel
User authentication is required for this endpoint, only for 'full' integration.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticket_id | string | Yes | Ticket id |
| force | boolean | No | If set to true, a full 100% refund of this ticket will be attempted. READ BELOW |
Ticket cancellation with full refund
Ticket cancellation with full 100% refund is only available on a per partner basis after being agreed upon with Nomago sales and IT departments. When enabled, ticket cancellation with full 100% refund is only possible within the first 30 minutes after order finalization. If a full refund cancellation request is made and not all requirements are met, the cancellation will be made using the standard cancellation policy. The amount returned is to be considered as the real refund amount, that will also be present on the end of month sales reports and invoices.
Response message (full)
| Property | Type | Description |
|---|---|---|
| voucher_id | string | Voucher id. Used as form of payment when creating new reservations. |
| voucher_amount | float | Amount on voucher. |
| currency | string | Currency of the voucher. |
Response message (partner)
| Property | Type | Description |
|---|---|---|
| return_amount | float | Amount on voucher. |
| currency | string | Currency of the voucher. |
Get map
Request examples
curl -X GET
'https://apitest.nomago.dev/ticket/map?ticket_id=1001'
-H 'Cache-Control: no-cache'
-H 'X-API-Authentication: <API AUTH TOKEN>'
200 Successful response example
{
"url": "https://nomago.nomago.io/bus-tracker?t=a1944cbee7e955aa170b63827f0cece0"
}
200 Ticket id not found response example
{
"error": "ticket_not_found",
"message": "Ticket not found"
}
Using this you can get url to display map with bus location on it.
HTTP Request
GET https://apitest.nomago.dev/ticket/map?ticket_id=1001
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticket_id | int | Yes* | Ticket id (*Required if ticket_number is not provided) |
| ticket_number | string | Yes* | Ticket number (*Required if ticket_id is not provided) |
Response message
| Parameter | Type | Description |
|---|---|---|
| url | string | Url to display map with bus. |
Get ticket map data
Request examples
curl -X GET
'https://apitest.nomago.dev/ticket/map/data?ticket_id=1001'
-H 'Cache-Control: no-cache'
-H 'X-API-Authentication: <API AUTH TOKEN>'
200 Successful response example
{
"id":"91",
"name":"Zagreb - Munich",
"departure_time":"2020-01-07 14:30",
"arrival_time":"2020-01-08 05:00",
"start":{
"id":"60",
"route_id":"6",
"station_id":"171",
"sequence":"1",
"key_station":"1",
"station":{
"id":"171",
"name":"Zagreb Bus Station",
"country_id":"1",
"city_id":"31863",
"address":"Avenija Marina Dr\u017ei\u0107a 4",
"phone":"+385994357120",
"email":"glavni.prometnik@zgh.hr, service@eurolines.de, nomago@getbybus.com",
"latitude":"45.80362370",
"longitude":"15.99359880",
"website":"",
"enabled":"1",
"google_id":"a0a349af6f50e6b69a4a76f194d799fd42745178",
"created_by":"1",
"created":"2019-10-03 16:12:15",
"updated":"2019-10-24 12:14:43",
"timezone":"Europe/Zagreb",
"city":"Zagreb",
"country":"Croatia"
},
"departure_time":"07.01.2020 at 14:30"
},
"end":{
"id":"67",
"route_id":"6",
"station_id":"15157",
"sequence":"8",
"key_station":"2",
"station":{
"id":"15157",
"name":"Munich ZOB",
"country_id":"9",
"city_id":"9529",
"address":"Arnulfstra\u00dfe 21",
"phone":"+4908945209890, +385994357120",
"email":"Robert.Heitmair@brk-muenchen.de, muenchen@eurolines.de, service@eurolines.de, nomago@getbybus.com",
"latitude":"48.14239700",
"longitude":"11.54981540",
"website":"",
"enabled":"1",
"google_id":"aba0c9a7aee3724449e99adf8dd75e4cdb54b92b",
"created_by":"1",
"created":"2019-10-03 16:14:26",
"updated":"2019-10-24 12:14:43",
"timezone":"Europe\/Berlin",
"city":"Munich",
"country":"Germany"
},
"arrival_time":"07.01.2020 at 05:00"
},
"status":true,
"real_data":{
"arrival_time":"07.01.2020 18:46",
"distance_left":195,
"station_name":"Budapest N\u00e9pliget",
"latitude":46.54933929,
"longitude":17.21542931,
"running_late":"-00:23:01"
},
"stops":[
{
"name":"Zagreb Bus Station",
"latitude":45.8036237,
"longitude":15.9935988
},
...
]
}
Using this you can get trip data to display map with bus location on it, tied to a specific ticket_id or ticket_number
HTTP Request
GET https://apitest.nomago.dev/ticket/map/data?ticket_id=1001
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| ticket_id | int | Yes* | Ticket id (*Required if ticket_number is not provided) |
| ticket_number | string | Yes* | Ticket number (*Required if ticket_id is not provided) |
Response message
| Parameter | Type | Description |
|---|---|---|
| status | boolean | True, if tracking data is available and present in the response. False othervise |
| id | string | Trip id |
| name | string | Trip name |
| departure_time | string(datetime) | Departure datetime |
| arrival_time | string(datetime) | Arrival datetime |
| start | object | Start trip stop |
| end | object | End trip stop |
| real_data | object | Real time bus location data |
| real_data.arrival_time | string(datetime) | Predicted arrival time |
| real_data.distance_left | int | Distance to next stop in kilometers |
| real_data.station_name | string | Name of the next station |
| real_data.latitude | float | Latitude |
| real_data.longitude | float | Longitude |
| real_data.running_late | string(time) | Signed time string, presenting predicted delay/advantage of the bus. |
Errors
Error code example
{
"error": "invalid_email",
"message": "User with this email does not exist!"
}
Transactional api errors (invalid login email/password,...) are returned through a HTTP 200 response with content type application/json. The response json will contain the following fields describing the error:
| Property | Type | Description |
|---|---|---|
| error | string | Error code |
| message | string | Error description |
| description | string | Additional error description when required. |
Network errors
Error codes for network endpoints
Search station errors
| error | message |
|---|---|
| min_length | Minimal search term length is 3 characters. |
| param_missing | Required param is missing. |
Search city errors
| error | message |
|---|---|
| min_length | Minimal search term length is 3 characters. |
| param_missing | Required param is missing. |
Search trip errors
| error | message |
|---|---|
| location_type_invalid | Location type is invalid. |
| param_missing | Required param is missing. |
| departure_date | Departure date must be current day or in future. |
Get trip data errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| non_exist | Trip does not exist. |
Get stations errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| non_exist | Trip does not exist. |
Get minimal price errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| price_unavailable | Price for this station pair doesn not exist or is not set. |
Reservation errors
Error codes for reservation endpoints
Trip add errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| wrong_request_method | Non allowed method request used. |
| not_available | Trip is not available any more. |
| passenger_number | Number of passengers must be same as for previously added trips. |
| trip_already_added | This trip is already added to this reservation token. |
| reservation_expired | This reservation has expired. |
| undefined_reservation | There was a problem while creating reservation. Please try again. |
| no_free_seats | There is no free seats left for this departure. |
Remove trip errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| wrong_request_method | Non allowed method request used. |
| trip_not_added | This trip is not added to this reservation token. |
| reservation_invalid | This reservation token does not exist or is expired. |
Add passenger data errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| passenger_id_missing | Field passenger_id is a required for each passenger. |
| birthdate_missing | Birthdate is required param for children passengers. |
| passengers_missing | Passenger array is empty. |
| invalid_price_group | Price group is not allowed for this passenger type. |
| invalid_reservation | Reservation does not exist. |
| wrong_request_method | Non allowed method request used. |
Get passenger data errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| no_passengers_set | Passengers array is empty. |
| reservation_expired | This reservation has expired. |
Get bus layout errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| invalid_reservation | Reservation does not exist. |
| non_exist | Trip does not exist. |
Book passenger seat errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| wrong_request_method | Non allowed method request used. |
| non_exist | Trip does not exist. |
| invalid_reservation | Reservation does not exist. |
| no_seats_left | No seats left on this trip. |
| category_missmatch | Category of seat does not match. |
| another_passenger_taken | Seat reserved for another passenger on this reservation. |
| seat_taken | Seat is taken. |
Remove passenger seat errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| wrong_request_method | Non allowed method request used. |
| non_exist | Trip does not exist. |
| seat_not_matching | Passenger does not have a seat reservation for this connection. |
| category_missmatch | Category of seat does not match. |
| no_seat_reservations | Passenger does not have any seat reservations. |
| wrong_passenger_id | Seat does not belong to passenger_id. |
Get Reservation data errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| invalid_reservation | Reservation does not exist. |
Ancillaries errors
Error codes for ancillaries endpoints
Get ancillary offers errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| wrong_request_method | Non allowed method request used. |
| invalid_reservation | Reservation does not exist. |
Add ancillaries errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| wrong_request_method | Non allowed method request used. |
| invalid_reservation | Reservation does not exist. |
| left_less | There is not enough of this offer left to fullfill this demand. |
| invalid_passenger | Passenger with that ID does not exist. |
| limit_breached | Trying to add more than limit per passenger allows. |
| offer_unavailable | Offer not available anymore. |
Remove ancillaries errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| wrong_request_method | Non allowed method request used. |
| invalid_reservation | Reservation does not exist. |
| ancillary_non_exist | Ancillary was not found as added for this passenger. |
Order errors
Error codes for order endpoints
Finalize order errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| invalid_reservation | Invalid reservation token. |
| reservation_completed | Reservation is already completed. |
| reservation_expired | Reservation has expired. |
| passenger_details_missing | Some passenger details are missing. |
| bad_token | Tickets are not saved, there is a problem in reservation token. |
Get order errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| invalid_reservation | Invalid reservation token. |
| order_non_exist | Order does not exist. |
Cancel order errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| cancel_failed | Order cancelation failed. |
| tickets_not_canceled | Array holding tickets that were not canceled and reasons why. |
Add Voucher errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| voucher_already_added | One voucher has already been added to this reservation. |
| voucher_used | Voucher is already used and not valid anymore. |
| voucher_invalid | Voucher is invalid/does not exist. |
Remove Voucher errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| no_voucher | No voucher added to this reservation. |
| voucher_no_match | Voucher id doesnt match the voucher added to this reservation. |
Ticket errors
Error codes for ticket endpoints
Get ticket errors
| error | message |
|---|---|
| ticket_not_found | The requested ticket either doesn't exits or does not belong to the authenticated user. |
Send ticket as gift errors
| error | message |
|---|---|
| invalid_email | User with this email does not exist! |
| invalid_target_user | Provided target user can't be the same as authenticated user! |
| ticket_not_found | The requested ticket either doesn't exits or does not belong to the authenticated user. |
| invalid_gift_ticket | The requested ticket can\'t be sent as a gift, as it has already been used!' |
Cancel ticket errors
| error | message |
|---|---|
| param_missing | Required param is missing. |
| invalid_customer | Invalid customer authentication. |
| cancel_failed | Ticket cancelation failed. |
User errors
Error codes for user endpoints
User register complete errors
| error | message |
|---|---|
| token_invalid | Token is invalid or expired! |
| gms_format_invalid | Gsm must consist of '+' sign, 1-3 digit country code, and a national gsm number without a leading zero. The whole string must be between 11 & 16 characters long. Example: +38612345678 |
User login errors
| error | message |
|---|---|
| invalid_email | User with this email does not exist! |
| invalid_password | Invalid password! |
| fb_missing_email | Fb user did not allow fetching his email. |
User reset password errors
| error | message |
|---|---|
| invalid_email | User with this email does not exist! |
User new password errors
| error | message |
|---|---|
| token_invalid | Token is invalid or expired! |
User update profile errors
| error | message |
|---|---|
| bad_address_params | |
| gms_format_invalid | Gsm must consist of '+' sign, 1-3 digit country code, and a national gsm number without a leading zero. The whole string must be between 11 & 16 characters long. Example: +38612345678 |
| bad_dob_format | The format of date_of_birth is invalid! |
Driver errors
Error codes for driver endpoints
Driver login errors
| error | message |
|---|---|
| invalid_email | User with this email does not exist! |
| invalid_password | Invalid password! |
Driver reset password errors
| error | message |
|---|---|
| invalid_email | User with this email does not exist! |
| no_gsm_found | Driver's gsm not found in system! |
| invalid_gsm_on_record | Driver's gsm is not a valid gms number. |
| sms_sending_failed | Sms sending failed! |
Driver new password errors
| error | message |
|---|---|
| token_invalid | Token is invalid or expired! |
Driver respond to order errors
| error | message |
|---|---|
| invalid_driver_order | No order with the provided id, belonging to the authenticated driver, was found. |
| invalid_driver_order_status | Driver order status does not allow changes at this time. |
Driver accept ticket errors
| error | message |
|---|---|
| ticket_used | The requested ticket has already been used. |
| ticket_canceled | The requested ticket has been canceled. |
| invalid_ticket_trip | This driver is not assigned to the ticket's trip. |
| ticket_not_found | The requested ticket doesn't exist. |
Definitions
Object definitions
Reservation
| Property | Type | Description |
|---|---|---|
| token | string | Token for reservation. Used in passenger and order calls. |
| expires | timestamp | Defines timestamp when the discount will expire. |
| timezone | string | Timezone of expires timestamp. |
| is_expired | bool | Defines if the reservation has expired. |
| completed | bool | Defines if all passenger details are filled. |
| customer_id | int | Customer unique ID, returned only if reservation is attached to logged in customer. |
Pricing
| Property | Type | Description |
|---|---|---|
| cart | array | Array of cart items added in cart from current selection of reservation. |
| total_price | float | Total price for all selected trips for number of passengers requested, without discount and voucher included. |
| paypable_amount | float | Amount that needs to be paid on the checkout. Includes discount and voucher amounts. |
| voucher_amount | float | If valid voucher added, displays amount of voucher that is taken of the total_price. |
| discount_amount | float | If a price_group has been selected for any of the passengers, this field will display the total amount of discount that is taken of the total_price in order. |
| currency | string | Currency that was used to calculate prices. ISO 4217 currency code. |
Cart Item
| Property | Type | Description |
|---|---|---|
| trip_uid | string | Identifies to which trip this cart item belongs to. |
| type | string | Type of cart item |
| price | float | Price of item with applied discounts in case of price_groups. |
| passenger_type | string | Type of passenger, can be adult or children. |
| passenger_id | int | Defines to which passenger this item belongs to. |
Seating
| Property | Type | Description |
|---|---|---|
| category | string | Type of category seat belongs to. |
| seat_number | string | Seat identification number. |
| passenger_id | int | Passenger ID. |
| reservation_cost | float | Price for seat reservation, denominated in currency selected for trip. |
PassengerData
| Property | Type | Description |
|---|---|---|
| passengers | array | Array of Passenger objects |
Passenger
| Property | Type | Description |
|---|---|---|
| first_name | string | Passenger first name. |
| last_name | string | Passenger last name. |
| phone | string | Passenger phone number. |
| string | Passenger e-mail address. | |
| type | string | Type of passenger, can be adult or children. |
| birthdate | string | Birth date of passenger, only required for children passenger. |
| passenger_id | int | Id of the passenger you want to update. |
| price_group | string | Not required, only if a price group is available and passenger is eligible for it. After setting price group for passenger, to unset it, update passenger with no value set in this field. |
Seat
| Property | Type | Description |
|---|---|---|
| seat_number | int | Number of seat in the bus. |
| price | float | Price of the seat in trip selected currency. |
| current_reservation | bool | Defines if the seat is taken in current reservation. |
| available | bool | Shows if seat is free or taken. |
| category | string | Category of seat. |
| seat_label | string | Label of seat on the bus. |
| row | int | Number of row on the bus. |
| column | int | Defines column of the seat on bus. |
| taken_as_empty | bool | If the seat is sold as empty. |
| reservation_cost | float | Price of seat reservation in trip selected currency. Used for Book passenger seat. |
Trip
JSON example
{
"trip_uid": "direct:2ba5bbe6deadbab839bf5468224bd694:2019-06-16",
"from": {
"id": 109,
"name": "Autobusni kolodvor Novigrad",
"address": "Murve 15",
"city": "Novigrad",
"country": "Croatia",
"location": "45.3188, 13.5683"
},
"to": {
"id": 375,
"name": "Avtobusna Postaja Ljubljana",
"address": "Trg Osvobodilne fronte 4",
"city": "Ljubljana",
"country": "Slovenia",
"location": "46.0577, 14.5095"
},
"departure": {
"time": "2019-06-16 04:50:00",
"timezone": "Europe/Zagreb"
},
"arrival": {
"time": "2019-06-16 07:50:00",
"timezone": "Europe/Ljubljana",
"next_day": false
},
"transborder": true,
"duration": 10800,
"distance": 167,
"stops": 2,
"currency": "EUR",
"type": "direct",
"category": {
"premium": {
"capacity": 12,
"free_seats": 12,
"adult_price": 12.64
},
"economy": {
"capacity": 32,
"free_seats": 24,
"adult_price": 10.99
},
"family": {
"capacity": 8,
"free_seats": 8,
"adult_price": 11.87
}
},
"prices": {
"economy": [
{
"id": "normal",
"title": "Normal ticket",
"price": 19.99
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 9.8
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 13.79
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 15.59
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 15.79
}
],
"family": [
{
"id": "normal",
"title": "Normal ticket",
"price": 21.59
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 10.58
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 14.9
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 16.84
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 17.06
}
],
"premium": [
{
"id": "normal",
"title": "Normal ticket",
"price": 22.99
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 11.27
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 15.86
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 17.93
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 18.16
}
]
},
"currency": "EUR",
"link": "https://tickets.intercity.nomago.eu/web/search/intercept?from_id=109&to_id=375&type=oneway&departure_date=2019-06-16&adults=1&children=0&comfort=&from_name=Autobusni%20kolodvor%20Novigrad&to_name=Avtobusna%20Postaja%20Ljubljana"
}
| Property | Type | Description |
|---|---|---|
| trip_uid | string | Connection unique id. |
| from | array | Detailed information on departure station. |
| to | array | Detailed information on arrival station. |
| departure | array | Departure time , format Y-m-d H:i:s. |
| arrival | array | Arrival time , format Y-m-d H:i:s. |
| transborder | bool | Displays if the trip is crossing country borders. |
| duration | int | Duration of the trip in seconds. |
| stops | int | Number of stops during the trip. |
| currency | string | Currency used for the prices, ISO 4217 format. |
| category | array | Array with available categories with capacity left and prices for each of the categories. |
| prices | array | Array with available price groups. |
| connections | array | Array with data for each interconnection on this trip. Only returned if trip type is inter. |
| type | string | Trip type: 'direct'/'inter' |
| currency | string | Defines default currency of trip. |
| link | string | Affiliate link to Nomago website search. |
Station
| Property | Type | Description |
|---|---|---|
| id | int | Station id |
| name | string | Station name |
| address | string | Station address |
| city | string | City name |
| country | string | Country name |
| location | string | GPS coordinates |
Category
| Property | Type | Description |
|---|---|---|
| capacity | int | Total category capacity |
| free_seats | int | Remaining free seats in this category |
| adult_price | float | Seat price in this category. |
Trip data
JSON example
{
"trip_uid": "direct:c4c2cc067956c6c329e2e0d75e6164ca:2019-07-25",
"type": "direct",
"departure": {
"departure_time": "2019-07-25 23:15:00",
"departure_station": {
"id": 171,
"station_name": "Zagreb Bus Station",
"address": "Avenija Marina Držića 4",
"latitude": 45.8036,
"longitude": 15.9936,
"city": "Zagreb",
"asciiname": "Zagreb",
"city_id": 31863,
"country": "Croatia",
"cc": "HR",
"country_id": 1,
"platform": "201"
}
},
"arrival": {
"arrival_time": "2019-07-26 13:45:00",
"arrival_station": {
"id": 15157,
"station_name": "Munich ZOB",
"address": "Arnulfstraße 21",
"latitude": 48.1424,
"longitude": 11.5498,
"city": "Munich",
"asciiname": "Munich",
"city_id": 9529,
"country": "Germany",
"cc": "DE",
"country_id": 9,
"platform": "101"
}
},
"duration": "52200",
"distance": "1097574",
"prices": {
"economy": [
{
"id": "normal",
"title": "Normal ticket",
"price": 19.99
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 9.8
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 13.79
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 15.59
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 15.79
}
],
"family": [
{
"id": "normal",
"title": "Normal ticket",
"price": 21.59
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 10.58
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 14.9
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 16.84
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 17.06
}
],
"premium": [
{
"id": "normal",
"title": "Normal ticket",
"price": 22.99
},
{
"id": "children_0_2",
"title": "Children 0-2",
"price": 11.27
},
{
"id": "children_2_12",
"title": "Children 2-12",
"price": 15.86
},
{
"id": "students_12_26",
"title": "Students 12-26",
"price": 17.93
},
{
"id": "retired_65",
"title": "Retired 65+",
"price": 18.16
}
]
},
"currency": "EUR"
}
| Property | Type | Description |
|---|---|---|
| trip_uid | string | Connection unique id. |
| type | string | Trip type: 'direct'/'inter' |
| departure | array | Detailed information on departure. |
| arrival | array | Detailed information on arrival. |
| departure.departure_station | array | Departure station information. |
| arrival.departure_station | array | Arrival station information. |
| duration | int | Duration of the trip in seconds. |
| currency | string | Currency used for the prices, ISO 4217 format. |
| prices | array | Array with available price groups. |
| currency | string | Defines default currency of trip. |
| interconnections | array | Array with data for each interconnection on this trip. Only returned if trip type is inter. |
Ancillary
| Property | Type | Description |
|---|---|---|
| ancillary_id | int | Identification for ancillary offer. |
| price | float | Price for ancillary offer in EUR. |
| limit_per_passenger | int | Defines limit on how many can be selected per passenger. |
| max_available | int | Displays how much of this ancillary is left available. |
| name | string | Ancillary name. |
| description | string | Detailed info on ancillary offer. |
Selected Ancillary
| Property | Type | Description |
|---|---|---|
| name | string | Ancillary name. |
| ancillary_id | int | Identification for ancillary offer. |
| price | float | Price for total amount of this ancillary in EUR. |
| amount | int | Number of this ancillary selected for this passenger. |
| passenger_id | int | Id of passenger this ancillary is tied to. |
Order
Order response object example
{
"id": "843ff39ac2a444496ddd61449337ec28",
"bruto_price": "8.99",
"total_price": "8.99",
"neto_price": "8.99",
"voucher_amount": "0.00",
"tax": "0.00",
"currency": "EUR",
"created": "2019-08-08 09:43:32",
"order_number": "1065-1-2-2019",
"download_hash": "62ad3f163029ce2e069ed56a08bff648",
"cancellation": {
"canceled": false,
"cancellable": true,
"return_type": "cashback",
"return_amount": 8.09
},
"status": true
}
| Property | Type | Description |
|---|---|---|
| id | string | Order ID. |
| total_price | float | Total price that was charged. |
| bruto_price | string | Full amount of order |
| neto_price | string | Payable amount of order |
| tax | string | Total tax on the order [NOT YET ACCURATE] |
| voucher_amount | string | Amount used in the voucher |
| status | bool | Defines if order finalization is successful. |
| download_hash | string | Used for retrieving and downloading tickets. |
| currency | string | Currency in which the order was processed |
| created | string | Order creation timestamp |
| order_number | string | User friendly order id |
| cancellation | object | Object containing order cancellation info |
| cancellation.canceled | boolean | Is the order canceled |
| cancellation.cancellable | boolean | Can the order be canceled |
| cancellation.return_type | string | "cashback" or "voucher", depending on how the order was created. Partner integration orders only support cashback returns. |
| cancellation.return_amount | float | Amount returned if the order would get canceled. This is based on the time remaining till departure and can change accordingly. |
Station
| Property | Type | Description |
|---|---|---|
| id | int | Station id |
| station_name | string | Name of the station |
| latitude | string | Latitude of station |
| longitude | string | Longitude of station |
| city | string | Name of the city where station is located |
| country | string | Country name |
| departure_time | string | Departure time from station, format HH:ii:ss. |
| arrival_time | string | Arrival time into station, format HH:ii:ss. |
| timezone | string | Timezone in which station is located |
| waiting_time | int | Transfer time between two lines in seconds. |
| is_transfer | bool | Determines if the station is gonna be transfer. |
Ticket
Ticket JSON example
{
"ticket": {
"id": 1147,
"to": {
"cc": "SI",
"id": 375,
"city": "Ljubljana",
"name": "Ljubljana Bus station",
"address": "Trg Osvobodilne fronte 4",
"country": "Slovenia",
"latitude": 46.057701110839844,
"platform": null,
"longitude": 14.509499549865723
},
"gsm": "+386234234",
"from": {
"cc": "HR",
"id": 171,
"city": "Zagreb",
"name": "Zagreb Bus Station",
"address": "Avenija Marina Držića 4",
"country": "Croatia",
"latitude": 45.8036003112793,
"platform": "1,2",
"longitude": 15.993599891662598,
"interchangeable": false
},
"type": "adult",
"used": "0",
"email": "anze.kozar@nomago.si",
"price": 66.96,
"arrival": {
"time": "2019-11-09 07:35:00",
"timezone": "Europe/Ljubljana"
},
"created": "2019-11-06 00:22:58",
"trip_id": 16,
"canceled": "0",
"category": "economy",
"currency": "HRK",
"duration": 8400,
"trip_uid": "direct:0e7d5091e84ed3ed214cda290d144f30:2019-11-09",
"departure": {
"time": "2019-11-09 05:15:00",
"timezone": "Europe/Zagreb"
},
"full_name": "Mister Nomago",
"last_name": "Nomago",
"transfers": [],
"first_name": "Mister",
"seat_number": "41",
"passenger_id": 0,
"checksum_hash": "1b695696ae89bc7e877ccef8370143fa",
"ticket_number": "1573000925",
"country_legs": [
{
"length": "27190",
"country_id": "1",
"percentage": "0.196969",
"cardinality": "1",
"total_length": "138042",
"is_transit": "1",
"country_name": "Croatia",
"country_code": "HR"
},
{
"length": "110852",
"country_id": "4",
"percentage": "0.803031",
"cardinality": "2",
"total_length": "138042",
"is_transit": "1",
"country_name": "Slovenia",
"country_code": "SI"
}
],
"interconnections": []
}
}
| Parameter | Type | Description |
|---|---|---|
| id | int | Ticket id |
| order_id | string | Id of the order this ticket was purchased through |
| type | string | Ticket type |
| used | string | 0/1 indicating if this ticket has already been used |
| canceled | string | 0/1 indicating if this ticket has been canceled |
| canceled_at | string(datetime) | Date when this ticket was canceled, null if it is not canceled |
| refund_amount | float | If ticket is canceled, this field will display the amount that has been refunded at cancellation |
| price | int | Ticket price |
| amount_paid | float | Amount that was actually paid for this ticket. This value can differ from the price field if a voucher was used on the order. |
| currency | string | Ticket price currency |
| category | string | Ticket category |
| duration | int | Trip duration in seconds |
| seat_number | string | Seat number on the bus |
| first_name | string | First name on the ticket |
| last_name | string | Last name on the ticket |
| gsm | string | Passenger gms |
| trip_id | int | Id of the trip this ticket is for |
| trip_uid | string | Unique trip identifier |
| checksum_hash | string | Ticket unique hash. |
| created | string | Ticket creation time in the format YYYY-MM-DD hh:ii:ss |
| from.id | int | Departure station id |
| from.name | string | Departure station name |
| from.address | string | Departure station address |
| from.city | string | Departure city name |
| from.country | string | Departure country name |
| from.cc | string | Alpha-2 country code |
| from.platform | string | Possible platform numbers for departure. null if no platforms are specified for this station |
| from.latitude | float | Station latitude |
| from.longitude | float | Station longitude |
| from.interchangeable | boolean | Is passenger transferring from an interconnection |
| to.id | int | Arrival station id |
| to.name | string | Arrival station name |
| to.address | string | Arrival station address |
| to.city | string | Arrival city name |
| to.country | string | Arrival country name |
| to.cc | string | Alpha-2 country code |
| to.platform | string | Possible platform numbers for arrival. null if no platform are specified for this station |
| to.latitude | float | Station latitude |
| to.longitude | float | Station longitude |
| departure.time | string | Departure time in the format YYYY-MM-DD hh:ii:ss |
| departure.timezone | string | Departure timezone name |
| arrival.time | string | Arrival time in the format YYYY-MM-DD hh:ii:ss |
| arrival.timezone | string | Arrival timezone name |
| ticket_number | string | Ticket number. This is encoded into QR/Barcodes. |
| country_legs | array | Ticket trip country legs, containing the info on how much of the trip will be made in different countries. |
| ancillaries | array | Ticket ancillaries |
| seats | array | Ticket seat |
Country leg
{
"length": "219871",
"country_id": "6",
"percentage": "0.8975",
"cardinality": "1",
"total_length": "244982",
"is_transit": "1",
"country_name": "Austria",
"country_code": "AT",
"vat_amount": 2.5,
"vat_percentage":9.5,
"gross_amount":9.99
}
| Parameter | Type | Description |
|---|---|---|
| length | string | Leg distance in meters |
| country_id | string | Country id in intercity API |
| percentage | string | Percentage of the whole trip distance made in this country leg, represented as a float: 1 = 100%, 0.5 = 50% |
| cardinality | string | Cardinality of the trip country leg. |
| total_length | string | Total trip distance in meters |
| is_transit | string | 0 if both departure and arrival stations are in this country, 1 otherwise |
| country_name | string | Full country name |
| country_code | string | Country code |
| vat_amount | float | VAT amount for this country leg |
| vat_percentage | float | VAT rate for this country leg |
| gross_amount | float | Gross amount charged for this country leg |
Ancillary
{
"ticket_id": 1154,
"amount": 1,
"price": 3,
"voucher_amount": 0,
"amount_paid": 3,
"order_id": "13d68799160ea0122ca3414b445640b9",
"created": "2019-11-29 10:52:27",
"canceled": 0,
"canceled_at": null,
"refund_amount": 0,
"refund_type": null,
"updated": "2019-11-29 10:52:27",
"name": "Luggage",
"description": "Aditional luggage (80x50x30 cm, max 160 cm, max 20 kg)"
}
| Parameter | Type | Description |
|---|---|---|
| ticket_id | int | Id of the ticket this ancillary belongs to |
| amount | int | Amount of ancillary items included |
| price | float | Full price for 1 piece of this ancillary |
| voucher_amount | float | Amount of voucher used on this ancillary purchased |
| amount_paid | float | Amount actually paid by the customer (price*amount)-voucher_amount |
| order_id | string | Id of the order this ancillary was purchased on |
| created | string(datetime) | Creation date and time |
| canceled | int | 0/1 Indicating if this ancillary is canceled |
| canceled_at | string(datetime) | Date and time of cancellation |
| refund_amount | float | Amount refunded at cancellation |
| updated | string(datetime) | Last time this ancillary was updated |
| name | string | Ancillary name |
| description | string | Ancillary description |
Seat
{
"seat_id": 48,
"ticket_id": 1154,
"price": 0,
"voucher_amount": 0,
"amount_paid": 0,
"order_id": "13d68799160ea0122ca3414b445640b9",
"canceled": 0,
"canceled_at": null,
"refund_amount": 0,
"created": "2019-11-29 10:52:27"
}
| Parameter | Type | Description |
|---|---|---|
| seat_id | int | Seat number |
| ticket_id | int | Id of the ticket this ancillary belongs to |
| price | float | Full price for 1 piece of this ancillary |
| voucher_amount | float | Amount of voucher used on this ancillary purchased |
| amount_paid | float | Amount actually paid by the customer price-voucher_amount |
| order_id | string | Id of the order this ancillary was purchased on |
| created | string(datetime) | Creation date and time |
| canceled | int | 0/1 Indicating if this ancillary is canceled |
| canceled_at | string(datetime) | Date and time of cancellation |
| refund_amount | float | Amount refunded at cancellation |
Full Order
{
"id": "13d68799160ea0122ca3414b445640b9",
"bk_order": "1141-1-2-2019",
"full_price": 18.99,
"voucher": 0,
"discount": 0,
"amount_paid": 18.99,
"currency": "EUR",
"created": "2019-11-29 10:52:27",
"canceled": false,
"canceled_at": null,
"payment_method": null,
"updated": "2019-11-29 10:53:02",
"refund_amount": 0,
"invoice": {invoice},
"tickets": [
{ticket},
{ticket}
]
}
| Parameter | Type | Description |
|---|---|---|
| id | string | Order id |
| bk_order | string | User friendly order number |
| full_price | float | Full order price |
| voucher | float | Voucher amount used on this order |
| discount | float | |
| amount_paid | float | Actual amount paid by the customer |
| currency | string | Order currency |
| created | string(datetime) | Date and time of order creation |
| canceled | int | 0/1 indicating if the order is canceled or not |
| canceled_at | string(datetime) | Date and time when this order was canceled |
| payment_method | string | Payment method used to pay for this order. Possible values are "cash","card","credit_card". null if payment method is not recorded |
| updated | string(datetime) | Date and time when this order was last updated |
| refund_amount | float | Amount refunded at cancellation |
| invoice | object | null if it does not exist, otherwise an Invoice object |
| tickets | array | Array of ticket objects |
Invoice
{
"number": "INTC01190000000000114",
"created": "2019-11-29 10:52:27",
"amount_full": 18.99,
"order_id": "13d68799160ea0122ca3414b445640b9",
"zoi": "29083c477575d2ed3b9b21589fafbdfa",
"eor": "1c6aaf94-30e0-4730-bf26-ba5d2fc83dee",
"issued_to": "Mister Nomago",
"issued_to_vat_id": null,
"issued_to_vat_name": null,
"currency": "EUR"
}
| Parameter | Type | Description |
|---|---|---|
| number | string | Invoice number |
| created | string(datetime) | Date and time of creation |
| amount_full | float | Full invoice amount |
| order_id | string | Id of the order this invoice was issued for |
| zoi | string | ZOI Fiscal validation string |
| eor | string | EOR Fiscal validation string |
| issued_to | string | Name of the customer |
| issued_to_vat_id | string | VAT id this invoice is issued to. (Only present in case the customer requested an invoice with a VAT id) |
| issuead_issued_to_vat_name | string | Name of the VAT entity this invoice is issued to. (Only present in case the customer requested an invoice with a VAT id) |
| currency | string | Currency of the invoice |
Ticket QR codes and barcodes
QR
QR code payload example
{
"ticket_number": "1234567890"
}
Each printed ticket must include a QR code that encodes ticket data. The encoded data is a JSON object containing the following fields:
| Parameter | Type | Description |
|---|---|---|
| ticket_number | string | Ticket number. This is encoded into QR/Barcodes. |
In addition to the ticket_number being encoded into the QR code, it must also be present and displayed in a human readable way on the printed ticket itself or any apps that display the tickets.
Barcode
In cases where only barcodes can be printed, they should encode the raw ticket_number field data. Barcodes should be in the Code 128 format, to ensure Nomago driver app is able to scan them.
In addition to the ticket_number being encoded into the barcode, it must also be present and displayed in a human readable way on the printed ticket itself or any apps that display the tickets.
Changelog
February 19, 2020
- Added Available Trip Interconnections endpoint
January 24, 2020
- Added 100% refund order cancellation option to /order/cancel endpoint
January 8, 2020
- Added new endpoint /ticket/map/data, for retrieving map data of ticket trip, along with bus delay and location
November 29, 2019
- Added new endpoint GET /order that returns full order details
- Expanded the ticket response object to include:
- ancillaries array
- seats array
- added vat amounts and percentages to country legs
- added order_id, amount_paid, refund_amount, canceled_at fields
November 26, 2019
- Added new endopoint get incoming buses for station users only
November 15, 2019
- Added country_name field to station objects
November 12, 2019
- Added this Changelog section to API Documentation
- Added platform numbers parameters to ticket response object and trip data response object
- Changed /order/get endpoint specification to be in line with endpoint version 2
- Endpoint response is now an object, compared to previously being an array
- "tickets" attribute's value changed from object to array, that contains all order tickets, compared to a non functioning combination of inbound/outbound arrays in version 1