API

Sections

Theme switcher

Discount Cards

Particularly in rail transport, it is common for carriers to offer discounts in the form of loyalty cards, vouchers or other mechanisms. Distribusion supports retrieving and booking these reduced fares through the API.

Please note that this is an enterprise API feature. Reach out to your Partnership Manager for more information about unlocking this and other advanced features.

Discounts Supported

Distribusion supports several types of discounts/special offers:

  • Discount Cards: with fixed discount value or percentage: E.g. Eurostar/SNCF Corporate and Negotiated Fares. Deutsche Bahn’s Bahncard 50, Trenitalia’s Carta Verde, or PKP’s Big Family Card. This type of discount may require the input of proof and/or an association with a particular passenger type, e.g. a student discount might require the input of a student ID number and Adult as a passenger type.
  • Loyalty Programs: E.g. Amtrak Guest Rewards.
  • One-time Vouchers, Promo Codes: E.g. summer campaign voucher.

Detailed information about the discounts supported by a specific carrier can be fetched via /cards endpoint. Information retreived from this endpoint is useful to generate descriptions and input fields to be displayed in the user interface.

Parameters

  • card_type: Type of an offer e.g. discount_card, loyalty, other
  • name: Unique name-id of the card
  • marketing_name: Localized text name of the discount card that can include spaces or special characters
  • supported_carriers_fares[]: List of marketing codes of carriers and fare classes, for filtering compatible offers
  • requires_code: If a card number/code needs to be validated during ordering to succesfully add the card (boolean)
  • requires_presenting_card: If passenger is required to keep and present the card along with the ticket for it to be valid (boolean)
  • context: Specifies the entity to which the card will be bound to provide its resulting advantage. Available options: Pax, Segment, Booking
  • description: Localized text description of given discount/promo

Context Types

There are 2 types of discount cards available from Distribusion. They can apply to specific passengers, segments or to the whole booking. This can be seen from context type, the card has to be applied at pax , segment or booking level.

When pushing the card details in the /connections/find and /connections/vacancy requests, use the correct parameters. If at passenger level passengers[][cards][][name]= and passengers[][cards][][code]=. If at booking level cards[][name]= and cards[][code]= .

API Workflow

Discounts can be leveraged through the API by filling the optional parameters at each step of the search and book workflow:

  1. Fetch supported discount card types from the /cards endpoint.
  2. Search for a trip with /connections/find and specify the precise passenger types and cards.
  3. The price returned will include the corresponding discount, or new fare classes will become available.
  4. When confirming the availability with the /connections/vacancy, again specify the applied discount cards.
  5. Create the reservation with the /reservations/create endpoint while specifying the applied discount cards.
  6. Continue with the Basic Integration flow.

API Examples

Sample Request to /cards

HTTP
https://api.demo.distribusion.com/retailers/v4/cards?locale=en&marketing_carriers[]=STES

Sample Response to /cards

JSON
{ "data": [ { "id": "DISTRIBUTION_AGREEMENT_EUROSTAR_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "EUROSTAR", "name": "DISTRIBUTION_AGREEMENT_EUROSTAR_STES", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Distribution agreement - Eurostar", "description": "Distribution agreement for Eurostar", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_LIBERTE_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "PLIB", "name": "ADVANTAGE_LIBERTE_STES", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Liberte Discount Card ", "description": "Liberte Discount Card ", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_FAMILLE30_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "FN30", "name": "ADVANTAGE_FAMILLE30_STES", "requires_code": false, "requires_presenting_card": false, "marketing_name": "Family Discount Card 30%", "description": "Family Discount Card 30%", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "LOYALTY_CLUB_EUROSTAR", "type": "cards", "attributes": { "card_type": "loyalty", "carrier_card_id": "Loyalty_eurostar", "name": "LOYALTY_CLUB_EUROSTAR", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Club Eurostar", "description": "Club Eurostar Loyalty Card", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "LOYALTY_GRAND_VOYAGEUR", "type": "cards", "attributes": { "card_type": "loyalty", "carrier_card_id": "loyalty", "name": "LOYALTY_GRAND_VOYAGEUR", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Grand Voyageur", "description": "Grand Voyageur", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "LOYALTY_GRAND_VOYAGEUR_LE_CLUB", "type": "cards", "attributes": { "card_type": "loyalty", "carrier_card_id": "loyalty_leclub", "name": "LOYALTY_GRAND_VOYAGEUR_LE_CLUB", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Grand Voyageur Le Club", "description": "Grand Voyageur Le Club", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "DISTRIBUTION_AGREEMENT_SNCF_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "SNCF", "name": "DISTRIBUTION_AGREEMENT_SNCF_STES", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Distribution agreement - SNCF", "description": "Distribution agreement for SNCF", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_SENIOR_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "PLOI_SENIOR", "name": "ADVANTAGE_SENIOR_STES", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Avantage Senior", "description": "Senior Advantage Card", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PSOE" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_ADULT_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "PLOI_WEEKEND", "name": "ADVANTAGE_ADULT_STES", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Avantage Adulte", "description": "Adult Advantage Discount Card", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_YOUTH_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "PLOI_JEUNE", "name": "ADVANTAGE_YOUTH_STES", "requires_code": true, "requires_presenting_card": false, "marketing_name": "Avantage Jeune", "description": "Youth Advantage Discount Card", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PYPO" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_FAMILLE40_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "FN40", "name": "ADVANTAGE_FAMILLE40_STES", "requires_code": false, "requires_presenting_card": false, "marketing_name": "Family Discount Card 40%", "description": "Family Discount Card 40%", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_FAMILLE50_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "FN50", "name": "ADVANTAGE_FAMILLE50_STES", "requires_code": false, "requires_presenting_card": false, "marketing_name": "Family Discount Card 50%", "description": "Family Discount Card 50%", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_FAMILLE75_STES", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "FN75", "name": "ADVANTAGE_FAMILLE75_STES", "requires_code": false, "requires_presenting_card": false, "marketing_name": "Family Discount Card 75%", "description": "Family Discount Card 75%", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PCIL", "PYPO", "PINT" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ANTT_Senior_100", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "ANTT_Senior_100", "name": "ANTT_Senior_100", "requires_code": false, "requires_presenting_card": true, "marketing_name": "Idoso 100%", "description": "Free ticket for senior citizens 65years +", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "AAAA", "fare_class_code": "FARE-1", "supports_all_fare_classes": true, "supports_all_carriers": true, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSEI" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": true, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_ACC_JEUNE", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "PLOI_ACC_ENFANT", "name": "ADVANTAGE_ACC_JEUNE", "requires_code": false, "requires_presenting_card": false, "marketing_name": "Child Carte Avantage ", "description": "Child carte avantage discount card", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PCIL" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ADVANTAGE_ACC_ADULTE", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "PLOI_ACC_ADULTE", "name": "ADVANTAGE_ACC_ADULTE", "requires_code": false, "requires_presenting_card": false, "marketing_name": "Companion ticket Carte Avantage", "description": "Companion ticket Carte Avantage", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "STES", "fare_class_code": "FARE-1", "supports_all_fare_classes": false, "supports_all_carriers": false, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS", "PSOE", "PYPO" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": false, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ANTT_Senior_50", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "ANTT_Senior_50", "name": "ANTT_Senior_50", "requires_code": false, "requires_presenting_card": true, "marketing_name": "Idoso 50%", "description": "Discounted ticket for senior citizens 65years +", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "PENH", "fare_class_code": "FARE-4", "supports_all_fare_classes": true, "supports_all_carriers": true, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": true, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ANTT_Youth_100", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "ANTT_Youth_100", "name": "ANTT_Youth_100", "requires_code": false, "requires_presenting_card": true, "marketing_name": "Jovem 100%", "description": "Free ticket for youth ", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "PENH", "fare_class_code": "FARE-4", "supports_all_fare_classes": true, "supports_all_carriers": true, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": true, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ANTT_Youth_50", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "ANTT_Youth_50", "name": "ANTT_Youth_50", "requires_code": false, "requires_presenting_card": true, "marketing_name": "Jovem 50%", "description": "Discounted ticket for youth ", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "PENH", "fare_class_code": "FARE-4", "supports_all_fare_classes": true, "supports_all_carriers": true, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": true, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ANTT_Disabled_100", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "ANTT_Disabled_100", "name": "ANTT_Disabled_100", "requires_code": false, "requires_presenting_card": true, "marketing_name": "Passe Livre (PcD)", "description": "Free tickets for disabled passengers", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "PENH", "fare_class_code": "FARE-4", "supports_all_fare_classes": true, "supports_all_carriers": true, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": true, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } }, { "id": "ANTT_Disabled_companion_100", "type": "cards", "attributes": { "card_type": "discount_card", "carrier_card_id": "ANTT_Disabled_companion_100", "name": "ANTT_Disabled_companion_100", "requires_code": false, "requires_presenting_card": true, "marketing_name": "Acompanhante Passe Livre", "description": "Free tickets for disabled passenger's companion", "context": "pax", "supported_carrier_fares": [ { "marketing_carrier_code": "AAAA", "fare_class_code": "FARE-1", "supports_all_fare_classes": true, "supports_all_carriers": true, "discount_value": null, "discount_type": null } ], "supported_passenger_type_codes": [ "PNOS" ], "flow_type": "live", "source": "carrier", "supports_all_passenger_types": true, "expiration_date": null, "status": "active", "retailers": [], "supports_all_retailers": true } } ], "jsonapi": { "version": "1.0" }, "meta": { "locale": "en" } }

