openapi: 3.2.0 info: title: Amex Gbt DutyOfCare Data API version: v1.0 description: 'Operations tagged DutyOfCare Data across 2 of this provider''s published API definitions: amex-gbt-duty-of-care-api-openapi.json, amex-gbt-service-dutyofcare-openapi.json. Each path carries the servers of the definition it was published in.' servers: - url: https://apis.egencia.com/dutyofcare/api description: Generated server url tags: - name: DutyOfCare Data paths: /v1/bookings: post: description: "

In general, the DoC API uses HTTPs POST requests with JSON arguments and JSON responses. This API call allows the client to submit a request for retrieving paginated booking data for a specified search criterion.

\n
\n

Request Parameters:

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FieldTypeRequired/OptionalDescription
\n partner_id\n IntegerRequiredUnique identifier provided to partner by Egencia.
\n company_id\n IntegerOptionalThe company ID list. Company ID is a Unique Identifier for the company.
\n start_date_time\n StringOptionalThe date-time range to fetch the booking data. Timestamp in ISO 8601
format: YYYY-MM-\n DDTHH:MM:SSZ Example: 2020-01-21T10:07:41.208Z.\n The date range should come as a pair.\n
    \n
  • Future date is not allowed as start date.
  • \n
  • If the only start date-time is given, the range will be automatically set to next 24 hours from the start date-time.
  • \n
  • If the only end date-time is given, the range will be automatically set to last 24 hours from the end date-time.
  • \n
  • Missing both start and end date-time will be considered as the latest 24 hours.
  • \n
\n *Default timezone is GMT.\n
\n end_date_time\n StringOptionalThe date-time range to fetch the booking data. Timestamp in ISO 8601
format: YYYY-MM-\n DDTHH:MM:SSZ Example: 2020-01-21T10:07:41.208Z.\n The date range should come as a pair.\n
    \n
  • Future date is not allowed as start date.
  • \n
  • If the only start date-time is given, the range will be automatically set to next 24 hours from the start date-time.
  • \n
  • If the only end date-time is given, the range will be automatically set to last 24 hours from the end date-time.
  • \n
  • Missing both start and end date-time will be considered as the latest 24 hours.
  • \n
\n *Default timezone is GMT.\n
\n\n

\n
Request Parameters:
\n

Success Response - 200 OK

\n

