NAV Navbar
Logo
cURL

Introduction

alt text

You can use our API to access Distribusion content and book bus rides. We have put a lot of thought into making it as easy as possible to integrate with us. Have fun and share your feedback with us!

When integrating and testing our API, please use the following URL:

https://api-demo.distribusion.com/retailers/v4

Deprecated APIs

Retailer API v2

Retailer API v3

Getting Started

When performing a booking through Distribusion API, there are multiple steps that are required. This section is dedicated to describe the standard flow, necessary for:

alt text

Integration Workflow

  1. (1-4 weeks) Integrate our API, using this documentation. If you have any questions, do not hesitate to write us at partner@distribusion.com

  2. (Up to 1 week) In order to get access to our production environment, we will first test the integration logic (from search to booking, and if implemented, cancellations) and the data mapping logic (stations associations to cities and airports). For this, we will require access to your demo environment, with all the necessary information to perform bookings (test payment credentials, etc).

  3. (Up to 2 week after launch) Once this is validated, we will provide you the production API key for you to start mapping stations on the production environment. A few weeks after your launch, we will have our customer experience team going through your integration and provide a full report to improve data mapping and overall L/B ratio.

  4. Later on, our team will get in touch with you in order to support your processes related to L/B ratio optimisation and overall customer journey: from searching to booking and after sales services.

Station Coding

Distribusion aims to standardize the station codes across the bus industry, the same way IATA did in the flight industry. Our station codes are designed to represent specific locations using a set of 8 capital letters. The construction of such code follow a simple logic:

Example

GB(Great Britain) + LON(London) + VSA(Victoria station) = GBLONVSA

Importing Master Data

The first step in the booking process, is collecting the stations and marketing carriers available through our API. To do so, we provide the #stations and #marketing_carriers endpoints. To retrieve station codes, simply send a GET request to our #stations endpoint, which will send you a list of the stations, with station codes and additional information concerning the stations (address, coordinates, associated city, etc). The #marketing_carriers endpoint provides you with additional information related to a specific marketing carrier; such as logos, contact details, cancellation policy, as well as the terms and conditions.

Currently our content can be fetch in English, French, Italian, Spanish, Dutch, Swedish, Bulgarian and German, with the following locale values: en, fr, it, es, nl, sv, bg and de.

Map Stations to Cities and Areas

{
    "id": "ESBCNBFT",
    "type": "stations",
    "attributes": {
        "code": "ESBCNBFT",
        "name": "Barcelona Airport T1",
        "description": "The stop is located in front of Terminal 1. ",
        "street_and_number": null,
        "zip_code": null,
        "longitude": 2.084151,
        "latitude": 41.298291,
        "time_zone": "Europe/Madrid"
    },
    "relationships": {
        "city": {
            "data": {
                "id": "ESBCN",
                "type": "cities"
            }
        },
        "area": {
            "data": {
                "id": "ESBCNBA",
                "type": "areas"
            }
        }
    }
},
{
    "id": "ESBCNBFU",
    "type": "stations",
    "attributes": {
        "code": "ESBCNBFU",
        "name": "Barcelona Airport T2",
        "description": "The stop is located in front of Terminal 2. ",
        "street_and_number": "El Prat de Llobregat, Barcelona",
        "zip_code": "08820",
        "longitude": 2.083273,
        "latitude": 41.297614,
        "time_zone": "Europe/Madrid"
    },
    "relationships": {
        "city": {
            "data": {
                "id": "ESBCN",
                "type": "cities"
            }
        },
        "area": {
            "data": {
                "id": "ESBCNBA",
                "type": "areas"
            }
        }
    }
}

Our API maps stations to cities, allowing you to easily groupe stations together when they belong to the same city. This is to facilite city to city search. We also recently introduced the notion of areas. An area is smaller than a city, represent multiple stations, and can only be attached to one city.

In the example bellow, Barcelona Airport is mapped with “Barcelona Airport T1” and “Barcelona Airport T2” stations, while the area and the stations are all mapped to Barcelona city. Bellow is an extract of our #stations endpoint response:

Code description:

For example, while searching from Barcelona Airport to Barcelona City, you could perform the following request:

https://api-demo.distribusion.com/retailers/v3/connections/find?departure_stations[]=ESBCNBFT&departure_stations[]=ESBCNBFU&arrival_stations[]=ESBCNNOR& arrival_stations[]=ESBCNZOB&arrival_stations[]=ESBCNEDA&arrival_stations[]=ESBCNPCA& arrival_stations[]=ESBCNSUR&arrival_stations[]=ESBCNPES&arrival_stations[]=ESBCNGVU& arrival_stations[]=ESBCNPDU&arrival_stations[]=ESBCNBFT&arrival_stations[]=ESBCNBFU& departure_date=2018-03-29&pax=1&currency=EUR&locale=en

Find Connections

After retrieving station codes, you can now start searching for connections by sending us GET requests to connections#find. We do not provide pairs of stations in order to allow our engine to learn from the consumers demand. By doing so, if a specific ride is highly requested but currently unavailable, you can be assured that it will be soon delivered through our API.

Passenger types

We also thrive to standardise passenger (ticket) types across multiple carriers, every time it is possible. Two carriers having the same definition of a ticket type, will have the same passenger type code. For example, every time a carrier have the same definition of an adult that an other carrier, they will both share the same passenger type code.

Confirm Price and Availability

As connections#find provides the cheapest adult price, it is some time necessary to confirm the price of specific passenger types by calling connections#vacancy. This call is also recommended prior to performing a booking, in order to ensure the prices and availability are still up to date.

Create an Order or a Booking

After gathering information on a specific connection and the passenger information, you can now send a booking request towards Distribusion’s API on bookings#create. You can also perform an order, and later retrieve it status by calling our orders#create endpoint. In case any information is missing, the API will recognise it and inform you accordingly.

Note: we currently support EUR, USD, GBP and CHF currencies.

Manage your Bookings

Once you start making bookings, you will certainly want to monitor them and sometime, if need be, cancel them. For this, we created a new feature, allowing you to retrieve a full list of your bookings: bookings#index. Once you have this list, you can call bookings#show for more details on a specific booking, or call cancellations#conditions and cancellations#create to cancel a booking.

Postman

Here’s a collection of sample queries in Postman that’ll help you get up to speed with our API faster.

Run in Postman

Authentication

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl  'https://api.distribusion.com/retailers/v4/#' \
      --header 'Accept: application/vnd.api+json' \
      --header 'Api-Key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI'

Make sure to replace H4gtqUn04qDh7mmZpFJYmmcW7JVw7hMIaCUcdWhZ’ with your API key.

Distribusion uses API keys to allow access to the API content and perform bookings. You can register a new Distribusion API key by contacting us at partner@distribusion.com.

Distribusion expects for the API key to be included in all API requests to the server in a header that looks like the following:

Api-Key:AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI

Connections

Find

curl -g -X GET \
  'https://api-demo.distribusion.com/retailers/v4/connections/find?departure_stations[]=FRLILBDT&departure_stations[]=FRLILCSA&departure_stations[]=FRLILGEU&departure_stations[]=FRLILGFA&departure_stations[]=FRLILZOB&arrival_stations[]=FRLYSAIR&arrival_stations[]=FRLYSDAR&arrival_stations[]=FRLYSIHO&arrival_stations[]=FRLYSPDB&arrival_stations[]=FRLYSPER&arrival_stations[]=FRLYSZOB&departure_date=2019-01-15&pax=1&locale=en&currency=EUR' \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json'

The above command returns JSON structured like this:

{
    "meta": {
        "locale": "en",
        "currency": "EUR"
    },
    "jsonapi": {
        "version": "1.0"
    },
    "included": [
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "EUSA"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                }
            },
            "id": "EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T13:45",
                "arrival_time": "2019-01-15T15:30"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "marketing_carriers",
            "relationships": {
                "passenger_types": {
                    "data": [
                        {
                            "type": "passenger_types",
                            "id": "PADX"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PBAB"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PCIN"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PEPE"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PYPO"
                        }
                    ]
                },
                "extra_types": {
                    "data": []
                }
            },
            "id": "EUSA",
            "attributes": {
                "trade_name": "Eurolines SA",
                "legal_name": "Eurolines SA",
                "code": "EUSA",
                "booking_fee": 0
            }
        },
        {
            "type": "operating_carriers",
            "id": "EUSA",
            "attributes": {
                "trade_name": "Eurolines SA",
                "legal_name": "Eurolines SA",
                "code": "EUSA"
            }
        },
        {
            "type": "operating_carriers",
            "id": "ISIL",
            "attributes": {
                "trade_name": "Isilines",
                "legal_name": "Isilines",
                "code": "ISIL"
            }
        },
        {
            "type": "passenger_types",
            "id": "PADX",
            "attributes": {
                "name": "Adults 26-59",
                "description": "",
                "code": "PADX"
            }
        },
        {
            "type": "passenger_types",
            "id": "PBAB",
            "attributes": {
                "name": "Children 0-4",
                "description": "",
                "code": "PBAB"
            }
        },
        {
            "type": "passenger_types",
            "id": "PCIN",
            "attributes": {
                "name": "Children 4-11",
                "description": "",
                "code": "PCIN"
            }
        },
        {
            "type": "passenger_types",
            "id": "PEPE",
            "attributes": {
                "name": "Seniors over 60",
                "description": "",
                "code": "PEPE"
            }
        },
        {
            "type": "passenger_types",
            "id": "PYPO",
            "attributes": {
                "name": "Youths 12-25",
                "description": "",
                "code": "PYPO"
            }
        },
        {
            "type": "stations",
            "relationships": {
                "city": {
                    "data": {
                        "type": "cities",
                        "id": "FRLIL"
                    }
                },
                "area": {
                    "data": null
                }
            },
            "id": "FRLILBDT",
            "attributes": {
                "zip_code": "59777",
                "time_zone": "Europe/Paris",
                "street_and_number": "Boulevard de Turin",
                "name": "Lille Boulevard de Turin",
                "longitude": 3.076675,
                "latitude": 50.638756,
                "description": "The bus stop is located at the south side of Lille Europe station, right on the Boulevard de Turin, near \"Suite Novotel\".",
                "code": "FRLILBDT"
            }
        },
        {
            "type": "cities",
            "id": "FRLIL",
            "attributes": {
                "name": "Lille",
                "code": "FRLIL"
            }
        },
        {
            "type": "stations",
            "relationships": {
                "city": {
                    "data": {
                        "type": "cities",
                        "id": "FRPAR"
                    }
                },
                "area": {
                    "data": null
                }
            },
            "id": "FRPARGBA",
            "attributes": {
                "zip_code": "93170",
                "time_zone": "Europe/Paris",
                "street_and_number": "Av. du Général de Gaulle 28",
                "name": "Paris Gallieni (Bagnolet)",
                "longitude": 2.414311,
                "latitude": 48.865442,
                "description": "Paris international bus station is located in the eastern part of the city, and is connected to the metro line M3. At the station, there is a taxi stand, a snack bar, and parking areas.",
                "code": "FRPARGBA"
            }
        },
        {
            "type": "cities",
            "id": "FRPAR",
            "attributes": {
                "name": "Paris",
                "code": "FRPAR"
            }
        },
        {
            "type": "stations",
            "relationships": {
                "city": {
                    "data": {
                        "type": "cities",
                        "id": "FRLYS"
                    }
                },
                "area": {
                    "data": null
                }
            },
            "id": "FRLYSPER",
            "attributes": {
                "zip_code": "69002",
                "time_zone": "Europe/Paris",
                "street_and_number": "Cours de Verdun Gensoul 14",
                "name": "Lyon Perrache SNCF Train Station",
                "longitude": 4.826788,
                "latitude": 45.749711,
                "description": "Central bus station of the center exchange of Lyon Perrache on the 1st floor Rhône Est side. Access to the platforms via Gallery D. Warning: Every departure between 12:30 a.m. and 4:45 a.m will take place at 30 Cours de Verdun Perrache 69002 Lyon in front of the \"Brasserie Georges\", less than 5 min walking from the bus station of Perrache, which is closed during this period.",
                "code": "FRLYSPER"
            }
        },
        {
            "type": "cities",
            "id": "FRLYS",
            "attributes": {
                "name": "Lyon",
                "code": "FRLYS"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-1"
        },
        {
            "type": "vehicle_types",
            "id": "BUS",
            "attributes": {
                "code": "BUS"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T17:00",
                "arrival_time": "2019-01-15T20:05"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "marketing_carriers",
            "relationships": {
                "passenger_types": {
                    "data": [
                        {
                            "type": "passenger_types",
                            "id": "PADX"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PBAB"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PCIN"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PEPE"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PYPO"
                        }
                    ]
                },
                "extra_types": {
                    "data": []
                }
            },
            "id": "ISIL",
            "attributes": {
                "trade_name": "Isilines",
                "legal_name": "Isilines",
                "code": "ISIL",
                "booking_fee": 0
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T14:15",
                "arrival_time": "2019-01-15T16:45"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T19:00",
                "arrival_time": "2019-01-15T21:30"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRCQFCVB"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T11:30",
                "arrival_time": "2019-01-15T13:30"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRCQFCVB"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T14:45",
                "arrival_time": "2019-01-15T20:05"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-2"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARGBA"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-2",
            "attributes": {
                "index": 2,
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "stations",
            "relationships": {
                "city": {
                    "data": {
                        "type": "cities",
                        "id": "FRCQF"
                    }
                },
                "area": {
                    "data": null
                }
            },
            "id": "FRCQFCVB",
            "attributes": {
                "zip_code": "62100",
                "time_zone": "Europe/Paris",
                "street_and_number": "Quai du Rhin",
                "name": "Calais Ville Bus Stop",
                "longitude": 1.84969,
                "latitude": 50.95384,
                "description": "The bus stop is located at Quai du Rhin street and in close vicinity to the train station. When exiting the train station on the Boulevard Jacquard street turn left and walk till Quai du Rhin street, then turn left and the stop will be in front of you.",
                "code": "FRCQFCVB"
            }
        },
        {
            "type": "cities",
            "id": "FRCQF",
            "attributes": {
                "name": "Calais",
                "code": "FRCQF"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-1"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-2"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T09:00",
                "arrival_time": "2019-01-15T12:50"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T13:30",
                "arrival_time": "2019-01-15T21:45"
            }
        },
        {
            "type": "marketing_carriers",
            "relationships": {
                "passenger_types": {
                    "data": [
                        {
                            "type": "passenger_types",
                            "id": "PADU"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PBMD"
                        },
                        {
                            "type": "passenger_types",
                            "id": "PCIL"
                        }
                    ]
                },
                "extra_types": {
                    "data": []
                }
            },
            "id": "OUIB",
            "attributes": {
                "trade_name": "Ouibus",
                "legal_name": "Ouibus SNCF C6",
                "code": "OUIB",
                "booking_fee": 0
            }
        },
        {
            "type": "operating_carriers",
            "id": "OUIB",
            "attributes": {
                "trade_name": "Ouibus",
                "legal_name": "Ouibus SNCF C6",
                "code": "OUIB"
            }
        },
        {
            "type": "passenger_types",
            "id": "PADU",
            "attributes": {
                "name": "Adults over 18",
                "description": "",
                "code": "PADU"
            }
        },
        {
            "type": "passenger_types",
            "id": "PBMD",
            "attributes": {
                "name": "Children 0-2",
                "description": "",
                "code": "PBMD"
            }
        },
        {
            "type": "passenger_types",
            "id": "PCIL",
            "attributes": {
                "name": "Children 2-12",
                "description": "",
                "code": "PCIL"
            }
        },
        {
            "type": "stations",
            "relationships": {
                "city": {
                    "data": {
                        "type": "cities",
                        "id": "FRPAR"
                    }
                },
                "area": {
                    "data": null
                }
            },
            "id": "FRPARBER",
            "attributes": {
                "zip_code": "75012",
                "time_zone": "Europe/Paris",
                "street_and_number": "Boulevard de Bercy 48",
                "name": "Paris Bercy Train Station",
                "longitude": 2.382411,
                "latitude": 48.838424,
                "description": "The bus stop is located near the train station \"Paris Bercy\". The bus stops next to the Paris Bercy station. When leaving subway stations 6 and 14, take exit no. 2.",
                "code": "FRPARBER"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T07:15",
                "arrival_time": "2019-01-15T10:55"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T13:30",
                "arrival_time": "2019-01-15T21:45"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T11:45",
                "arrival_time": "2019-01-15T14:40"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T16:00",
                "arrival_time": "2019-01-15T21:55"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T16:00-2019-01-16T01:05-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T16:00-2019-01-16T01:05-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T16:00",
                "arrival_time": "2019-01-16T01:05"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T16:00-2019-01-16T01:05-0"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T12:15",
                "arrival_time": "2019-01-15T16:35"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T19:20",
                "arrival_time": "2019-01-16T01:05"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T13:00",
                "arrival_time": "2019-01-15T16:30"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T19:20",
                "arrival_time": "2019-01-16T01:05"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T17:55",
                "arrival_time": "2019-01-15T22:50"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T23:45",
                "arrival_time": "2019-01-16T06:55"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T07:15",
                "arrival_time": "2019-01-15T10:55"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T12:15",
                "arrival_time": "2019-01-15T18:50"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-1"
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-0"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-0",
            "attributes": {
                "index": 0,
                "departure_time": "2019-01-15T17:55",
                "arrival_time": "2019-01-15T22:50"
            }
        },
        {
            "type": "segments",
            "relationships": {
                "vehicle": {
                    "data": {
                        "type": "vehicles",
                        "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-1"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "type": "operating_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRPARBER"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-1",
            "attributes": {
                "index": 1,
                "departure_time": "2019-01-15T23:20",
                "arrival_time": "2019-01-16T05:15"
            }
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-0"
        },
        {
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "type": "vehicle_types",
                        "id": "BUS"
                    }
                }
            },
            "id": "BUS-OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-1"
        }
    ],
    "data": [
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-0"
                        },
                        {
                            "type": "segments",
                            "id": "EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "EUSA"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "EUSA-FRLILBDT-FRLYSPER-2019-01-15T13:45-2019-01-16T05:40",
            "attributes": {
                "duration": 57300,
                "departure_time": "2019-01-15T13:45",
                "cheapest_total_adult_price": 2900,
                "booked_out": false,
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0"
                        },
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40",
            "attributes": {
                "duration": 45600,
                "departure_time": "2019-01-15T17:00",
                "cheapest_total_adult_price": 2000,
                "booked_out": false,
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-0"
                        },
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T14:15-2019-01-16T05:40",
            "attributes": {
                "duration": 55500,
                "departure_time": "2019-01-15T14:15",
                "cheapest_total_adult_price": 2000,
                "booked_out": false,
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-0"
                        },
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T19:00-2019-01-16T05:40",
            "attributes": {
                "duration": 38400,
                "departure_time": "2019-01-15T19:00",
                "cheapest_total_adult_price": 2000,
                "booked_out": false,
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-0"
                        },
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-1"
                        },
                        {
                            "type": "segments",
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40-2"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "ISIL"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T11:30-2019-01-16T05:40",
            "attributes": {
                "duration": 65400,
                "departure_time": "2019-01-15T11:30",
                "cheapest_total_adult_price": 3100,
                "booked_out": false,
                "arrival_time": "2019-01-16T05:40"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T09:00-2019-01-15T21:45",
            "attributes": {
                "duration": 45900,
                "departure_time": "2019-01-15T09:00",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-15T21:45"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T21:45",
            "attributes": {
                "duration": 52200,
                "departure_time": "2019-01-15T07:15",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-15T21:45"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T11:45-2019-01-15T21:55",
            "attributes": {
                "duration": 36600,
                "departure_time": "2019-01-15T11:45",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-15T21:55"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T16:00-2019-01-16T01:05-0"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T16:00-2019-01-16T01:05",
            "attributes": {
                "duration": 32700,
                "departure_time": "2019-01-15T16:00",
                "cheapest_total_adult_price": 4500,
                "booked_out": false,
                "arrival_time": "2019-01-16T01:05"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T12:15-2019-01-16T01:05",
            "attributes": {
                "duration": 46200,
                "departure_time": "2019-01-15T12:15",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-16T01:05"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T13:00-2019-01-16T01:05",
            "attributes": {
                "duration": 43500,
                "departure_time": "2019-01-15T13:00",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-16T01:05"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T06:55",
            "attributes": {
                "duration": 46800,
                "departure_time": "2019-01-15T17:55",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-16T06:55"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T07:15-2019-01-15T18:50",
            "attributes": {
                "duration": 41700,
                "departure_time": "2019-01-15T07:15",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-15T18:50"
            }
        },
        {
            "type": "connections",
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-0"
                        },
                        {
                            "type": "segments",
                            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15-1"
                        }
                    ]
                },
                "marketing_carrier": {
                    "data": {
                        "type": "marketing_carriers",
                        "id": "OUIB"
                    }
                },
                "departure_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLILBDT"
                    }
                },
                "arrival_station": {
                    "data": {
                        "type": "stations",
                        "id": "FRLYSPER"
                    }
                }
            },
            "id": "OUIB-FRLILBDT-FRLYSPER-2019-01-15T17:55-2019-01-16T05:15",
            "attributes": {
                "duration": 40800,
                "departure_time": "2019-01-15T17:55",
                "cheapest_total_adult_price": 4800,
                "booked_out": false,
                "arrival_time": "2019-01-16T05:15"
            }
        }
    ]
}

The endpoint searches for and delivers all the connections matching your query. The delivered set of objects will have all the necessary data for displaying on the search results page.

On our side we parallelize the outbound requests to the operating carrier integration systems to include as many connections as we’re able to get from marketing carriers (excluding those which couldn’t respond in time).

You can also add two optional parameters in the header:

HTTP Request

GET https://api.distribusion.com/retailers/v4/connections/find

Query Parameters

Parameter Mandatory Description
departure_stations[] true 8- or 9-letter alphanumeric uppercase code, available codes can be obtained from GET /stations.
arrival_stations[] true 8- or 9-letter alphanumeric uppercase code, available codes can be obtained from GET /stations.
departure_date true Departure date in ISO 8601 format.
pax true Number of passengers - Integer in a range of 1..9.
locale true 2-letter alphanumeric lowercase code, according to ISO 639-1 standard .
currency true 3-letter alphanumeric uppercase code, according to ISO 4217 standard.
departure_start_time false String, HH:MM:SS, defaults to 00:00:00
departure_end_time false String, HH:MM:SS, defaults to 23:59:59

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.002 Departure stations are invalid or missing
400.101.003 Arrival stations are invalid or missing
400.101.014 Locale is invalid or missing
400.101.015 Currency is invalid or missing
400.200.001 API key is invalid or missing
400.501.000 Not implemented at Distribusion on connections#find
400.800.000 Not Found
500.100.000 Service Unavailable
600.000.000 Marketing Carrier remote system unavailable
600.100.000 Marketing Carrier remote system time-out
600.400.000 Marketing Carrier remote request invalid
600.900.000 Response received from a remote server technically cannot be processed
600.901.000 Response from remote server logically cannot be processed (is invalid)

Vacancy

curl -X GET \
  'https://api-demo.distribusion.com/retailers/v4/connections/vacancy?marketing_carrier=ISIL&departure_station=FRLILBDT&arrival_station=FRLYSPER&departure_time=2019-01-15T17:00&arrival_time=2019-01-16T05:40&currency=EUR&passengers[][pax]=2&passengers[][type]=PADX' \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json'

The above command returns JSON structured like this:

{
    "data": {
        "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40",
        "type": "vacancies",
        "attributes": {
            "vacant": true,
            "total_price": 4000
        }
    },
    "jsonapi": {
        "version": "1.0"
    },
    "meta": {
        "currency": "EUR"
    }
}

This endpoint should be used during a booking to get a binding price and availability for a specified group of travellers. “Specified” is defined as having not only the right amount of passengers but also selected the passenger types for each passenger. The passenger types are marketing carrier specific (retrieved from connections#find or using #marketing_carriers). If you are looking into getting the general availability of a connection (true / false) please use the connections#find endpoint, which retrieve the availability directly from marketing carriers.

HTTP Request

GET api.distribusion.com/retailers/v4/connections/vacancy

URL Parameters

Parameter Mandatory Description
marketing_carrier true 4-letter alphanumeric uppercase code.
departure_station true 8 or 9-letter alphanumeric uppercase code.
arrival_station true 8 or 9-letter alphanumeric uppercase code.
departure_time true Departure time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
arrival_time true Arrival time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
currency true 3-letter alphanumeric uppercase code, according to ISO 4217 standard.
discount_code false Code consisting of minimum 3 alphanumeric characters.
passengers true Array
_pax true Number of passenger for a specific passenger type
_type true Passenger type. 4-letter alphanumeric uppercase code, available codes can be obtained from GET /marketing_carriers.
extras false Array
_quantity true Integer in a range of 1..999.
_type true Extra type. 4-letter alphanumeric uppercase code, available codes can be obtained from GET /marketing_carriers.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.004 Departure station is invalid or missing
400.101.005 Arrival station is invalid or missing
400.101.009 PAX is invalid or missing
400.101.014 Locale is invalid or missing
400.101.015 Currency is invalid or missing
400.101.044 Departure date is in the past
400.101.049 Departure time must be before arrival time
400.101.052 Discount code is invalid or missing
400.102.040 Unknown marketing carrier
400.200.001 API key is invalid or missing
400.501.002 Not implemented at Distribusion on connections#vacancy
400.800.000 Not Found
400.800.040 Marketing carrier not found
429.000.000 Too Many Requests
500.100.000 Service Unavailable
600.000.000 Marketing Carrier remote system unavailable
600.100.000 Marketing Carrier remote system time-out
600.400.000 Marketing Carrier remote request invalid
600.500.000 Marketing Carrier remote connection unknown error
600.600.000 Marketing Carrier remote vacancy unknown error
600.900.000 Response received from a remote server technically cannot be processed
600.901.000 Response from remote server logically cannot be processed (is invalid)
600.703.026 Booking price unknown

Bookings

Create Orders

curl -X POST \
  https://api-demo.distribusion.com/retailers/v4/orders/create \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' \
  -d '{
       "marketing_carrier": "ISIL",
       "departure_station": "FRLILBDT",
       "arrival_station": "FRLYSPER",
       "departure_time": "2019-01-15T17:00",
       "arrival_time": "2019-01-16T05:40",
       "retailer_partner_number": "123456",
       "title": "mr",
       "first_name": "Balibalo",
       "last_name": "Bateau",
       "email": "quentin@mail.com",
       "phone": "4915237601929",
       "city": "Berlin",
       "zip_code": "10123",
       "street_and_number": "Berlinstr. 23",
       "execute_payment": false,
       "payment_method": "demand_note",
       "total_price": 4000,
       "pax": 2,
       "terms_accepted": true,
       "locale": "en",
       "currency": "EUR",
       "send_customer_email": false,
       "passengers":[
          { 
            "first_name": "Balibalo",
            "last_name": "Bateau",
            "type": "PADX"
          },
          { 
            "first_name": "Bilou",
            "last_name": "Bateau",
            "type": "PADX"
          }
        ]
    }'

The above command returns JSON structured like this:

{
    "data": {
        "id": "ISIL-60a4ec9b-a021-4a07-b720-947b813956f0",
        "type": "orders",
        "attributes": {
            "state": "created",
            "created_at": "2018-10-11T14:27"
        }
    },
    "jsonapi": {
        "version": "1.0"
    }
}

Use this endpoint to conduct an order. Orders created in this way are not a booking per se, but a confirmation that your booking have been successfully taken in account by our platform. In order to retrieve the status of your booking, please call orders/{:id}.

The endpoint currently supports one-way bookings only. It will also send out booking e-mails to customers. E-Mails are blocked on demo, so feel free to conduct tests bookings on our demo server (api-demo.distribusion.com).

Note: we currently support EUR, USD, GBP and CHF currencies.

HTTP Request

POST https://api.distribusion.com/retailers/v4/orders/create

Query Parameters

Parameter Mandatory Description
marketing_carrier true 4-letter alphanumeric uppercase code.
departure_station true 8- or 9-letter alphanumeric uppercase code.
arrival_station true 8- or 9-letter alphanumeric uppercase code.
departure_time true Departure time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
arrival_time true departure time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
retailer_partner_number true 5 - 12 digits number of retailer partner.
title true Allowed values: “mr” or “mrs”.
first_name true First name of the customer, 1-50-letter alphanumeric string.
last_name true Last name of the customer, 1-50-letter alphanumeric string.
email true Email address of the customer.
phone true Phone number of the customer, 8-20-number string.
city true 1-50-letter alphanumeric string.
zip_code true 2-10-letter alphanumeric string.
street_and_number true 1-99-letter alphanumeric string.
execute_payment true Can be true or false. Flag signalling whether the payment transaction should be executed.
payment_method true Allowed value: demand_note, credit_card, sepa_direct_debit, paypal.
payment_token false Unique identifier supplied by the payment service provider.
payer_id false Unique identifier supplied by Paypal.
total_price true Total price of the requested passenger types and extras with added bus marketing carrier booking fee in fractional currency unit (if there is one, in cent) in requested currency. Minimum value - 0, maximum value - 9999900. Provided on successful vacancy request.
pax true Number of passengers. Integer in a range of 1..9.
discount_code false Code consisting of minimum 3 alphanumeric characters.
flight_number false Required by marketing carriers in some cases. 3-9-letter alphanumeric uppercase code.
terms_accepted true Flag signalling whether Terms & Conditions of the marketing carrier have been accepted. Can be true or false.
locale true 2-letter alphanumeric lowercase code, according to ISO 639-1 standard.
currency true 3-letter alphanumeric uppercase code, according to ISO 4217 standard.
send_customer_email true Flag for sending out (or preventing) of the customer confirmation email from Distribusion. Can be true or false.
passengers true Array
fist_name true First name of the passenger, 1-50-letter alphanumeric string.
last_name true Last name of the customer, 1-50-letter alphanumeric string.
type true Passenger type. 4-letter alphanumeric uppercase code, available codes can be obtained from GET /marketing_carriers.
extras false Array
quantity true Integer in a range of 1..999.
type true Extra type. 4-letter alphanumeric uppercase code, available codes can be obtained from GET /marketing_carriers.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.004 Departure station is invalid or missing
400.101.005 Arrival station is invalid or missing
400.101.007 Departure time is invalid or missing
400.101.008 Arrival time is invalid or missing
400.101.009 PAX is invalid or missing
400.101.010 Retailer partner number is invalid or missing
400.101.011 Payment method is invalid or missing
400.101.012 Payment token is invalid or missing
400.101.013 Payer ID is invalid or missing
400.101.014 Locale is invalid or missing
400.101.015 Currency is invalid or missing
400.101.018 Title is invalid or missing
400.101.019 First name is invalid or missing
400.101.020 Last name is invalid or missing
400.101.021 Email is invalid or missing
400.101.022 Phone is invalid or missing
400.101.023 City is invalid or missing
400.101.024 Zip code is invalid or missing
400.101.025 Street and number is invalid or missing
400.101.026 Total price is invalid or missing
400.101.027 Customer currency is invalid or missing
400.101.029 Send customer email is invalid or missing
400.101.030 Passenger first name is invalid or missing
400.101.031 Passenger last name is invalid or missing
400.101.032 Passenger type is invalid or missing
400.101.033 Passenger type pax is invalid or missing
400.101.034 Passenger type code is missing or invalid
400.101.035 Terms accepted is invalid or missing
400.101.036 Flight number is invalid or missing
400.101.037 Extra type is invalid or missing
400.101.038 Extra quantity is invalid or missing
400.101.040 Marketing carrier is invalid or missing
400.101.042 Execute payment is invalid or missing
400.101.044 Departure date is in the past
400.101.049 Departure time must be before arrival time
400.101.050 Extras are invalid or missing
400.101.051 Passengers are invalid or missing
400.101.052 Discount code is invalid or missing
400.102.040 Unknown marketing carrier
400.200.001 API key is invalid or missing
400.501.003 Not implemented at Distribusion on bookings#create
400.800.000 Not Found
400.800.040 Marketing carrier not found
500.000.000 Internal Server Error
500.100.000 Service Unavailable
500.500.017 Unique distribusion booking number cannot be generated
500.500.041 Unique booking id cannot be generated
500.501.000 Booking not vacant
500.502.026 Booking price increased
500.502.026 Booking price decreased
600.000.000 Marketing Carrier remote system unavailable
600.100.000 Marketing Carrier remote system time-out
600.400.000 Marketing Carrier remote request invalid
600.500.000 Marketing Carrier remote connection unknown error
600.600.000 Marketing Carrier remote vacancy unknown error
600.700.000 Marketing Carrier remote booking failed error (general)
600.701.000 Marketing Carrier remote booking capacity error
600.702.000 Marketing Carrier remote booking price change error
600.703.000 Marketing Carrier remote booking tariff unavailable error
600.705.000 Marketing Carrier remote booking vacancy unknown error
600.900.000 Response received from a remote server technically cannot be processed
600.901.000 Response from remote server logically cannot be processed (is invalid)
600.703.026 Booking price unknown

Orders Status

curl -X GET \
  https://api-demo.distribusion.com/retailers/v4/orders/ISIL-60a4ec9b-a021-4a07-b720-947b813956f0 \
  -H 'Cache-Control: no-cache' \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI'

The above command returns JSON structured like this:

{
    "data": {
        "id": "ISIL-60a4ec9b-a021-4a07-b720-947b813956f0",
        "type": "orders",
        "attributes": {
            "state": "executed",
            "executed_at": "2018-10-11T14:27"
        },
        "relationships": {
            "booking": {
                "data": {
                    "id": "6RazURqZbL-9arqdIV5sAg",
                    "type": "bookings"
                }
            }
        }
    },
    "jsonapi": {
        "version": "1.0"
    },
    "meta": {
        "locale": "en",
        "currency": "EUR"
    },
    "included": [
        {
            "id": "6RazURqZbL-9arqdIV5sAg",
            "type": "bookings",
            "attributes": {
                "departure_time": "2019-01-15T17:00",
                "arrival_time": "2019-01-16T05:40",
                "duration": 45600,
                "total_price": 4000,
                "pax": 2,
                "flight_number": null,
                "distribusion_booking_number": "SRZ5EB",
                "marketing_carrier_booking_number": "181011380125",
                "connection_reference": null,
                "created_at": "2018-10-11T14:27"
            },
            "relationships": {
                "segments": {
                    "data": [
                        {
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
                            "type": "segments"
                        },
                        {
                            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
                            "type": "segments"
                        }
                    ]
                },
                "passengers": {
                    "data": [
                        {
                            "id": "PADX-BATEAU-BALIBALO-1-0",
                            "type": "passengers"
                        },
                        {
                            "id": "PADX-BATEAU-BILOU-2-0",
                            "type": "passengers"
                        }
                    ]
                }
            }
        },
        {
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
            "type": "segments",
            "attributes": {
                "departure_time": "2019-01-15T17:00",
                "arrival_time": "2019-01-15T20:05",
                "index": 0
            },
            "relationships": {
                "segment_passengers": {
                    "data": [
                        {
                            "id": "PADX-BATEAU-BALIBALO-1-0",
                            "type": "segment_passengers"
                        },
                        {
                            "id": "PADX-BATEAU-BILOU-2-0",
                            "type": "segment_passengers"
                        }
                    ]
                }
            }
        },
        {
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
            "type": "segments",
            "attributes": {
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40",
                "index": 1
            },
            "relationships": {
                "segment_passengers": {
                    "data": [
                        {
                            "id": "PADX-BATEAU-BALIBALO-1-1",
                            "type": "segment_passengers"
                        },
                        {
                            "id": "PADX-BATEAU-BILOU-2-1",
                            "type": "segment_passengers"
                        }
                    ]
                }
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1-0",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2-0",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1-1",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2-1",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1-0",
            "type": "passengers",
            "attributes": {
                "first_name": "Balibalo",
                "last_name": "Bateau",
                "serial_code": "00000000181011952873         Bateau       Balibalo19920101000000FA011A000000000000",
                "type": "PADX"
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2-0",
            "type": "passengers",
            "attributes": {
                "first_name": "Bilou",
                "last_name": "Bateau",
                "serial_code": "00000000181011755484         Bateau          Bilou19920101000000FA011A000000000000",
                "type": "PADX"
            }
        }
    ]
}

Use this endpoint to retrieve the status of your order. The state can have one of three values:

Once your order have been executed, you will also obtain a booking ID. This booking ID can be used to call our bookings#show in order to get detailed information about the booking and bookings/{:id}/tickets to retrieve the ticket in PDF or HTML format.

HTTP Request

POST https://api.distribusion.com/retailers/v4/orders/:id

Query Parameters

Parameter Mandatory Description
OrderId true 41-letter alphanumeric code.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.004 Departure station is invalid or missing
400.101.005 Arrival station is invalid or missing
400.101.007 Departure time is invalid or missing
400.101.008 Arrival time is invalid or missing
400.101.009 PAX is invalid or missing
400.101.010 Retailer partner number is invalid or missing
400.101.011 Payment method is invalid or missing
400.101.012 Payment token is invalid or missing
400.101.013 Payer ID is invalid or missing
400.101.014 Locale is invalid or missing
400.101.015 Currency is invalid or missing
400.101.018 Title is invalid or missing
400.101.019 First name is invalid or missing
400.101.020 Last name is invalid or missing
400.101.021 Email is invalid or missing
400.101.022 Phone is invalid or missing
400.101.023 City is invalid or missing
400.101.024 Zip code is invalid or missing
400.101.025 Street and number is invalid or missing
400.101.026 Total price is invalid or missing
400.101.027 Customer currency is invalid or missing
400.101.029 Send customer email is invalid or missing
400.101.030 Passenger first name is invalid or missing
400.101.031 Passenger last name is invalid or missing
400.101.032 Passenger type is invalid or missing
400.101.033 Passenger type pax is invalid or missing
400.101.034 Passenger type code is missing or invalid
400.101.035 Terms accepted is invalid or missing
400.101.036 Flight number is invalid or missing
400.101.037 Extra type is invalid or missing
400.101.038 Extra quantity is invalid or missing
400.101.040 Marketing carrier is invalid or missing
400.101.041 ID is invalid or missing
400.101.042 Execute payment is invalid or missing
400.101.044 Departure date is in the past
400.101.049 Departure time must be before arrival time
400.101.050 Extras are invalid or missing
400.101.051 Passengers are invalid or missing
400.101.052 Discount code is invalid or missing
400.102.040 Unknown marketing carrier
400.200.001 API key is invalid or missing
400.501.003 Not implemented at Distribusion on bookings#create
400.800.000 Not Found
400.800.040 Marketing carrier not found
500.000.000 Internal Server Error
500.100.000 Service Unavailable
500.500.017 Unique distribusion booking number cannot be generated
500.500.041 Unique booking id cannot be generated
500.501.000 Booking not vacant
500.502.026 Booking price increased
500.502.026 Booking price decreased
600.000.000 Marketing Carrier remote system unavailable
600.100.000 Marketing Carrier remote system time-out
600.400.000 Marketing Carrier remote request invalid
600.500.000 Marketing Carrier remote connection unknown error
600.600.000 Marketing Carrier remote vacancy unknown error
600.700.000 Marketing Carrier remote booking failed error (general)
600.701.000 Marketing Carrier remote booking capacity error
600.702.000 Marketing Carrier remote booking price change error
600.703.000 Marketing Carrier remote booking tariff unavailable error
600.705.000 Marketing Carrier remote booking vacancy unknown error
600.900.000 Response received from a remote server technically cannot be processed
600.901.000 Response from remote server logically cannot be processed (is invalid)
600.703.026 Booking price unknown

Create

curl -X POST \
  https://api-demo.distribusion.com/retailers/v4/bookings/create \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' \
  -d '{
       "marketing_carrier": "ISIL",
       "departure_station": "FRLILBDT",
       "arrival_station": "FRLYSPER",
       "departure_time": "2019-01-15T17:00",
       "arrival_time": "2019-01-16T05:40",
       "retailer_partner_number": "123456",
       "title": "mr",
       "first_name": "Balibalo",
       "last_name": "Bateau",
       "email": "quentin@mail.com",
       "phone": "4915237601929",
       "city": "Berlin",
       "zip_code": "10123",
       "street_and_number": "Berlinstr. 23",
       "execute_payment": false,
       "payment_method": "demand_note",
       "total_price": 4000,
       "pax": 2,
       "terms_accepted": true,
       "locale": "en",
       "currency": "EUR",
       "send_customer_email": false,
       "passengers":[
          { 
            "first_name": "Balibalo",
            "last_name": "Bateau",
            "type": "PADX"
          },
          { 
            "first_name": "Bilou",
            "last_name": "Bateau",
            "type": "PADX"
          }
        ]
    }'

The above command returns JSON structured like this:

{
    "data": {
        "id": "9KRtPqq5YM5dKl9D6A_igA",
        "type": "bookings",
        "attributes": {
            "departure_time": "2019-01-15T17:00",
            "arrival_time": "2019-01-16T05:40",
            "duration": 45600,
            "title": "mr",
            "first_name": "Balibalo",
            "last_name": "Bateau",
            "email": "quentin@mail.com",
            "phone": "4915237601929",
            "city": "Berlin",
            "zip_code": "10123",
            "street_and_number": "Berlinstr. 23",
            "execute_payment": false,
            "payment_method": "demand_note",
            "payment_token": null,
            "payer_id": null,
            "total_price": 4000,
            "pax": 2,
            "flight_number": null,
            "distribusion_booking_number": "7P7JF8",
            "marketing_carrier_booking_number": "181011273961",
            "terms_accepted": true,
            "send_customer_email": false,
            "retailer_partner_number": "123456",
            "connection_reference": null,
            "created_at": "2018-10-11T14:24"
        },
        "relationships": {
            "departure_station": {
                "data": {
                    "id": "FRLILBDT",
                    "type": "stations"
                }
            },
            "arrival_station": {
                "data": {
                    "id": "FRLYSPER",
                    "type": "stations"
                }
            },
            "marketing_carrier": {
                "data": {
                    "id": "ISIL",
                    "type": "marketing_carriers"
                }
            },
            "cancellation": {
                "data": null
            },
            "segments": {
                "data": [
                    {
                        "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
                        "type": "segments"
                    },
                    {
                        "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
                        "type": "segments"
                    }
                ]
            },
            "passengers": {
                "data": [
                    {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    },
                    {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                ]
            },
            "extras": {
                "data": []
            }
        }
    },
    "jsonapi": {
        "version": "1.0"
    },
    "meta": {
        "locale": "en",
        "currency": "EUR"
    },
    "included": [
        {
            "id": "FRLILBDT",
            "type": "stations",
            "attributes": {
                "station_type": "bus_station",
                "code": "FRLILBDT",
                "name": "Lille Boulevard de Turin",
                "description": "The bus stop is located at the south side of Lille Europe station, right on the Boulevard de Turin, near \"Suite Novotel\".",
                "street_and_number": "Boulevard de Turin",
                "zip_code": "59777",
                "longitude": 3.076675,
                "latitude": 50.638756,
                "time_zone": "Europe/Paris"
            },
            "relationships": {
                "city": {
                    "data": {
                        "id": "FRLIL",
                        "type": "cities"
                    }
                },
                "area": {
                    "data": null
                }
            }
        },
        {
            "id": "FRLIL",
            "type": "cities",
            "attributes": {
                "code": "FRLIL",
                "name": "Lille"
            }
        },
        {
            "id": "FRLYSPER",
            "type": "stations",
            "attributes": {
                "station_type": "bus_station",
                "code": "FRLYSPER",
                "name": "Lyon Perrache SNCF Train Station",
                "description": "Central bus station of the center exchange of Lyon Perrache on the 1st floor Rhône Est side. Access to the platforms via Gallery D. Warning: Every departure between 12:30 a.m. and 4:45 a.m will take place at 30 Cours de Verdun Perrache 69002 Lyon in front of the \"Brasserie Georges\", less than 5 min walking from the bus station of Perrache, which is closed during this period.",
                "street_and_number": "Cours de Verdun Gensoul 14",
                "zip_code": "69002",
                "longitude": 4.826788,
                "latitude": 45.749711,
                "time_zone": "Europe/Paris"
            },
            "relationships": {
                "city": {
                    "data": {
                        "id": "FRLYS",
                        "type": "cities"
                    }
                },
                "area": {
                    "data": null
                }
            }
        },
        {
            "id": "FRLYS",
            "type": "cities",
            "attributes": {
                "code": "FRLYS",
                "name": "Lyon"
            }
        },
        {
            "id": "ISIL",
            "type": "marketing_carriers",
            "attributes": {
                "code": "ISIL",
                "trade_name": "Isilines",
                "legal_name": "Isilines",
                "address": "215 avenue Georges Clemenceau, 92024 Nanterre cedex, France",
                "phone": "+33(0)157662830",
                "fax": "",
                "customer_service_phone": "",
                "email": "",
                "commercial_register": "Tribunal de Commerce de Nanterre",
                "commercial_register_number": "RCS:391144300",
                "vat_no": "FR50391144300",
                "authorised_representative": "Hugo Roncal",
                "white_label_logo": "data:image/png;base64",
                "white_label_colour_code": "",
                "terms": "T&Cs",
                "flight_number_required": false,
                "booking_fee": 0,
                "cancellation_fee": 0,
                "cancellation_cutoff": null
            }
        },
        {
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
            "type": "segments",
            "attributes": {
                "departure_time": "2019-01-15T17:00",
                "arrival_time": "2019-01-15T20:05",
                "index": 0
            },
            "relationships": {
                "departure_station": {
                    "data": {
                        "id": "FRLILBDT",
                        "type": "stations"
                    }
                },
                "arrival_station": {
                    "data": {
                        "id": "FRPARGBA",
                        "type": "stations"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "id": "ISIL",
                        "type": "operating_carriers"
                    }
                },
                "vehicle": {
                    "data": {
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
                        "type": "vehicles"
                    }
                },
                "segment_passengers": {
                    "data": [
                        {
                            "id": "PADX-BATEAU-BALIBALO-1-0",
                            "type": "segment_passengers"
                        },
                        {
                            "id": "PADX-BATEAU-BILOU-2-0",
                            "type": "segment_passengers"
                        }
                    ]
                }
            }
        },
        {
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
            "type": "segments",
            "attributes": {
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40",
                "index": 1
            },
            "relationships": {
                "departure_station": {
                    "data": {
                        "id": "FRPARGBA",
                        "type": "stations"
                    }
                },
                "arrival_station": {
                    "data": {
                        "id": "FRLYSPER",
                        "type": "stations"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "id": "ISIL",
                        "type": "operating_carriers"
                    }
                },
                "vehicle": {
                    "data": {
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
                        "type": "vehicles"
                    }
                },
                "segment_passengers": {
                    "data": [
                        {
                            "id": "PADX-BATEAU-BALIBALO-1-1",
                            "type": "segment_passengers"
                        },
                        {
                            "id": "PADX-BATEAU-BILOU-2-1",
                            "type": "segment_passengers"
                        }
                    ]
                }
            }
        },
        {
            "id": "FRPARGBA",
            "type": "stations",
            "attributes": {
                "station_type": "bus_station",
                "code": "FRPARGBA",
                "name": "Paris Gallieni (Bagnolet)",
                "description": "Paris international bus station is located in the eastern part of the city, and is connected to the metro line M3. At the station, there is a taxi stand, a snack bar, and parking areas.",
                "street_and_number": "Av. du Général de Gaulle 28",
                "zip_code": "93170",
                "longitude": 2.414311,
                "latitude": 48.865442,
                "time_zone": "Europe/Paris"
            },
            "relationships": {
                "city": {
                    "data": {
                        "id": "FRPAR",
                        "type": "cities"
                    }
                },
                "area": {
                    "data": null
                }
            }
        },
        {
            "id": "FRPAR",
            "type": "cities",
            "attributes": {
                "code": "FRPAR",
                "name": "Paris"
            }
        },
        {
            "id": "ISIL",
            "type": "operating_carriers",
            "attributes": {
                "code": "ISIL",
                "trade_name": "Isilines",
                "legal_name": "Isilines"
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1-0",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2-0",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "id": "BUS",
                        "type": "vehicle_types"
                    }
                }
            }
        },
        {
            "id": "BUS",
            "type": "vehicle_types",
            "attributes": {
                "code": "BUS",
                "name": "Bus",
                "description": "Long vehicle which is usually transporting a group of people (ca. 45) on streets."
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1-1",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2-1",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "id": "BUS",
                        "type": "vehicle_types"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1",
            "type": "passengers",
            "attributes": {
                "first_name": "Balibalo",
                "last_name": "Bateau",
                "serial_code": "00000000181011477332         Bateau       Balibalo19920101000000FA011A000000000000",
                "type": "PADX"
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2",
            "type": "passengers",
            "attributes": {
                "first_name": "Bilou",
                "last_name": "Bateau",
                "serial_code": "00000000181011013117         Bateau          Bilou19920101000000FA011A000000000000",
                "type": "PADX"
            }
        }
    ]
}

Use this endpoint to conduct bookings. Bookings created in this way are the basis for invoicing. The endpoint currently supports one-way bookings only. It will also send out booking e-mails to customers. E-Mails are blocked on demo, so feel free to conduct tests bookings on our demo server (api-demo.distribusion.com).

Note: we currently support EUR, USD, GBP and CHF currencies.

HTTP Request

POST https://api.distribusion.com/retailers/v4/bookings/create

Query Parameters

Parameter Mandatory Description
marketing_carrier true 4-letter alphanumeric uppercase code.
departure_station true 8- or 9-letter alphanumeric uppercase code.
arrival_station true 8- or 9-letter alphanumeric uppercase code.
departure_time true Departure time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
arrival_time true departure time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
retailer_partner_number true 5 - 12 digits number of retailer partner.
title true Allowed values: “mr” or “mrs”.
first_name true First name of the customer, 1-50-letter alphanumeric string.
last_name true Last name of the customer, 1-50-letter alphanumeric string.
email true Email address of the customer.
phone true Phone number of the customer, 8-20-number string.
city true 1-50-letter alphanumeric string.
zip_code true 2-10-letter alphanumeric string.
street_and_number true 1-99-letter alphanumeric string.
execute_payment true Can be true or false. Flag signalling whether the payment transaction should be executed.
payment_method true Allowed value: demand_note, credit_card, sepa_direct_debit, paypal.
payment_token false Unique identifier supplied by the payment service provider.
payer_id false Unique identifier supplied by Paypal.
total_price true Total price of the requested passenger types and extras with added bus marketing carrier booking fee in fractional currency unit (if there is one, in cent) in requested currency. Minimum value - 0, maximum value - 9999900. Provided on successful vacancy request.
pax true Number of passengers. Integer in a range of 1..9.
discount_code false Code consisting of minimum 3 alphanumeric characters.
flight_number false Required by marketing carriers in some cases. 3-9-letter alphanumeric uppercase code.
terms_accepted true Flag signalling whether Terms & Conditions of the marketing carrier have been accepted. Can be true or false.
locale true 2-letter alphanumeric lowercase code, according to ISO 639-1 standard.
currency true 3-letter alphanumeric uppercase code, according to ISO 4217 standard.
send_customer_email true Flag for sending out (or preventing) of the customer confirmation email from Distribusion. Can be true or false.
passengers true Array
fist_name true First name of the passenger, 1-50-letter alphanumeric string.
last_name true Last name of the customer, 1-50-letter alphanumeric string.
type true Passenger type. 4-letter alphanumeric uppercase code, available codes can be obtained from GET /marketing_carriers.
extras false Array
quantity true Integer in a range of 1..999.
type true Extra type. 4-letter alphanumeric uppercase code, available codes can be obtained from GET /marketing_carriers.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.004 Departure station is invalid or missing
400.101.005 Arrival station is invalid or missing
400.101.007 Departure time is invalid or missing
400.101.008 Arrival time is invalid or missing
400.101.009 PAX is invalid or missing
400.101.010 Retailer partner number is invalid or missing
400.101.011 Payment method is invalid or missing
400.101.012 Payment token is invalid or missing
400.101.013 Payer ID is invalid or missing
400.101.014 Locale is invalid or missing
400.101.015 Currency is invalid or missing
400.101.018 Title is invalid or missing
400.101.019 First name is invalid or missing
400.101.020 Last name is invalid or missing
400.101.021 Email is invalid or missing
400.101.022 Phone is invalid or missing
400.101.023 City is invalid or missing
400.101.024 Zip code is invalid or missing
400.101.025 Street and number is invalid or missing
400.101.026 Total price is invalid or missing
400.101.027 Customer currency is invalid or missing
400.101.029 Send customer email is invalid or missing
400.101.030 Passenger first name is invalid or missing
400.101.031 Passenger last name is invalid or missing
400.101.032 Passenger type is invalid or missing
400.101.033 Passenger type pax is invalid or missing
400.101.034 Passenger type code is missing or invalid
400.101.035 Terms accepted is invalid or missing
400.101.036 Flight number is invalid or missing
400.101.037 Extra type is invalid or missing
400.101.038 Extra quantity is invalid or missing
400.101.040 Marketing carrier is invalid or missing
400.101.042 Execute payment is invalid or missing
400.101.044 Departure date is in the past
400.101.049 Departure time must be before arrival time
400.101.050 Extras are invalid or missing
400.101.051 Passengers are invalid or missing
400.101.052 Discount code is invalid or missing
400.102.040 Unknown marketing carrier
400.200.001 API key is invalid or missing
400.501.003 Not implemented at Distribusion on bookings#create
400.800.000 Not Found
400.800.040 Marketing carrier not found
500.000.000 Internal Server Error
500.100.000 Service Unavailable
500.500.017 Unique distribusion booking number cannot be generated
500.500.041 Unique booking id cannot be generated
500.501.000 Booking not vacant
500.502.026 Booking price increased
500.502.026 Booking price decreased
600.000.000 Marketing Carrier remote system unavailable
600.100.000 Marketing Carrier remote system time-out
600.400.000 Marketing Carrier remote request invalid
600.500.000 Marketing Carrier remote connection unknown error
600.600.000 Marketing Carrier remote vacancy unknown error
600.700.000 Marketing Carrier remote booking failed error (general)
600.701.000 Marketing Carrier remote booking capacity error
600.702.000 Marketing Carrier remote booking price change error
600.703.000 Marketing Carrier remote booking tariff unavailable error
600.705.000 Marketing Carrier remote booking vacancy unknown error
600.900.000 Response received from a remote server technically cannot be processed
600.901.000 Response from remote server logically cannot be processed (is invalid)
600.703.026 Booking price unknown

Redirect for Affiliates

https://bustickets-demo.distribusion.com/redirect?marketing_carrier_code=ISIL&departure_station_code=FRLILBDT&arrival_station_code=FRLYSPER&departure_time=2019-01-15T17:00&arrival_time=2019-01-16T05:40&currency=EUR&retailer_partner_number=123456&locale=en

Affiliates that do not use our bookings#create endpoint, can redirect their customers to our booking page after searching connections on connections#find. The locale will be taken from the setting of the browser, which the customer is using. Alternatively, you can overwrite this functionality by sending your own locale (the order of priority is: locale parameter in URL, then cached locale in browser, and finally the browser locale). The currency can be set within the redirect link.

We currently supports 7 currencies:

You can now retrieve a list of all your booking by calling the bookings#index.

GET https://bustickets.distribusion.com/redirect

URL Parameters

Parameter Mandatory Description
marketing_carrier true 4-letter alphanumeric uppercase code.
departure_station_code true 8- or 9-letter alphanumeric uppercase code.
arrival_station_code true 8- or 9-letter alphanumeric uppercase code.
departure_time true Departure time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
arrival_time true departure time in ISO 8601 format without timezone yyyy-mm-ddThh:mm.
retailer_partner_number true 5 - 12 digits number of retailer partner.
currency true 3-letter alphanumeric uppercase code, according to ISO 4217 standard.
locale false 2-letter alphanumeric lowercase code, according to ISO 639-1 standard.

Errors

Error Code Meaning
500.000.000 Internal Server Error
500.100.000 Service Unavailable

Index

curl -X GET \
  https://api-demo.distribusion.com/retailers/v4/bookings?created_at=2018-10-01 \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' 

The above command returns JSON structured like this:

{
  "data": [
    {
      "id": "qxYan0wvPw4Xh9bUOwd6fg",
      "type": "bookings",
      "attributes": {
        "departure_time": "2018-10-10T14:00",
        "last_name": "Smith",
        "total_price": 15000,
        "pax": 2,
        "distribusion_booking_number": "ZN8FX2",
        "created_at": "2018-10-01T15:31"
      },
      "relationships": {
        "departure_station": {
          "data": {
            "id": "DEBERCBS",
            "type": "stations"
          }
        },
        "arrival_station": {
          "data": {
            "id": "UAIEVZOB",
            "type": "stations"
          }
        },
        "marketing_carrier": {
          "data": {
            "id": "AKKM",
            "type": "marketing_carriers"
          }
        },
        "cancellation": {
          "data": {
            "id": "7Zr0AWGXiL-pCAb14d-9tA",
            "type": "cancellations"
          }
        }
      }
    }
  ],

  -------

  "included": [
    {
      "id": "AKKM",
      "type": "marketing_carriers",
      "attributes": {
        "trade_name": "AS Karpaten & Krim Tours (Schevschenko)"
      }
    }
  ],
  "jsonapi": {
    "version": "1.0"
  },
  "meta": {
    "locale": "en",
    "currency": "EUR"
  }
}

You can now retrieve a list of all your booking by calling the bookings#index. Alternatively, you can filter your booking list for a specific day by using the parameter bellow:

URL Parameters

Parameter Mandatory Description
created_at false Departure date in ISO 8601 format.

HTTP Request

GET api.distribusion.com/retailers/v4/bookings

Errors

Error Code Meaning
400.200.001 API key is invalid or missing
500.000.000 Internal Server Error
500.100.000 Service Unavailable

Show

curl -X GET \
  https://api-demo.distribusion.com/retailers/v4/bookings/9KRtPqq5YM5dKl9D6A_igA \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' 

The above command returns JSON structured like this:

{
    "data": {
        "id": "9KRtPqq5YM5dKl9D6A_igA",
        "type": "bookings",
        "attributes": {
            "departure_time": "2019-01-15T17:00",
            "arrival_time": "2019-01-16T05:40",
            "duration": 45600,
            "title": "mr",
            "first_name": "Balibalo",
            "last_name": "Bateau",
            "email": "quentin@mail.com",
            "phone": "4915237601929",
            "city": "Berlin",
            "zip_code": "10123",
            "street_and_number": "Berlinstr. 23",
            "execute_payment": false,
            "payment_method": "demand_note",
            "payment_token": null,
            "payer_id": null,
            "total_price": 4000,
            "pax": 2,
            "flight_number": null,
            "distribusion_booking_number": "7P7JF8",
            "marketing_carrier_booking_number": "181011273961",
            "terms_accepted": true,
            "send_customer_email": false,
            "retailer_partner_number": "123456",
            "connection_reference": null,
            "created_at": "2018-10-11T14:24"
        },
        "relationships": {
            "departure_station": {
                "data": {
                    "id": "FRLILBDT",
                    "type": "stations"
                }
            },
            "arrival_station": {
                "data": {
                    "id": "FRLYSPER",
                    "type": "stations"
                }
            },
            "marketing_carrier": {
                "data": {
                    "id": "ISIL",
                    "type": "marketing_carriers"
                }
            },
            "cancellation": {
                "data": null
            },
            "segments": {
                "data": [
                    {
                        "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
                        "type": "segments"
                    },
                    {
                        "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
                        "type": "segments"
                    }
                ]
            },
            "passengers": {
                "data": [
                    {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    },
                    {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                ]
            },
            "extras": {
                "data": []
            }
        }
    },
    "jsonapi": {
        "version": "1.0"
    },
    "meta": {
        "locale": "en",
        "currency": "EUR"
    },
    "included": [
        {
            "id": "FRLILBDT",
            "type": "stations",
            "attributes": {
                "station_type": "bus_station",
                "code": "FRLILBDT",
                "name": "Lille Boulevard de Turin",
                "description": "The bus stop is located at the south side of Lille Europe station, right on the Boulevard de Turin, near \"Suite Novotel\".",
                "street_and_number": "Boulevard de Turin",
                "zip_code": "59777",
                "longitude": 3.076675,
                "latitude": 50.638756,
                "time_zone": "Europe/Paris"
            },
            "relationships": {
                "city": {
                    "data": {
                        "id": "FRLIL",
                        "type": "cities"
                    }
                },
                "area": {
                    "data": null
                }
            }
        },
        {
            "id": "FRLIL",
            "type": "cities",
            "attributes": {
                "code": "FRLIL",
                "name": "Lille"
            }
        },
        {
            "id": "FRLYSPER",
            "type": "stations",
            "attributes": {
                "station_type": "bus_station",
                "code": "FRLYSPER",
                "name": "Lyon Perrache SNCF Train Station",
                "description": "Central bus station of the center exchange of Lyon Perrache on the 1st floor Rhône Est side. Access to the platforms via Gallery D. Warning: Every departure between 12:30 a.m. and 4:45 a.m will take place at 30 Cours de Verdun Perrache 69002 Lyon in front of the \"Brasserie Georges\", less than 5 min walking from the bus station of Perrache, which is closed during this period.",
                "street_and_number": "Cours de Verdun Gensoul 14",
                "zip_code": "69002",
                "longitude": 4.826788,
                "latitude": 45.749711,
                "time_zone": "Europe/Paris"
            },
            "relationships": {
                "city": {
                    "data": {
                        "id": "FRLYS",
                        "type": "cities"
                    }
                },
                "area": {
                    "data": null
                }
            }
        },
        {
            "id": "FRLYS",
            "type": "cities",
            "attributes": {
                "code": "FRLYS",
                "name": "Lyon"
            }
        },
        {
            "id": "ISIL",
            "type": "marketing_carriers",
            "attributes": {
                "code": "ISIL",
                "trade_name": "Isilines",
                "legal_name": "Isilines",
                "address": "215 avenue Georges Clemenceau, 92024 Nanterre cedex, France",
                "phone": "+33(0)157662830",
                "fax": "",
                "customer_service_phone": "",
                "email": "",
                "commercial_register": "Tribunal de Commerce de Nanterre",
                "commercial_register_number": "RCS:391144300",
                "vat_no": "FR50391144300",
                "authorised_representative": "Hugo Roncal",
                "white_label_logo": "data:image/png;base64",
                "white_label_colour_code": "",
                "terms": "T&Cs",
                "flight_number_required": false,
                "booking_fee": 0,
                "cancellation_fee": 0,
                "cancellation_cutoff": null
            }
        },
        {
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
            "type": "segments",
            "attributes": {
                "departure_time": "2019-01-15T17:00",
                "arrival_time": "2019-01-15T20:05",
                "index": 0
            },
            "relationships": {
                "departure_station": {
                    "data": {
                        "id": "FRLILBDT",
                        "type": "stations"
                    }
                },
                "arrival_station": {
                    "data": {
                        "id": "FRPARGBA",
                        "type": "stations"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "id": "ISIL",
                        "type": "operating_carriers"
                    }
                },
                "vehicle": {
                    "data": {
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
                        "type": "vehicles"
                    }
                },
                "segment_passengers": {
                    "data": [
                        {
                            "id": "PADX-BATEAU-BALIBALO-1-0",
                            "type": "segment_passengers"
                        },
                        {
                            "id": "PADX-BATEAU-BILOU-2-0",
                            "type": "segment_passengers"
                        }
                    ]
                }
            }
        },
        {
            "id": "ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
            "type": "segments",
            "attributes": {
                "departure_time": "2019-01-15T23:30",
                "arrival_time": "2019-01-16T05:40",
                "index": 1
            },
            "relationships": {
                "departure_station": {
                    "data": {
                        "id": "FRPARGBA",
                        "type": "stations"
                    }
                },
                "arrival_station": {
                    "data": {
                        "id": "FRLYSPER",
                        "type": "stations"
                    }
                },
                "operating_carrier": {
                    "data": {
                        "id": "ISIL",
                        "type": "operating_carriers"
                    }
                },
                "vehicle": {
                    "data": {
                        "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
                        "type": "vehicles"
                    }
                },
                "segment_passengers": {
                    "data": [
                        {
                            "id": "PADX-BATEAU-BALIBALO-1-1",
                            "type": "segment_passengers"
                        },
                        {
                            "id": "PADX-BATEAU-BILOU-2-1",
                            "type": "segment_passengers"
                        }
                    ]
                }
            }
        },
        {
            "id": "FRPARGBA",
            "type": "stations",
            "attributes": {
                "station_type": "bus_station",
                "code": "FRPARGBA",
                "name": "Paris Gallieni (Bagnolet)",
                "description": "Paris international bus station is located in the eastern part of the city, and is connected to the metro line M3. At the station, there is a taxi stand, a snack bar, and parking areas.",
                "street_and_number": "Av. du Général de Gaulle 28",
                "zip_code": "93170",
                "longitude": 2.414311,
                "latitude": 48.865442,
                "time_zone": "Europe/Paris"
            },
            "relationships": {
                "city": {
                    "data": {
                        "id": "FRPAR",
                        "type": "cities"
                    }
                },
                "area": {
                    "data": null
                }
            }
        },
        {
            "id": "FRPAR",
            "type": "cities",
            "attributes": {
                "code": "FRPAR",
                "name": "Paris"
            }
        },
        {
            "id": "ISIL",
            "type": "operating_carriers",
            "attributes": {
                "code": "ISIL",
                "trade_name": "Isilines",
                "legal_name": "Isilines"
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1-0",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2-0",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-0",
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "id": "BUS",
                        "type": "vehicle_types"
                    }
                }
            }
        },
        {
            "id": "BUS",
            "type": "vehicle_types",
            "attributes": {
                "code": "BUS",
                "name": "Bus",
                "description": "Long vehicle which is usually transporting a group of people (ca. 45) on streets."
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1-1",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BALIBALO-1",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2-1",
            "type": "segment_passengers",
            "attributes": {
                "seat_number": null
            },
            "relationships": {
                "passenger": {
                    "data": {
                        "id": "PADX-BATEAU-BILOU-2",
                        "type": "passengers"
                    }
                }
            }
        },
        {
            "id": "BUS-ISIL-FRLILBDT-FRLYSPER-2019-01-15T17:00-2019-01-16T05:40-1",
            "type": "vehicles",
            "relationships": {
                "vehicle_type": {
                    "data": {
                        "id": "BUS",
                        "type": "vehicle_types"
                    }
                }
            }
        },
        {
            "id": "PADX-BATEAU-BALIBALO-1",
            "type": "passengers",
            "attributes": {
                "first_name": "Balibalo",
                "last_name": "Bateau",
                "serial_code": "00000000181011477332         Bateau       Balibalo19920101000000FA011A000000000000",
                "type": "PADX"
            }
        },
        {
            "id": "PADX-BATEAU-BILOU-2",
            "type": "passengers",
            "attributes": {
                "first_name": "Bilou",
                "last_name": "Bateau",
                "serial_code": "00000000181011013117         Bateau          Bilou19920101000000FA011A000000000000",
                "type": "PADX"
            }
        }
    ]
}

To review data of a booking at a later stage without saving all information into your system, you can use our bookings#show endpoint to retrieve it and show its data.

HTTP Request

GET api.distribusion.com/retailers/v4/bookings/

URL Parameters

Parameter Mandatory Description
booking true 22-letter alphanumeric lowercase code, provided on successful booking.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.041 Booking is invalid or missing
400.200.001 API key is invalid or missing
400.800.000 Not Found
500.000.000 Internal Server Error
500.100.000 Service Unavailable
400.501.005 Not implemented at Distribusion on bookings#show
400.800.041 Booking not found

Tickets

curl -X GET \
  https://api-demo.distribusion.com/retailers/v4/bookings/9KRtPqq5YM5dKl9D6A_igA/tickets \
  -H 'Api-Key: H4gtqUn04qDh7mmZpFJYmmcW7JVw7hMIaCUcdWhZ' \
  -H 'Content-Type: application/json'

This endpoint is dedicated to retailers sending their own confirmation email. If you have set send_customer_email to true, you do not need this endpoint. The ticket either has one page containing the information of all the passengers, or it consists of one page per passenger (in PDF format). You can also retrieve your ticket in HTML format, by adding the type parameter.

alt text

HTTP Request

GET api.distribusion.com/retailers/v4/bookings/{id}/tickets

URL Parameters

Parameter Mandatory Description
type false Allowed value: html

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.041 Booking is invalid or missing
400.200.001 API key is invalid or missing
400.800.000 Not Found
500.000.000 Internal Server Error
500.100.000 Service Unavailable
400.501.006 Not implemented at Distribusion on bookings#ticket
400.800.041 Booking not found

Cancellations

Conditions

curl -X GET \
  'https://api-demo.distribusion.com/retailers/v4/cancellations/conditions?booking=ZpXv69xrzHzk8Nb-YHGllA' \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' 

The above command returns JSON structured like this:

{
  "data": {
    "id": "ZpXv69xrzHzk8Nb-YHGllA",
    "type": "cancellation_conditions",
    "attributes": {
      "allowed": true,
      "fee": 1500,
      "cutoff": "2018-03-28T12:00"
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "meta": {
    "currency": "EUR"
  }
}

This endpoint enable users to retrieve detailed information about the cancellation of a specific booking. Note that not all marketing carriers offer cancellations and that in some case, the cancellation fee do not reflect the flexibility of the terms and conditions due to technical reasons. The current workflow only allow a full (or partial) refund of the booking, no options for vouchers are currently available.

HTTP Request

GET api.distribusion.com/retailers/v4/cancellations/conditions

URL Parameters

Parameter Mandatory Description
booking true 22-letter alphanumeric lowercase code, provided on successful booking.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.200.001 API key is invalid or missing
400.800.041 Booking not found
400.500.041 Cancellation is not allowed
400.501.007 Not implemented at Distribusion on cancellations#conditions
500.000.000 Internal Server Error
500.100.000 Service Unavailable

Create

curl -X POST \
  https://api-demo.distribusion.com/retailers/v4/cancellations/create \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' \
  -d '{ "booking": "ZpXv69xrzHzk8Nb-YHGllA" }'

The above command returns JSON structured like this:

{
  "data": {
    "id": "6JXfs7hJpMe3FsF-JfudLA",
    "type": "cancellations",
    "attributes": {
      "total_price": 2000,
      "fee": 1500,
      "total_refund": 500,
      "created_at": "2017-05-23T16:21"
    }
  },
  "jsonapi": {
    "version": "1.0"
  },
  "meta": {
    "currency": "EUR"
  }
}

This endpoint enables users to perform the cancellation of a specific booking.

Note: The cancellation example is not linked to the previous booking example, as it is not cancellable.

HTTP Request

POST api.distribusion.com/retailers/v4/cancellations/create

URL Parameters

Parameter Mandatory Description
booking true 22-letter alphanumeric lowercase code, provided on successful booking.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.200.001 API key is invalid or missing
400.502.041 Booking already cancelled
400.800.041 Booking not found
400.501.008 Not implemented at Distribusion on cancellations#create
500.000.000 Internal Server Error
500.100.000 Service Unavailable
500.600.041 Unique cancellation id cannot be generated

Marketing Carriers

Index

curl -X GET \
  https://api-demo.distribusion.com/retailers/v4/marketing_carriers \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' 

The above command returns JSON structured like this:

{
  "data": [
    {
      "id": "EONL",
      "type": "marketing_carriers",
      "attributes": {
        "code": "EONL",
        "trade_name": "Eurobus Online"
      }
    },
    {
      "id": "ESBU",
      "type": "marketing_carriers",
      "attributes": {
        "code": "ESBU",
        "trade_name": "Eskana Bus"
      }
    },
    {
      "id": "AKKM",
      "type": "marketing_carriers",
      "attributes": {
        "code": "AKKM",
        "trade_name": "AS Karpaten & Krim Tours (Schevschenko)"
      }
    },
    {
      "id": "BLIE",
      "type": "marketing_carriers",
      "attributes": {
        "code": "BLIE",
        "trade_name": "Blue Line"
      }
    }
  ],

  -------
  "jsonapi": {
    "version": "1.0"
  }
}

This endpoint provides a list of marketing carriers with their trade name and code.

HTTP Request

GET api.distribusion.com/retailers/v4/marketing_carriers

Errors

Error Code Meaning
500.000.000 Internal Server Error
500.100.000 Service Unavailable

Show

curl -X GET \
  'https://api-demo.distribusion.com/retailers/v4/marketing_carriers/SIBU?locale=en&currency=EUR' \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' 

The above command returns JSON structured like this:

{
  "data": {
    "id": "SIBU",
    "type": "marketing_carriers",
    "attributes": {
      "code": "SIBU",
      "trade_name": "SitBus",
      "legal_name": "S.I.T. Societa' Italiana Trasporti SRL",
      "address": "Via Ostiense 256, 00144 Rome, Italy",
      "phone": "+39-06-5916826 / 5923507",
      "fax": "+39-06-5917074",
      "customer_service_phone": "+39065916826",
      "email": "sit@sitbus.com",
      "commercial_register": "Company House No.406335",
      "commercial_register_number": "REN No.P50338",
      "vat_no": "IT01041631001",
      "authorised_representative": "Enrico Fraticelli, Clara Fraticelli, Dino Fraticelli, Monica Germani",
      "white_label_logo": "data:image/png;base64",
      "white_label_colour_code": "#FFFFFF",
      "terms": "T&C",
      "flight_number_required": false,
      "booking_fee": 0,
      "cancellation_fee": 600,
      "cancellation_cutoff": null
    },
    "relationships": {
      "passenger_types": {
        "data": [
          {
            "id": "PNOS",
            "type": "passenger_types"
          }
        ]
      },
      "extra_types": {
        "data": []
      }
    }
  },
  "included": [
    {
      "id": "PNOS",
      "type": "passenger_types",
      "attributes": {
        "code": "PNOS",
        "name": "Normal",
        "description": null
      }
    }
  ],
  "jsonapi": {
    "version": "1.0"
  },
  "meta": {
    "locale": "en",
    "currency": "EUR"
  }
}

This endpoint enable users to retrieve detailed information about marketing carriers, such as passenger types, cancellations conditions, terms & conditions, etc.

HTTP Request

GET api.distribusion.com/retailers/v4/marketing_carriers/{code}

URL Parameters

Parameter Mandatory Description
locale true 2-letter alphanumeric lowercase code, according to ISO 639-1 standard.
currency true 3-letter alphanumeric uppercase code, according to ISO 4217 standard.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.014 Locale is invalid or missing
400.101.015 Currency is invalid or missing
400.101.040 Marketing carrier is invalid or missing
400.501.004 Not implemented at Distribusion on bookings#form_schema
400.800.000 Not Found
400.800.040 Marketing carrier not found
500.000.000 Internal Server Error
500.100.000 Service Unavailable

Stations

curl -X GET \
  https://api-demo.distribusion.com/retailers/v4/marketing_carriers/SIBU/stations \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' 

The above command returns JSON structured like this:

{
    "data": [
        {
            "id": "ITROMCGI",
            "type": "stations"
        },
        {
            "id": "ITROMVMA",
            "type": "stations"
        },
        {
            "id": "ITZRRPGA",
            "type": "stations"
        },
        {
            "id": "ITROMVCE",
            "type": "stations"
        },
        {
            "id": "ITROMRCF",
            "type": "stations"
        },
        {
            "id": "ITROMRVA",
            "type": "stations"
        },
        {
            "id": "ITROMRFB",
            "type": "stations"
        }
    ],
    "jsonapi": {
        "version": "1.0"
    }
}

This endpoint provides a list of stations attached to a specific marketing carrier. This can help you map stations based on the marketing carrier you wish to display in your application.

HTTP Request

GET api.distribusion.com/retailers/v4/marketing_carriers/{code}/stations

Errors

Error Code Meaning
500.000.000 Internal Server Error
500.100.000 Service Unavailable

Stations

curl -X GET \
  'https://api-demo.distribusion.com/retailers/v4/stations?locale=en' \
  -H 'api-key: AIzaSyBGEpZdxbufTSpcIxWXoRjSdKu6ZctiuyI' \
  -H 'content-type: application/json' 

The above command returns JSON structured like this:

{
  "data": [
    {
      "id": "DEEIBUFE",
      "type": "stations",
      "attributes": {
        "code": "DEEIBUFE",
        "name": "Eisenach Uferstraße",
        "description": "Bus station is located at the intersection of Schillerstrasse and Gabelsberger Strasse, roughly 100 metres north-west of the Deutsche Bahn train station",
        "street_and_number": "Uferstraße 40",
        "zip_code": "99817",
        "longitude": 10.327165,
        "latitude": 50.978095,
        "time_zone": "Europe/Berlin"
      },
      "relationships": {
        "city": {
          "data": {
            "id": "DEEIB",
            "type": "cities"
          }
        }
      }
    },
    {
      "id": "DEBHEZOB",
      "type": "stations",
      "attributes": {
        "code": "DEBHEZOB",
        "name": "Bad Hersfeld ZOB",
        "description": "Bus station is located on the courtyard south-west of the Deutsche Bahn train station.",
        "street_and_number": "Bahnhofstraße 20",
        "zip_code": "36251",
        "longitude": 9.715529,
        "latitude": 50.868954,
        "time_zone": "Europe/Berlin"
      },
      "relationships": {
        "city": {
          "data": {
            "id": "DEBHE",
            "type": "cities"
          }
        }
      }
    },
    {
      "id": "DEBERBZO",
      "type": "stations",
      "attributes": {
        "code": "DEBERBZO",
        "name": "Berlin Bhf Zoo",
        "description": "The bus stop for Berlin Zoo Train Station is located right at Berlin's Zoological Gardens, at Hardenbergplatz 11, and is the departure point for numerous intercity buses. The stop is thus located slightly beyond the stops serviced by the Berlin Transit Corporation, which are nevertheless also accessible when exiting the station towards Hardenbergplatz. The proximity to the Zoo Train Station, as well as to S-Bahn lines (S5, S7, S75), U-Bahn lines (U2, U9), and regional trains is a major plus for all travellers hoping to reach other areas of Berlin.",
        "street_and_number": "Hardenbergplatz 15",
        "zip_code": "10623",
        "longitude": 13.33371,
        "latitude": 52.508425,
        "time_zone": "Europe/Berlin"
      },
      "relationships": {
        "city": {
          "data": {
            "id": "DEBER",
            "type": "cities"
          }
        }
      }
    }
      .....
  ],
  "jsonapi": {
    "version": "1.0"
  },
  "meta": {
    "locale": "en"
  }
}

This endpoint enable users to retrieve detailed information about stations, such as name, id, GPS location, address and description.

HTTP Request

GET api.distribusion.com/retailers/v4/stations

URL Parameters

Parameter Mandatory Description
locale true 2-letter alphanumeric lowercase code, according to ISO 639-1 standard.

Errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.014 Locale is invalid or missing
500.000.000 Internal Server Error
500.100.000 Service Unavailable

Errors

We have developed a set of error codes, destined to provide you with helpful information when integrating Distribusion API. We categorised them into three main types:

Client errors

Error Code Meaning
400.000.000 The provided json is invalid
400.100.000 Request invalid
400.101.002 Departure stations are invalid or missing
400.101.003 Arrival stations are invalid or missing
400.101.004 Departure station is invalid or missing
400.101.005 Arrival station is invalid or missing
400.101.006 Departure date is invalid or missing
400.101.007 Departure time is invalid or missing
400.101.008 Arrival time is invalid or missing
400.101.009 PAX is invalid or missing
400.101.010 Retailer partner number is invalid or missing
400.101.011 Payment method is invalid or missing
400.101.012 Payment token is invalid or missing
400.101.013 Payer ID is invalid or missing
400.101.014 Locale is invalid or missing
400.101.015 Currency is invalid or missing
400.101.016 Operating carrier is invalid or missing
400.101.017 Distribusion booking number is invalid or missing
400.101.018 Title is invalid or missing
400.101.019 First name is invalid or missing
400.101.020 Last name is invalid or missing
400.101.021 Email is invalid or missing
400.101.022 Phone is invalid or missing
400.101.023 City is invalid or missing
400.101.024 Zip code is invalid or missing
400.101.025 Street and number is invalid or missing
400.101.026 Total price is invalid or missing
400.101.027 Customer currency is invalid or missing
400.101.029 Send customer email is invalid or missing
400.101.030 Passenger first name is invalid or missing
400.101.031 Passenger last name is invalid or missing
400.101.032 Passenger type is invalid or missing
400.101.033 Passenger type pax is invalid or missing
400.101.034 Passenger type code is missing or invalid
400.101.035 Terms accepted is invalid or missing
400.101.036 Flight number is invalid or missing
400.101.037 Extra type is invalid or missing
400.101.038 Extra quantity is invalid or missing
400.101.039 Marketing carrier booking number is invalid or missing
400.101.040 Marketing carrier is invalid or missing
400.101.041 Booking is invalid or missing
400.101.042 Execute payment is invalid or missing
400.101.044 Departure date is in the past
400.101.049 Departure time must be before arrival time
400.101.050 Extras are invalid or missing
400.101.051 Passengers are invalid or missing
400.101.052 Discount code is invalid or missing
400.101.053 Bus Number is missing or invalid
400.102.040 Unknown marketing carrier
400.200.001 API key is invalid or missing
400.502.041 Booking already cancelled
400.800.000 Not Found
400.800.040 Marketing carrier not found
400.800.041 Booking not found
429.000.000 Too Many Requests
Error Code Meaning
400.501.000 Not implemented at Distribusion on connections#find
400.501.001 Not implemented on connections#redirect_to_checkout
400.501.002 Not implemented at Distribusion on connections#vacancy
400.501.003 Not implemented at Distribusion on bookings#create
400.501.004 Not implemented at Distribusion on bookings#form_schema
400.501.005 Not implemented at Distribusion on bookings#show
400.501.006 Not implemented at Distribusion on bookings#tickets
400.501.007 Not implemented at Distribusion on cancellations#conditions
400.501.008 Not implemented at Distribusion on cancellations#create
400.501.009 Not implemented at Distribusion on marketing_carriers#index
400.501.010 Not implemented at Distribusion on marketing_carriers#show
400.501.011 Not implemented at Distribusion on stations#index

Server errors

Error Code Meaning
500.000.000 Internal Server Error
500.100.000 Service Unavailable
500.500.017 Unique distribusion booking number cannot be generated
500.500.041 Unique booking id cannot be generated
500.501.000 Booking not vacant
500.502.026 Booking price increased
500.502.026 Booking price decreased
500.600.041 Unique cancellation id cannot be generated

Remote server errors

Error Code Meaning
600.000.000 Marketing Carrier remote system unavailable
600.100.000 Marketing Carrier remote system time-out
600.400.000 Marketing Carrier remote request invalid
600.500.000 Marketing Carrier remote connection unknown error
600.600.000 Marketing Carrier remote vacancy unknown error
600.700.000 Marketing Carrier remote booking failed error (general)
600.701.000 Marketing Carrier remote booking capacity error
600.702.000 Marketing Carrier remote booking price change error
600.703.000 Marketing Carrier remote booking tariff unavailable error
600.704.000 Marketing Carrier remote booking already cancelled error
600.705.000 Marketing Carrier remote booking vacancy unknown error
600.900.000 Response received from a remote server technically cannot be processed
600.901.000 Response from remote server logically cannot be processed (is invalid)
600.703.026 Booking price unknown

Dictionary

Booking Fee: A fee that is charged by a marketing carrier to the customer in the booking process. It is added on top of all ticket and extra prices and is independent of the amount of passengers (eg. National Express adds a pound on every booking made), not to confuse with Distribusion transaction fee.

Carrier: A Distribusion defined term to identify a Distribusion coded transporation companies.The Carrier can take up two roles within a trip: Marketing Carrier or Operating Carrier. Both is identified with the same code.

Commission: Form of payment to a retailer, we have 3 different commission types (OTAs, STAs, Affiliate). All of them are defined as net percentage of gross ticket value.

Credit Note: All commissions which retailers receive from Distribusion each month. provided in a PDF format.

Demand Note: OTAs and STAs are collecting the ticket revenues of consumers booking trips. A Demand Note is a consolidates statement of these ticket revenue of retailers provided as PDF. It also includes revenues from cancellations.

IATA: International Air Transport Association (IATA), IATA supports airline activity and helps formulate industry policy and standards.

IATA Code: 3-letter Codes for airports, started by IATA organization 70 years ago to standardize and harmonize locale of airports for the entire industry.

Marketing Carriers: Carrier which is defining the fare rules towards the customer and legally liable for the success of a booked trip (mostly also responsible for customer service). Marketing Carriers are also branding the ticket and using white label products in their solutions.

OTA: Short for: Online Travel Agency - website selling (not just showing) travel products to end consumers or business customers. Usually conduct payments and customer service to a certain degree. Distribusion supports OTA to perform “full booking integration” via the API.

Operating Carriers: Operating carriers are the entity actually driving the bus.

PAX: Abbreviation of “Persons approximately”, used in tourism for the number of passengers.

STA: Short for Stationary Travel Agencies.

Travel Agency: Online or Offline agency which sells tourism and mobility related products online (OTA) and Offline (STA).

Vacancy: Activity to derive prices for a selected connections or to verify availability, based on a selected amount of pax (including the specific types, such as child, adult, etc.)