For more samples responses, check the /cards endpoint page.

Sample Request to /connections/find

HTTP
https://api.demo.distribusion.com/retailers/v4/connections/find?locale=en¤cy=EUR&departure_stations[]=FRPARPGN&arrival_stations[]=GBLONLIB&departure_date=2024-09-10&departure_start_time=21:00&passengers[][pax]=1&passengers[][max_age]=20&passengers[][cards][][name]=DISTRIBUTION_AGREEMENT_EUROSTAR_STES&passengers[][cards][][code]=C002Z62

Sample Response from /connections/find

JSON
{ "data": [ { "attributes": { "arrival_time": "2024-09-10T22:30", "booked_out": false, "cheapest_fare_class_code": "FARE-5", "cheapest_total_adult_price": 5700, "departure_time": "2024-09-10T21:10", "duration": 8400, "electronic_ticket_available": false, "offer_bundle": null, "offer_id": null, "total_seats_left": null }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30", "relationships": { "arrival_station": { "data": { "id": "GBLONLIB", "type": "stations" } }, "departure_station": { "data": { "id": "FRPARPGN", "type": "stations" } }, "fares": { "data": [ { "fare_class": { "code": "FARE-2", "id": "STES-FARE-2", "type": "fare_classes" }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30-FARE-2", "original_price": 10900, "price": 10900, "type": "fares" }, { "fare_class": { "code": "FARE-5", "id": "STES-FARE-5", "type": "fare_classes" }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30-FARE-5", "original_price": 5700, "price": 5700, "type": "fares" }, { "fare_class": { "code": "FARE-1", "id": "STES-FARE-1", "type": "fare_classes" }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30-FARE-1", "original_price": 33000, "price": 33000, "type": "fares" } ] }, "marketing_carrier": { "data": { "id": "STES", "type": "marketing_carriers" } }, "segments": { "data": [ { "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30", "type": "segments" } ] } }, "type": "connections" } ], "included": [ { "attributes": { "arrival_time": "2024-09-10T22:30", "departure_time": "2024-09-10T21:10", "index": 0, "line": "9063", "line_prefix": "EUROSTAR" }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30", "relationships": { "amenities": { "data": [ { "id": "EURS-AAFR", "type": "amenities" } ] }, "arrival_station": { "data": { "id": "GBLONLIB", "type": "stations" } }, "departure_station": { "data": { "id": "FRPARPGN", "type": "stations" } }, "fares": { "data": [] }, "marketing_carrier": { "data": { "id": "STES", "type": "marketing_carriers" } }, "operating_carrier": { "data": { "id": "EURS", "type": "operating_carriers" } }, "vehicle": { "data": { "id": "TRAIN-STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30", "type": "vehicles" } } }, "type": "segments" }, { "id": "TRAIN-STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30", "relationships": { "vehicle_type": { "data": { "id": "TRAIN", "type": "vehicle_types" } } }, "type": "vehicles" }, { "attributes": { "code": "TRAIN" }, "id": "TRAIN", "type": "vehicle_types" }, { "attributes": { "booked_out": false, "original_price": 10900, "price": 10900, "seats_left": 21 }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30-FARE-2", "relationships": { "applied_cards": { "data": [] }, "conditions": { "data": [ { "id": "STES-03a55c808dd6e7b9c-5f4c902bb78a8759d", "type": "fare_conditions" } ] }, "fare_class": { "data": { "id": "STES-FARE-2", "type": "fare_classes" } } }, "type": "fares" }, { "attributes": { "booked_out": false, "original_price": 5700, "price": 5700, "seats_left": 81 }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30-FARE-5", "relationships": { "applied_cards": { "data": [] }, "conditions": { "data": [ { "id": "STES-540cb2b6316b11381-6474e4598dadddb51", "type": "fare_conditions" } ] }, "fare_class": { "data": { "id": "STES-FARE-5", "type": "fare_classes" } } }, "type": "fares" }, { "attributes": { "booked_out": false, "original_price": 33000, "price": 33000, "seats_left": 76 }, "id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30-FARE-1", "relationships": { "applied_cards": { "data": [] }, "conditions": { "data": [ { "id": "STES-ca5877f13e08d6699-f37d16f5ba3f22c0c", "type": "fare_conditions" } ] }, "fare_class": { "data": { "id": "STES-FARE-1", "type": "fare_classes" } } }, "type": "fares" }, { "attributes": { "code": "ESC_H19PSXASBEX_1", "description": "Paris Gare du Nord - London St Pancras Int'l - Public Standard Premier Semi-Flex\nExchange without a fee 1 hour before original departure time. If new ticket is more expensive, you’ll pay the difference. If new ticket is cheaper, the difference will not be refunded. Refundable with a €25/£25/$40 fee per person per leg up to 7 days before the departure date. Tickets exchanged less than 7 days before the departure date will become non-refundable.\n", "title": "Public Standard Premier Semi-Flex" }, "id": "STES-03a55c808dd6e7b9c-5f4c902bb78a8759d", "type": "fare_conditions" }, { "attributes": { "code": "ESC_B18PSXASBEX_1", "description": "Paris Gare du Nord - London St Pancras Int'l - Public Standard Semi-Flex\nExchange without a fee 1 hour before original departure time. If new ticket is more expensive, you’ll pay the difference. If new ticket is cheaper, the difference will not be refunded. Refundable with a €25/£25/$40 fee per person per leg up to 7 days before the departure date. Tickets exchanged less than 7 days before the departure date will become non-refundable.\n", "title": "Public Standard Semi-Flex" }, "id": "STES-540cb2b6316b11381-6474e4598dadddb51", "type": "fare_conditions" }, { "attributes": { "code": "ESC_A01C12ASBE_1;ESC_A01C12ASBE_2", "description": "Paris Gare du Nord - London St Pancras Int'l - Corporate Net Deal Business Fully-Flex\nRestricted sale (Corporate deal).\nExchangeable and refundable up to 60 days after departure.\n", "title": "Corporate Net Deal Business Fully-Flex" }, "id": "STES-ca5877f13e08d6699-f37d16f5ba3f22c0c", "type": "fare_conditions" }, { "attributes": { "code": "AAFR", "description": "The bus is easily accessible for people on wheelchairs.", "name": "Accessible area for wheelchairs" }, "id": "EURS-AAFR", "type": "amenities" }, { "attributes": { "booking_fee": 0, "code": "STES", "legal_name": "SNCF", "markup_fee_percentage": 0.0, "trade_name": "SNCF TEST" }, "id": "STES", "relationships": { "extra_types": { "data": [] }, "fare_classes": { "data": [ { "id": "STES-FARE-1", "type": "fare_classes" }, { "id": "STES-FARE-2", "type": "fare_classes" }, { "id": "STES-FARE-3", "type": "fare_classes" }, { "id": "STES-FARE-4", "type": "fare_classes" }, { "id": "STES-FARE-5", "type": "fare_classes" }, { "id": "STES-FARE-6", "type": "fare_classes" } ] }, "passenger_types": { "data": [ { "id": "PNOS", "type": "passenger_types" }, { "id": "PCIL", "type": "passenger_types" }, { "id": "PINT", "type": "passenger_types" }, { "id": "PYPO", "type": "passenger_types" }, { "id": "PSOE", "type": "passenger_types" } ] } }, "type": "marketing_carriers" }, { "attributes": { "code": "EURS", "legal_name": "SNCF", "trade_name": "Eurostar" }, "id": "EURS", "type": "operating_carriers" }, { "attributes": { "code": "PNOS", "description": "", "max_age": 59, "min_age": 26, "name": "Adult" }, "id": "PNOS", "type": "passenger_types" }, { "attributes": { "code": "PCIL", "description": "", "max_age": 11, "min_age": 4, "name": "Child" }, "id": "PCIL", "type": "passenger_types" }, { "attributes": { "code": "PINT", "description": "", "max_age": 3, "min_age": 0, "name": "Infant" }, "id": "PINT", "type": "passenger_types" }, { "attributes": { "code": "PYPO", "description": "", "max_age": 25, "min_age": 12, "name": "Youth" }, "id": "PYPO", "type": "passenger_types" }, { "attributes": { "code": "PSOE", "description": "", "max_age": 99, "min_age": 60, "name": "Senior" }, "id": "PSOE", "type": "passenger_types" }, { "attributes": { "code": "FRPARPGN", "description": "The train station is located on Rue de Dunkerque road. Passengers should find the exact platform on the information display board based on the departure time and the destination.", "latitude": 48.88089, "longitude": 2.354931, "name": "Paris Gare du Nord Train Station", "street_and_number": "18 Rue de Dunkerque", "time_zone": "Europe/Paris", "zip_code": "75010" }, "id": "FRPARPGN", "relationships": { "area": { "data": null }, "city": { "data": { "id": "FRPAR", "type": "cities" } } }, "type": "stations" }, { "attributes": { "code": "GBLONLIB", "description": "The train station is located near the intersection of Euston road and Midland road.", "latitude": 51.53141485394482, "longitude": -0.12587906645073, "name": "London St Pancras International Train Station", "street_and_number": "Euston Rd", "time_zone": "Europe/London", "zip_code": "N1C 4QL" }, "id": "GBLONLIB", "relationships": { "area": { "data": null }, "city": { "data": { "id": "GBLON", "type": "cities" } } }, "type": "stations" }, { "attributes": { "code": "FRPAR", "name": "Paris" }, "id": "FRPAR", "type": "cities" }, { "attributes": { "code": "GBLON", "name": "London" }, "id": "GBLON", "type": "cities" }, { "attributes": { "code": "FARE-1", "iata_category": null, "journey_type": "single", "name": "First Class - Flexi" }, "id": "STES-FARE-1", "relationships": { "fare_features": { "data": [ { "id": "STES-WIFI", "type": "fare_features" } ] } }, "type": "fare_classes" }, { "attributes": { "code": "FARE-2", "iata_category": null, "journey_type": "single", "name": "First Class - SemiFlexi" }, "id": "STES-FARE-2", "relationships": { "fare_features": { "data": [] } }, "type": "fare_classes" }, { "attributes": { "code": "FARE-3", "iata_category": null, "journey_type": "single", "name": "First Class - Cheapest" }, "id": "STES-FARE-3", "relationships": { "fare_features": { "data": [] } }, "type": "fare_classes" }, { "attributes": { "code": "FARE-4", "iata_category": null, "journey_type": "single", "name": "Second Class - Cheapest" }, "id": "STES-FARE-4", "relationships": { "fare_features": { "data": [] } }, "type": "fare_classes" }, { "attributes": { "code": "FARE-5", "iata_category": null, "journey_type": "single", "name": "Second Class - SemiFlexi" }, "id": "STES-FARE-5", "relationships": { "fare_features": { "data": [] } }, "type": "fare_classes" }, { "attributes": { "code": "FARE-6", "iata_category": null, "journey_type": "single", "name": "Second Class - Flexi" }, "id": "STES-FARE-6", "relationships": { "fare_features": { "data": [] } }, "type": "fare_classes" }, { "attributes": { "code": "WIFI", "description": "Wifi is available on board.", "name": "Wifi" }, "id": "STES-WIFI", "type": "fare_features" } ], "jsonapi": { "version": "1.0" }, "meta": { "currency": "EUR", "locale": "en" } }

For more sample responses, check the /connections/find endpoint page.

Sample Request to /connections/vacancy

HTTP
https://api.demo.distribusion.com/retailers/v4/connections/vacancy?currency=EUR&marketing_carrier=STES&departure_station=FRPARPGN&arrival_station=GBLONLIB&departure_time=2024-09-10T21:10&arrival_time=2024-09-10T22:30&passengers[][pax]=1&passengers[][type]=PNOS&fare_class=FARE-1&retailer_partner_number={{rpn}}&passengers[][cards][][name]=DISTRIBUTION_AGREEMENT_EUROSTAR_STES&passengers[][cards][][code]=C002Z62

Sample Response from /connections/vacancy

JSON
{
"data": {
"id": "STES-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30",
"type": "vacancies",
"attributes": {
"vacant": true,
"total_price": 33000,
"original_price": 33000
},
"relationships": {
"applied_cards": {
"data": []
},
"fees": {
"data": []
},
"ancillary_options": {
"data": []
}
}
},
"jsonapi": {
"version": "1.0"
},
"meta": {
"currency": "EUR"
},
"included": []
}

For more samples responses, check the /connections/vacancy endpoint page.

Sample Request to /reservations/create

JSON
{ "marketing_carrier": "STES", "departure_station": "FRPARPGN", "arrival_station": "GBLONLIB", "departure_time": "2024-09-10T21:10", "arrival_time": "2024-09-10T22:30", "retailer_partner_number": "{{rpn}}", "fare_class": "FARE-1", "locale": "en", "currency": "EUR", "title": "mr", "first_name": "John", "last_name": "Smith", "email": "andre.franchini@distribusion.com", "phone": "+4915222088994", "city": "Berlin", "zip_code": "13355", "street_and_number": "Wattstrasse 10", "passengers": [ { "type": "PNOS", "first_name": "John", "last_name": "Smith", "birthdate": "1970-07-21", "nationality": "DE", "cards": [ { "name": "DISTRIBUTION_AGREEMENT_EUROSTAR_STES", "code": "C002Z62" } ] } ] }

Sample Response from /reservations/create

JSON
{ "data": { "id": "R1N7QRHL", "type": "reservations", "attributes": { "total_price": 33000, "original_price": 33000, "state": "created", "created_at": "2024-09-09T14:24", "confirmed_at": null, "cancelled_at": null, "failed_at": null, "processing_started_at": null, "processing_deadline": null, "expires_at": "2024-09-10T11:10", "terms_version": null, "title": "mr", "first_name": "John", "last_name": "Smith", "email": "andre.franchini@distribusion.com", "phone": "+4915222088994", "city": "Berlin", "zip_code": "13355", "country_code": null, "street_and_number": "Wattstrasse 10", "gender": null, "country_of_birth": null, "government_id_type": null, "marketing_carrier_reservation_ids": [ "CFH9V9-Smith" ], "agent_id": null, "retailer_booking_number": null }, "relationships": { "booking": { "data": null }, "errors": { "data": [] }, "reservation_passengers": { "data": [ { "id": "R-PNOS-1-EURS-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30", "type": "reservation_passengers" } ] }, "applied_cards": { "data": [] }, "ancillaries": { "data": [] } } }, "jsonapi": { "version": "1.0" }, "meta": { "currency": "EUR", "locale": "en" }, "included": [ { "id": "R-PNOS-1-EURS-FRPARPGN-GBLONLIB-2024-09-10T21:10-2024-09-10T22:30", "type": "reservation_passengers", "attributes": { "first_name": "John", "last_name": "Smith", "serial_code": null, "government_id_type": null, "nationality": "DE", "gender": null, "country_of_birth": null, "birthdate": "1970-07-21", "type": "PNOS" }, "relationships": { "ancillaries": { "data": [] } } } ] }

For more samples responses, check the /reservations/create endpoint page.

Was this section helpful?

What made this section unhelpful for you?

On this page
  • Discount Cards
View as Markdown

Ask an AI

Open in ChatGPTOpen in ClaudeOpen in Perplexity

Code with AI

Open in Copilot