\n The request has succeeded. This endpoint will return metadata of the resource for the given request. If there is no content available or no more records available, it will return the below success messages.\n\n

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n
Response CodeDescription
200\n
    \n
  • 200 OK; BOOKINGS_NOT_AVAILABLE(\"No bookings available for this particular request\")
  • \n
  • 200 OK; NO MORE BOOKING(“ All records have been fetched. No more bookings available for this request.”)
  • \n
\n
\n

\n

Pagination Response

\n

This API will return the metadata (hyperlinks) of the resource from where you can fetch all the qualified booking records in a paginated manner. You can page through the resource by making a GET request to the NextPage URL provided in the paginated response. If there are no more pages, NextPage will be set to ‘null’.

\n
\n

\n \n Response Parameter\n \n

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
AttributeTypeDescription
total_pagesIntegerTotal Pages in the response.
page_limitIntegerThe maximum number of records allowed in a single page.
total_recordsIntegerTotal number of records in the response.
Current_pageIntegerPage number of the displayed record..
\n\nExamples:
\n\n

Consider a trip from Los Angeles to Dublin. The trip contains two flight booking from Los Angeles to Paris and Paris to Dublin. Also the trip contains a hotel booking in Dublin for 2 days.

\n
\nTrip Details
\n
\n company_id\": \"35067\",
\n Booking 1: Hotel booking
\n Booking 2: Car booking
\n
\n
\n

In this booking there are 2 records. The hotel and car booking will be considered as two separate records.

\n
\nNote:\n\n
\n

Sample Request

\n
\n    \n        curl 'https://apis.egencia.com/ dutyofcare/api/v1/bookings' -X POST\n         -H 'Content-Type: application/json;charset=UTF-8' \\\n         -H 'Accept: application/json' \\\n         -d '{\n            \"partner_id\" :\"92\",\n            \"company_id\" :[35067],\n             \"start_date_time\": \"2020-06-21T00:00:11Z\",\n             \"end_date_time\": \"2020-06-31T23:59:59Z\"\n          }'\n    \n
\n
\n

Sample Response

\n
\n    \n{\n    \"metadata\": {\n       \"total_pages\": 5,\n       \"total_records\" : 10,\n       \"page_limit\" : 2,\n       \"current_page\": 0\n    },\n    \"_links\": {\n        \"next\": {\n            \"href\": \"https:// apis.egencia.com/dutyofcare/api /v1/bookings/89ef5828-6d9f-4429-ab73-5ee40cf7b4e7\"\n        }\n    }\n}\n    \n
\n
\n\n

Fetching Duty of care data:

\n
\n\n

This API will return all booking data for all the lob's like FLIGHT, TRAIN, CAR and HOTEL

" operationId: getDutyOfCareData requestBody: content: application/json: schema: $ref: '#/components/schemas/Duty_of_Care_Request_Bean' responses: '200': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'OK : booking data pulled successfully' '400': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Bad Request : request body is malformed, or contains invalid values' '401': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Unauthorized : authentication token empty, invalid or expired' '403': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Forbidden : user do not have the permission to access data' '404': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Not found : data which satisfying provided input details does not exist' '500': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Internal error : no data, or other unexpected error' security: - OAuth2: [] summary: Create Metadata based on the Search Request tags: - DutyOfCare Data servers: - url: https://apis.egencia.com/dutyofcare/api description: Generated server url /v1/bookings/{resourceId}: get: description: "

Sample Request

\n
\n    \n
\n GET\n https://apis.egencia.com/dutyofcare/api/v1/bookings/89ef5828-6d9f-4429-ab73-5ee40cf7b4e7\n
\n
\n
\n
\n

Sample Response

\n
\n    \n   {\n    \"record_list\": [\n        {\n            \"record_locator\": \"5f19782e74b12400018f9e7d-169294509\",\n            \"company_id\": 35067,\n            \"trip_id\": \"0600-2564-655\",\n            \"booking_status\": \"CONFIRMED\",\n            \"line_of_business\": \"HOTEL\",\n            \"booking_reference\": \"51820505181\",\n            \"traveler_details\": [\n                {\n                    \"first_name\": \"Bruce\",\n                    \"last_name\": \"Wayne\",\n                    \"email\": \"Brucebat@egencia.com\",\n                    \"phone\": \"NA\",\n                    \"custom_data_fields\": [\n                        {\n                            \"name\": \"Main cost centre\",\n                            \"value\": \"CC1-2\"\n                        }\n                    ]\n                }\n            ],\n            \"hotel_segment_details\": [\n                {\n                    \"hotel_checkin_datetime\": \"2020-07-30T00:00:00+0200\",\n                    \"hotel_checkout_datetime\": \"2020-07-31T00:00:00+0200\",\n                    \"hotel_name\": \"Novum Hotel Savoy Hamburg Mitte\",\n                    \"hotel_address\": \"Steindamm 54, Hamburg, HH, 20099, DEU\",\n                    \"hotel_phone\": \"49 40 18881160\",\n                    \"hotel_longitude\": \"10.014033\",\n                    \"hotel_latitude\": \"53.554398\"\n                }\n            ]\n        },\n        {\n            \"record_locator\": \"5f197a4d74b12400018f9e88-169294510\",\n            \"company_id\": 35067,\n            \"trip_id\": \"0600-2564-655\",\n            \"booking_status\": \"CONFIRMED\",\n            \"line_of_business\": \"CAR\",\n            \"booking_reference\": \"R3935B\",\n            \"traveler_details\": [\n                {\n                    \"first_name\": \"Bruce\",\n                    \"last_name\": \"Wayne\",\n                    \"email\": \" Brucebat@egencia.com\",\n                    \"phone\": \"NA\",\n                    \"custom_data_fields\": [\n                        {\n                            \"name\": \"Main cost centre\",\n                            \"value\": \"CC1-2\"\n                        }\n                    ]\n                }\n            ],\n            \"car_segment_details\": [\n                {\n                    \"car_pickup_iata_code\": \"DEU\",\n                    \"car_pickup_datetime\": \"2020-07-30T12:00:00+0200\",\n                    \"car_dropoff_iata_code\": \"DEU\",\n                    \"car_dropoff_datetime\": \"2020-07-31T12:00:00+0200\",\n                    \"car_vendor_name\": \"Enterprise\",\n                    \"car_vendor_code\": \"ET\"\n                }\n            ]\n        }\n    ],\n    \"metadata\": {\n        \"total_pages\": 5,\n        \"total_records\": 10,\n        \"page_limit\": 2,\n        \"current_page\": 2\n    },\n    \"_links\": {\n        \"next\": {\n            \"href\": \"https:// apis.egencia.com/dutyofcare/api /v1/bookings/89ef5828-6d9f-4429-ab73-5ee40cf7b4e7\"\n        }\n    }\n   }\n
\n
\n
\n

\n

\n Each record will have multiple fields associated with it. You can see a full list of available fields in LOB wise records below.\n

\n\n

\n Note: \n
\n

\n\n

\n\n

\n \n Multi Traveler Booking Example\n \n

\n
\n    \n   {\n    \"record_list\": [{\n        \"record_locator\": \"5f1974f874b12400018f9e6f-169294506\",\n        \"company_id\": 35067,\n        \"trip_id\": \"0600-2564-652\",\n        \"booking_status\": \"CONFIRMED\",\n        \"line_of_business\": \"TRAIN\",\n        \"booking_reference\": \"296896444, 187123510\",\n        \"traveler_details\": [{\n                \"first_name\": \"Bruce\",\n                \"last_name\": \"Wayne\",\n                \"email\": \"Brucebat@egencia.com\",\n                \"phone\": \"456789\",\n                \"custom_data_fields\": [{\n                    \"name\": \"Main cost centre\",\n                    \"value\": \"CC1-2\"\n                }]\n            },\n            {\n                \"first_name\": \"natasha\",\n                \"last_name\": \"romanof\",\n                \"email\": \"natroma@egencia.com\",\n                \"phone\": \"12345\",\n                \"custom_data_fields\": [{\n                    \"name\": \"Main cost centre\",\n                    \"value\": \"CC1-2\"\n                }]\n            }\n        ],\n        \"train_segment_details\": [{\n                \"carrier_code\": \"DBA\",\n                \"train_departure_city_rail_code\": \"8098160\",\n                \"train_arrival_city_rail_code\": \"8002549\",\n                \"train_departure_datetime\": \"2020-07-30T16:38:00+0200\",\n                \"train_arrival_datetime\": \"2020-07-30T18:22:00+0200\",\n                \"train_departure_latitude\": \"52.525085\",\n                \"train_departure_longitude\": \"13.369402\",\n                \"train_arrival_latitude\": \"53.552925\",\n                \"train_arrival_longitude\": \"10.006604\"\n                \"train_departure_station_name\": \"Amsterdam Centraal\",\n                \"train_arrival_station_name\": \"Rotterdam Centraal\",\n                \"train_number\": \"9870\"\n            },\n            {\n                \"carrier_code\": \"DBA\",\n                \"train_departure_city_rail_code\": \"8002549\",\n                \"train_arrival_city_rail_code\": \"8098160\",\n                \"train_departure_datetime\": \"2020-07-31T06:35:00+0200\",\n                \"train_arrival_datetime\": \"2020-07-31T08:20:00+0200\",\n                \"train_departure_latitude\": \"53.552925\",\n                \"train_departure_longitude\": \"10.006604\",\n                \"train_arrival_latitude\": \"52.525085\",\n                \"train_arrival_longitude\": \"13.369402\"\n                \"train_departure_station_name\": \"Rotterdam Centraal\",\n                \"train_arrival_station_name\": \"Amsterdam Centraal\",\n                \"train_number\": \"9870\"\n            }\n        ]\n    }],\n    \"metadata\": {\n        \"total_pages\": 11,\n        \"total_records\": 11,\n        \"page_limit\": 1,\n        \"current_page\": 4\n    },\n    \"_links\": {\n        \"next\": {\n            \"href\": \"https://apis-us-west-2.lab.egencia.cloud/dutyofcare/api/v1/bookings/90ab1f54-9c91-4eba-b8c8-93f8328ee178\"\n        }\n    }\n   }\n
\n
\n
" operationId: getBookings parameters: - description: Unique resource identifier returned from the POST /bookings response in: path name: resourceId required: true schema: type: string - description: page example: 1 in: query name: page required: false schema: type: integer format: int32 responses: '200': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'OK : duty of care booking data returned successfully' '400': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Bad Request : request contains invalid values, e.g. non-numeric page parameter' '401': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Unauthorized : authentication token empty, invalid or expired' '403': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Forbidden : user do not have the permission to access data' '500': content: application/json: schema: $ref: '#/components/schemas/Duty_Of_Care_Response_Bean' description: 'Internal error : no data, or other unexpected error' security: - OAuth2: [] summary: Get the duty of care data as per the Request tags: - DutyOfCare Data servers: - url: https://apis.egencia.com/dutyofcare/api description: Generated server url components: schemas: Air_Segment_Details: properties: airlineCode: type: string description: Unique airline code to identify the traveler airline flightArrivalDatetime: type: string description: 'Actual flight arrival date-time in ISO 8601 format: YYYY-MM-DDTHH:MM:SS' flightArrivalIataCode: type: string description: Actual flight arrival IATA Code in standard format flightDepartureDatetime: type: string description: 'Actual flight departure date-time in ISO 8601 format: YYYY-MM-DDTHH:MM:SS' flightDepartureIataCode: type: string description: Actual flight departure IATA Code in standard format flightNumber: type: string description: Unique airline code for the particular flight Metadata_corresponding_to_a_request: description: Represents the Metadata information properties: currentPage: type: integer format: int32 description: Indicates the current page pageLimit: type: integer format: int32 description: Indicates the Page Size for the request totalPages: type: integer format: int32 description: Indicates the total number of expected pages totalRecords: type: integer format: int32 description: Indicates the toal number of records for the request Traveler_Details: properties: customDataFields: type: array description: Custom data fields items: $ref: '#/components/schemas/Custom_Data_Fields' email: type: string description: Email address of the person for whom the travel booking was made firstName: type: string description: First Name of the person for whom the travel booking was made lastName: type: string description: Last Name of the person for whom the travel booking was made phone: type: string description: Phone number of the person for whom the travel booking was made Duty_Of_Care_Response_Bean: description: Represents the API model for Doc service Public response properties: links: type: array items: $ref: '#/components/schemas/Link' metadata: $ref: '#/components/schemas/Metadata_corresponding_to_a_request' recordList: type: array description: List of records items: $ref: '#/components/schemas/Doc_Records_List' Rail_Segment_Details: properties: carrierCode: type: string description: Unique carrier code of the traveler’s carrier trainArrivalCityRailCode: type: string description: Arrival city rail code of the of traveler's train journey trainArrivalDatetime: type: string description: 'Arrival date-time of the traveler’s train journey in ISO 8601 format: YYYY-MM-DDTHH:MM:SS' trainArrivalLatitude: type: string description: Latitude of the train arrival location trainArrivalLongitude: type: string description: Longitude of the train arrival location trainArrivalStationName: type: string description: Arrival station name of the traveler's train journey trainDepartureCityRailCode: type: string description: Departure city rail code of the traveler's train journey trainDepartureDatetime: type: string description: 'Departure date-time of the traveler’s train journey in ISO 8601 format: YYYY-MM-DDTHH:MM:SS' trainDepartureLatitude: type: string description: Latitude of the train departure location trainDepartureLongitude: type: string description: Longitude of the train departure location trainDepartureStationName: type: string description: Departure station name of the traveler's train journey trainNumber: type: string description: The number associated with a train for a segment Hotel_Segment_Details: properties: hotelAddress: type: string description: Address of the hotel hotelCheckinDatetime: type: string description: Check in date-time in the local timezone of the hotel in ISO 8601 format:YYYY-MM-DDTHH:MM:SS hotelCheckoutDatetime: type: string description: 'Check out date-time in the local timezone of the hotel in ISO 8601 format: YYYY-MM-DDTHH:MM:SS' hotelLatitude: type: string description: Latitude of the hotel location hotelLongitude: type: string description: Longitude of the hotel location hotelName: type: string description: The name of the hotel hotelPhone: type: string description: Telephone number of the hotel Doc_Records_List: description: Contains the records in duty of care properties: airSegmentDetails: type: array items: $ref: '#/components/schemas/Air_Segment_Details' bookingReference: type: string description: Unique identifier of a booking bookingStatus: type: string description: 'Represents the status of the booking Example: Confirmed or Cancelled' carSegmentDetails: type: array items: $ref: '#/components/schemas/Car_Segment_Details' companyId: type: integer format: int32 description: Unique Identifier for the company gdsReference: type: string description: GDS Identifier of a booking hotelSegmentDetails: type: array items: $ref: '#/components/schemas/Hotel_Segment_Details' lineOfBusiness: type: string description: 'The line of business for which the booking is associated with. Example: Air, Car, Train, Hotel' recordLocator: type: string description: Unique identifier for a record trainSegmentDetails: type: array items: $ref: '#/components/schemas/Rail_Segment_Details' travelerDetails: type: array items: $ref: '#/components/schemas/Traveler_Details' tripId: type: string description: A trip_id is a unique identifier generated by the system Duty_of_Care_Request_Bean: description: DutyOfCareDataRequestBean Request properties: companyId: type: array description: Company ID is a Unique Identifier for the company items: type: integer format: int32 description: Company ID is a Unique Identifier for the company endDateTime: type: string description: 'The end date-time to fetch the booking data in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ' partnerId: type: integer format: int32 description: Unique identifier provided to partner by Egencia startDateTime: type: string description: 'The start date-time to fetch the booking data in ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ' Link: properties: deprecation: type: string href: type: string hreflang: type: string media: type: string name: type: string profile: type: string rel: type: string title: type: string type: type: string Custom_Data_Fields: description: Custom data fields properties: name: type: string description: Name of the Custom Data Fields as configured for the company value: type: string description: The values provided will be retrieved for the corresponding fields, if they are available Car_Segment_Details: properties: carDropoffDatetime: type: string description: 'Car drop-off date-time in ISO 8601 format: YYYY-MM-DDTHH:MM:SS' carDropoffIataCode: type: string description: IATA code of the Car drop off location carPickupDatetime: type: string description: 'Car pickup date-time in ISO 8601 format: YYYY-MM-DDTHH:MM:SS' carPickupIataCode: type: string description: IATA code of the Car pick up location carVendorCode: type: string description: Unique code of the car vendor carVendorName: type: string description: Name of the car vendor securitySchemes: OAuth2: flows: clientCredentials: tokenUrl: https://apis.egencia.com/auth/v1/token type: oauth2 x-refined-from: - amex-gbt-duty-of-care-api-openapi.json - amex-gbt-service-dutyofcare-openapi.json