Skip to content

Instantly share code, notes, and snippets.

@flovilmart
Created October 1, 2018 15:49
Show Gist options
  • Save flovilmart/6c7f63a2c64ebfd9190beaf7ff6bbdab to your computer and use it in GitHub Desktop.
Save flovilmart/6c7f63a2c64ebfd9190beaf7ff6bbdab to your computer and use it in GitHub Desktop.
GET /retailers/v4/connections/vacancy?marketing_carrier=GBIO&departure_station=BGVARZOB&arrival_station=BGSOFCBS&departure_time=2018-10-01T11%3A30&arrival_time=2018-10-01T17%3A15&currency=EUR&passengers%5B%5D%5Bpax%5D=1&passengers%5B%5D%5Btype%5D=PNOS HTTP/1.1
Host: api.distribusion.com
Api-Key: 2QMcWJPgloYUC1UjdkpaGzZ3sUX2MHdBRQh1PNo8
X-Busbud-Requestid: 2018092614331414df5d4bb815c4d093248fce396505a8273d64d2237ed6e2f779fb52dcb0ed+1537972431874
X-Busbud-Purchaseid: 2796670
X-Busbud-Partnerid: null
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
X-Request-Id: 6d7f9baffb2c0bc01ffc4c2fd5d256cf
Connection: close
Content-Length: 195
{
"data": {
"id": "GBIO-BGVARZOB-BGSOFCBS-2018-10-01T11:30-2018-10-01T17:15",
"type": "vacancies",
"attributes": {
"vacant": true,
"total_price": 1636
}
},
"jsonapi": {
"version": "1.0"
},
"meta": {
"currency": "EUR"
}
}
---
GET /retailers/v4/connections/vacancy?marketing_carrier=GBIO&departure_station=BGVARZOB&arrival_station=BGSOFCBS&departure_time=2018-10-01T11%3A30&arrival_time=2018-10-01T17%3A15&currency=EUR&passengers%5B%5D%5Bpax%5D=1&passengers%5B%5D%5Btype%5D=PNOS HTTP/1.1
Host: api.distribusion.com
Api-Key: 2QMcWJPgloYUC1UjdkpaGzZ3sUX2MHdBRQh1PNo8
X-Busbud-Requestid: 2018092614331414df5d4bb815c4d093248fce396505a8273d64d2237ed6e2f779fb52dcb0ed+1537972431874
X-Busbud-Purchaseid: 2796670
X-Busbud-Partnerid: null
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
X-Request-Id: a6755d85d189ef719c1e088220cac2aa
Connection: close
Content-Length: 195
{
"data": {
"id": "GBIO-BGVARZOB-BGSOFCBS-2018-10-01T11:30-2018-10-01T17:15",
"type": "vacancies",
"attributes": {
"vacant": true,
"total_price": 1636
}
},
"jsonapi": {
"version": "1.0"
},
"meta": {
"currency": "EUR"
}
}
---
POST /departure/fetch-details HTTP/1.1
Host: int-distribusion.busbud-int.com
Accept: */*
Content-Type: application/json
User-Agent: busbud-adapter
X-Busbud-Requestid: 2018092614331414df5d4bb815c4d093248fce396505a8273d64d2237ed6e2f779fb52dcb0ed+1537972431874
X-Busbud-Purchaseid: 2796670
X-Busbud-Partnerid: null
X-Busbud-Token: API_e1XpGK-bQJCqUPEwIis5kg
Accept-Encoding: gzip, deflate
Content-Length: 1574
X-Newrelic-Id: VwQOVFBaGwEGV1FSAwYD
X-Newrelic-Transaction: PxQCBABaXVICXQNSVQAHBUYdUFIOFQZOElcKWgENUVFSA1oHB1MDQEgUA1FVBl4DBwdDPw==
X-Cloud-Trace-Context: b8d5c04943774edc9a1d06506430f1cc/16078715595125856572
Via: 1.1 google
X-Forwarded-For: 54.216.55.252, 35.227.201.128
X-Forwarded-Proto: https
Connection: Keep-Alive
{
"departure": {
"id": "NTI3OGQ0ODg6MmZhZjVlNzY",
"operator": "GBIO",
"origin_xid": "BGVARZOB",
"destination_xid": "BGSOFCBS",
"departure_time": "2018-10-01T11:30:00.000",
"arrival_time": "2018-10-01T17:15:00.000",
"class": "Economy",
"available_seats": 1,
"bus": null,
"trip_stops": [],
"addons": [],
"currency": "EUR",
"prices": {
"currency": "EUR",
"total": 1636,
"categories": {
"adult": 1636,
"child": 1636
},
"discount": 0,
"roundtrip_min": null,
"roundtrip_total": null,
"discounted": null,
"breakdown": {
"base": 1636,
"fees": 0,
"taxes": 0,
"discount": 0
},
"return_price_min": null,
"return_price_min_currency": null,
"outbound_price": null,
"outbound_price_currency": null
},
"details": {
"marketing_carrier": "GBIO",
"departure_time": "2018-10-01T11:30",
"arrival_time": "2018-10-01T17:15"
},
"ticket_type": "eticket",
"ticket_types": [
"eticket"
],
"complete": true,
"search_details_complete": true,
"has_search_details": false,
"has_transfers": null,
"roundtrip_details": null,
"schedule_id": null,
"fetched_at": "2018-09-26T14:33:05.915Z"
},
"passenger_counts": {
"adult": 1
},
"options": {
"partner_id": null,
"purchase_id": 2796670,
"request_id": "2018092614331414df5d4bb815c4d093248fce396505a8273d64d2237ed6e2f779fb52dcb0ed+1537972431874",
"is_international": null,
"purchaser": {
"email": "[email protected]",
"client_ip": "70.52.96.169",
"locale": "en-us",
"lang": "en"
},
"passengers": [
{
"id": "725c8804-c3eb-4340-9ec7-8a328e54666b",
"first_name": "Dave",
"last_name": "Folkins",
"phone_number": null,
"departure_id": 3242782,
"age": null,
"category": "adult",
"busbud_category": "adult",
"questions": {
"gender": "male"
},
"details": {},
"selected_seat": null,
"wheelchair": false,
"addons": []
}
]
}
}
HTTP/1.1 200 OK
X-Powered-By: Express
X-Rate-Limit-Consumption: 2
Content-Type: application/json; charset=utf-8
Content-Length: 945
ETag: W/"3b1-xmQ32aownXm7wrgKewBOwshOE3Y"
{
"id": "NTI3OGQ0ODg6MmZhZjVlNzY",
"operator": "GBIO",
"origin_xid": "BGVARZOB",
"destination_xid": "BGSOFCBS",
"departure_time": "2018-10-01T11:30:00.000",
"arrival_time": "2018-10-01T17:15:00.000",
"class": "Economy",
"available_seats": 1,
"bus": null,
"trip_stops": [],
"addons": [],
"currency": "EUR",
"prices": {
"currency": "EUR",
"total": 1636,
"categories": {
"adult": 1636,
"child": 1636
},
"discount": 0,
"roundtrip_min": null,
"roundtrip_total": null,
"discounted": null,
"breakdown": {
"base": 1636,
"fees": 0,
"taxes": 0,
"discount": 0
},
"return_price_min": null,
"return_price_min_currency": null,
"outbound_price": null,
"outbound_price_currency": null
},
"details": {
"marketing_carrier": "GBIO",
"departure_time": "2018-10-01T11:30",
"arrival_time": "2018-10-01T17:15"
},
"ticket_type": "eticket",
"ticket_types": [
"eticket"
],
"complete": true,
"search_details_complete": true,
"has_search_details": false,
"has_transfers": null,
"roundtrip_details": null,
"schedule_id": null,
"fetched_at": "2018-09-26T14:33:05.915Z"
}
---
POST /retailers/v4/bookings/create HTTP/1.1
Host: api.distribusion.com
Api-Key: 2QMcWJPgloYUC1UjdkpaGzZ3sUX2MHdBRQh1PNo8
X-Busbud-Requestid: 2018092614331414df5d4bb815c4d093248fce396505a8273d64d2237ed6e2f779fb52dcb0ed+1537972431874
X-Busbud-Purchaseid: 2796670
X-Busbud-Partnerid: null
Accept: application/json
Content-Type: application/json
Content-Length: 631
{
"marketing_carrier": "GBIO",
"departure_station": "BGVARZOB",
"arrival_station": "BGSOFCBS",
"departure_time": "2018-10-01T11:30",
"arrival_time": "2018-10-01T17:15",
"retailer_partner_number": "610690",
"title": "mr",
"first_name": "Dave",
"last_name": "Folkins",
"email": "[email protected]",
"phone": "18889885185",
"city": "Montreal",
"zip_code": "H2T 1X6",
"street_and_number": "5425 av. Casgrain, suite 901",
"execute_payment": false,
"payment_method": "credit_card",
"total_price": 1636,
"pax": 1,
"terms_accepted": true,
"locale": "en",
"currency": "EUR",
"send_customer_email": false,
"passengers": [
{
"first_name": "Dave",
"last_name": "Folkins",
"type": "PNOS"
}
]
}
HTTP/1.1 500 Internal Server Error
Content-Type: application/vnd.api+json
X-Request-Id: 097239acf67b80a86382a4902c66e98a
Connection: close
Content-Length: 95
{
"errors": [
{
"code": "500.000.000",
"title": "Internal Server Error"
}
],
"jsonapi": {
"version": "1.0"
}
}
---
POST /distribusion/booking/book HTTP/1.1
Host: int-distribusion.busbud-int.com
Accept: */*
Content-Type: application/json
User-Agent: busbud-adapter
X-Busbud-Requestid: 2018092614331414df5d4bb815c4d093248fce396505a8273d64d2237ed6e2f779fb52dcb0ed+1537972431874
X-Busbud-Purchaseid: 2796670
X-Busbud-Partnerid: null
X-Busbud-Token: API_e1XpGK-bQJCqUPEwIis5kg
Accept-Encoding: gzip, deflate
Content-Length: 1705
X-Newrelic-Id: VwQOVFBaGwEGV1FSAwYD
X-Newrelic-Transaction: PxQCBABaXVICXQNSVQAHBUYdUFIOFQZOElcKWgENUVFSA1oHB1MDQEgUA1FVBl4DBwdDPw==
X-Cloud-Trace-Context: 88a6cc037cd0081fdd79ae2877453b9f/16470073214596625765
Via: 1.1 google
X-Forwarded-For: 54.216.55.252, 35.227.201.128
X-Forwarded-Proto: https
Connection: Keep-Alive
{
"departure": {
"id": "NTI3OGQ0ODg6MmZhZjVlNzY",
"operator": "GBIO",
"origin_xid": "BGVARZOB",
"destination_xid": "BGSOFCBS",
"departure_time": "2018-10-01T11:30:00.000",
"arrival_time": "2018-10-01T17:15:00.000",
"class": "Economy",
"available_seats": 1,
"bus": null,
"trip_stops": [],
"addons": [],
"currency": "EUR",
"prices": {
"currency": "EUR",
"total": 1636,
"breakdown": {
"base": 1636,
"fees": 0,
"taxes": 0,
"discount": 0
},
"categories": {
"adult": 1636,
"child": 1636
},
"discount": 0,
"roundtrip_min": null,
"roundtrip_total": null,
"return_price_min": null,
"return_price_min_currency": null,
"outbound_price": null,
"outbound_price_currency": null,
"discounted": null,
"line_items": []
},
"details": {
"marketing_carrier": "GBIO",
"departure_time": "2018-10-01T11:30",
"arrival_time": "2018-10-01T17:15"
},
"ticket_type": "eticket",
"ticket_types": [
"eticket"
],
"complete": true,
"search_details_complete": true,
"has_search_details": false,
"has_transfers": null,
"roundtrip_details": null,
"schedule_id": null,
"fetched_at": "2018-09-26T14:33:05.915Z"
},
"passengers": [
{
"id": "725c8804-c3eb-4340-9ec7-8a328e54666b",
"first_name": "Dave",
"last_name": "Folkins",
"phone_number": null,
"departure_id": 3242782,
"age": null,
"category": "adult",
"busbud_category": "adult",
"questions": {
"gender": "male"
},
"details": {},
"selected_seat": null,
"wheelchair": false,
"addons": []
}
],
"purchaser": {
"email": "[email protected]",
"client_ip": "70.52.96.169",
"locale": "en-us",
"lang": "en"
},
"options": {
"spreedly_payment_method": "5RR9bFGHKIqrP46yeFDDGOmvwH6",
"gateway_token": null,
"fraud_check_result": null,
"purchase_id": 2796670,
"transaction_id": 2591292,
"partner_id": null,
"is_support": null,
"request_id": "2018092614331414df5d4bb815c4d093248fce396505a8273d64d2237ed6e2f779fb52dcb0ed+1537972431874",
"is_international": null
}
}
HTTP/1.1 500 Internal Server Error
X-Powered-By: Express
X-Rate-Limit-Consumption: 1
Content-Type: application/json; charset=utf-8
Content-Length: 75
ETag: W/"4b-Pag86YdVqmmlubGYAPravmaSOBE"
{
"error": {
"name": "DistribusionAPIError",
"message": "",
"code": "500.000.000"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment