{"openapi":"3.0.0","x-samples-languages":["curl","javascript","node","java","kotlin","python","php","go","swift"],"info":{"description":"The Karhoo Operations API is responsible for providing operations trips control","version":"v1.0","title":"Operations API 1.0","contact":{"email":"api@karhoo.com"},"x-hugo-values":{"tags":["api"],"categories":["users"],"public":true}},"paths":{"/fares/calculate":{"post":{"tags":["fares"],"summary":"Returns a calculated fare based on given parameters","operationId":"calculate_fare","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CalculateFareRequest"}}},"description":"request body","required":true},"responses":{"200":{"description":"Calculated Fare Response","content":{"*/*":{"schema":{"$ref":"#/components/schemas/CalculateFareResponse"}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}},"/trips/{uuid}/details":{"patch":{"tags":["trips"],"summary":"Provides an endpoint for overriding trip information","description":"Overrides trip information in case of DMS failures","operationId":"patch_trip","parameters":[{"name":"uuid","in":"path","description":"ID of the trip that needs to be updated.","required":true,"example":"b6a5f9dc-9066-4252-9013-be85dfa563bc","schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverrideTripRequest"}}},"description":"request body","required":true},"responses":{"204":{"description":"No Content"},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}},"/trips/{uuid}/resync":{"post":{"tags":["trips"],"summary":"Provides an API for triggering a new resync with the DMS","description":"Restarts trip polling from DMS","operationId":"trip_resync","parameters":[{"name":"uuid","in":"path","description":"Trip ID is required to trigger a new resync.","required":true,"example":"b6a5f9dc-9066-4252-9013-be85dfa563bc","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK"},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}},"/trips/{uuid}":{"get":{"tags":["trips"],"summary":"Provides an API to retrieve a trip by id","description":"Retrieves trip details with inner statuses and distance","operationId":"get_trip","parameters":[{"name":"uuid","in":"path","description":"Trip ID is required to trigger a new resync.","required":true,"example":"b6a5f9dc-9066-4252-9013-be85dfa563bc","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Trip details retrieved successfully","content":{"*/*":{"schema":{"$ref":"#/components/schemas/TripResponse"}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}},"/trips/{uuid}/history/states":{"get":{"tags":["trips"],"summary":"Get Trip State History","description":"Get the state history of a trip.\nPlease note that the `follow_code` fields are empty for security reasons.","parameters":[{"name":"uuid","in":"path","description":"Trip ID to get state history.","required":true,"example":"b6a5f9dc-9066-4252-9013-be85dfa563bc","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Trip state history retrieved successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TripStateHistoryResponse"}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}},"/trips/{uuid}/driverpath/estimated":{"get":{"tags":["trips"],"summary":"Get estimated driver path for a trip","description":"Get estimated driver path for a trip.","parameters":[{"name":"uuid","in":"path","description":"Trip ID to get driver path.","required":true,"example":"b6a5f9dc-9066-4252-9013-be85dfa563bc","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Driver path object","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimatedDriverPath"}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}},"/trips/reviews":{"post":{"tags":["trips"],"summary":"Add review for existing trip","description":"Add review for trip","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSubmittedRequest"}}},"description":"request body","required":true},"responses":{"200":{"description":"Review submitted response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewSubmittedResponse"}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}},"/quotes/{quote_list_id}/dms_raw_payloads":{"get":{"tags":["quotes"],"summary":"Get raw dms payloads","description":"Get raw dms payloads","parameters":[{"name":"quote_list_id","in":"path","description":"Quote list ID to get quotes.","required":true,"example":"b6a5f9dc-9066-4252-9013-be85dfa563bc","schema":{"type":"string","format":"uuid"}},{"in":"query","name":"availability_id","description":"availability id","required":true,"schema":{"type":"string"}},{"in":"query","name":"supply_product_id","description":"supply product id","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Get raw dms payloads","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotesDmsPayloads"}}}},"400":{"$ref":"#/components/responses/400InvalidInput"},"403":{"$ref":"#/components/responses/403Forbidden"},"404":{"$ref":"#/components/responses/404NotFound"},"500":{"$ref":"#/components/responses/500InternalServerErr"}},"security":[{"Bearer":[]}]}}},"servers":[{"url":"https://rest.sandbox.karhoo.com/v1/operations"}],"components":{"responses":{"400InvalidInput":{"description":"Bad Request. The request was invalid.","content":{"*/*":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","example":"K0002","description":"Error number"},"message":{"type":"string","example":"Invalid request payload","description":"Message of the error"},"details":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"},"description":"Details of the error","example":[{"message":"Summary of additional information","details":"Actual detail of the error"},{"message":"Summary of additional information","details":"Actual detail of the error"}]}}}}}},"403Forbidden":{"description":"Forbidden. The credentials provided do not have sufficient authority for this request. Please request access by emailing [API Support](api@karhoo.com?subject=API%20Access%20Request).","content":{"*/*":{"schema":{"type":"object","description":"Details of the error that occurred whilst processing the request","required":["code","message"],"properties":{"code":{"type":"string","description":"Internally generated code for this error"},"message":{"type":"string","example":"System-generated error message","description":"Message of the error"},"details":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"},"example":[{"message":"Summary of additional information","details":"Actual detail of the error"},{"message":"Summary of additional information","details":"Actual detail of the error"}]}}}}}},"404NotFound":{"description":"Not found. Trip not found, or following information is not available anymore.","content":{"*/*":{"schema":{"type":"object","description":"Details of the error that occurred whilst processing the request","required":["code","message"],"properties":{"code":{"type":"string","description":"Internally generated code for this error","example":"K4003"},"message":{"type":"string","description":"Details of the actual error","example":"Could could not find specified Trip"}}}}}},"500InternalServerErr":{"description":"Internal server error. Something has gone wrong on the website's server, but the server could not be more specific on what the exact problem is.","content":{"*/*":{"schema":{"type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Error number"},"message":{"type":"string","example":"System-generated error message","description":"Message of the error"},"details":{"type":"array","items":{"$ref":"#/components/schemas/ErrorDetails"},"description":"Details of the error","example":[{"message":"Summary of additional information","details":"Actual detail of the error"},{"message":"Summary of additional information","details":"Actual detail of the error"}]}}}}}}},"securitySchemes":{"Bearer":{"description":"For accessing the API a valid JWT token must be passed in all the queries in the 'Authorization' header.\nA valid JWT token is generated by the users/auth API.\nThe following syntax must be used in the 'Authorization' header :\nBearer: xxxxxx.yyyyyyy.zzzzzz","type":"apiKey","name":"Authorization","in":"header"}},"schemas":{"OverrideTripRequest":{"type":"object","properties":{"state":{"$ref":"#/components/schemas/State"},"external_trip_id":{"type":"string","description":"External identifier of the trip","example":"7b69152a-27e3-4534-b24f-217351293ead"},"partner_trip_id":{"type":"string","description":"Partner identifier of the trip","example":"9975d6f2-75e0-463a-85f8-d6b17d2b0143"},"cost_center":{"type":"string","description":"Cost center identifier","example":"b1R2Y010008MTKoUNS"},"passenger_pickup_time":{"description":"Passenger pickup time in RFC3339 format","type":"string","example":"2018-01-02T15:04:00Z","format":"date-time"},"passenger_drop_off_time":{"description":"Passenger drop off time in RFC3339 format","type":"string","example":"2018-01-02T15:34:00Z","format":"date-time"},"distance_meters":{"description":"Trip distance in meters","type":"integer","example":3217,"minimum":0},"version":{"description":"the current version of the trip","type":"integer","example":3}}},"Address":{"type":"object","description":"Specifies a geographic location","required":["display_address","place_id"],"properties":{"display_address":{"type":"string","description":"A description of the location of a person or organization, used by the driver as directions for pickup.","example":"2 Eastborne Terrace"},"position":{"$ref":"#/components/schemas/LatLong"},"place_id":{"type":"string","description":"Unique place ID which can be used with [/quotes](/v1/quotes/#request-quotes) API to retrieve further address details.","example":"EhpCcm93bmVsbCBTdCwgU2hlZmZpZWxkLCBVSw"},"poi_type":{"$ref":"#/components/schemas/POIType"},"timezone":{"type":"string","description":"Timezone of the address","example":"london/europe"}}},"Agent":{"type":"object","description":"Details of the agent associated with the trip","properties":{"user_id":{"type":"string","description":"User identifier"},"user_name":{"type":"string","description":"User name"},"organisation_id":{"type":"string","description":"Organisation identifier"},"organisation_name":{"type":"string","description":"Organisation name"}}},"TripResponse":{"type":"object","required":["id","status","origin","destination","quote"],"properties":{"id":{"type":"string","description":"The Karhoo generated Trip ID","example":"b6a5f9dc-9066-4252-9013-be85dfa563bc"},"passengers":{"$ref":"#/components/schemas/Passengers"},"status":{"$ref":"#/components/schemas/State"},"state_details":{"$ref":"#/components/schemas/StateDetails"},"origin":{"$ref":"#/components/schemas/Address"},"destination":{"$ref":"#/components/schemas/Address"},"distance_meters":{"type":"number","format":"int32","minimum":0,"description":"Distance between origin and destination in meters","example":3846},"date_scheduled":{"type":"string","description":"Date and time the trip is scheduled for, YYYY-MM-DDTHH:MM format.\n\nPlease note that this is UTC time. If you want the local time you will need to convert it to the timezone of the pickup point.\n","example":"2024-04-16T07:24:18.620Z"},"passenger_pickup_time":{"description":"Passenger pickup time in RFC3339 format","type":"string","example":"2018-01-02T15:04:00Z"},"passenger_drop_off_time":{"description":"Passenger drop off time in RFC3339 format","type":"string","example":"2018-01-02T15:34:00Z"},"quote":{"$ref":"#/components/schemas/Quote"},"fare":{"$ref":"#/components/schemas/Fare"},"fare_adjustment_state":{"$ref":"#/components/schemas/FareAdjustmentState"},"external_trip_id":{"type":"string","description":"External trip-id (from the fleet)."},"display_trip_id":{"type":"string","description":"Identifier to display to customer to be used in receipt or to communicate to Customer Support.","example":"A5TH-R27D"},"fleet_info":{"$ref":"#/components/schemas/FleetInfo"},"vehicle":{"$ref":"#/components/schemas/Vehicle"},"partner_trip_id":{"type":"string","description":"Trip ID provided by the demand partner","example":"9975d6f2-75e0-463a-85f8-d6b17d2b0143"},"comments":{"type":"string","description":"comment to the driver or fleet","example":"They are waiting by the green door at Fake Street 2a"},"flight_number":{"type":"string","description":"Flight number of passenger if provided","example":"BA1326"},"train_number":{"type":"string","description":"Train number","example":"1326-32"},"date_booked":{"type":"string","description":"Date and time the trip was made, in YYYY-MM-DDTHH:MM format.\nPlease note that this is UTC time. If you want the local time you will need to convert it to the timezone of the pickup point.\n"},"meeting_point":{"$ref":"#/components/schemas/MeetingPoint"},"agent":{"$ref":"#/components/schemas/Agent"},"cost_center_reference":{"type":"string","description":"Optional cost center reference to be used by the booker","example":"EMEA-sales"},"cancelled_by":{"$ref":"#/components/schemas/User"},"follow_code":{"type":"string","description":"The code that can be used to follow the trip"},"meta":{"$ref":"#/components/schemas/TripMeta"},"train_time":{"type":"string","description":"Train time","example":"2024-04-16T07:24:18.620Z"}}},"TripMeta":{"type":"object","description":"Any key value pairs to be associated with a trip","additionalProperties":{"type":"string"}},"Driver":{"type":"object","description":"Details of the vehicle's driver","required":["first_name","last_name","phone_number"],"properties":{"first_name":{"type":"string","description":"Driver's first name","example":"Michael"},"last_name":{"type":"string","description":"Driver's last name","example":"Higgins"},"phone_number":{"type":"string","description":"Driver's contact phone number","example":"+441111111111"},"photo_url":{"type":"string","description":"URL to retrieve driver's photo","example":"https://karhoo.com/drivers/mydriver.png"},"license_number":{"type":"string","description":"Driver's licence number","example":"ZXZ151YTY"}}},"EstimatedDriverPath":{"type":"object","properties":{"polyline":{"type":"string","description":"Google map polyline formatted","example":"kklyHrg\\\\NtE\\\\tGZnFPjDXvH^pHHtAJf@PZDFNFHIVQl@?JDDHHZHnAJXd@rI?b@Mb@GJcAfAGTQXIVGX@n@LrBHfAVtE^bHb@fKBVqARW@GCmDp@?@?@?DCDE@EEAG}Cd@WDAREZI\\\\]t@YTSHYDe@IMAIBKRqArB{@rATf@hA~BLHP^_@r@q@bA{A`Cy@pA|AfDbE`JN\\\\"},"distance":{"type":"number","format":"int32","description":"The calculated distance of the driver path in meters","example":5243}}},"FleetInfo":{"type":"object","properties":{"fleet_id":{"type":"string","description":"The ID of the fleet"},"name":{"type":"string","description":"The name of the fleet"},"logo_url":{"type":"string","description":"URL to get the fleet logo from"},"description":{"type":"string","description":"Description of the fleet"},"phone_number":{"type":"string","description":"The fleet's phone-number"},"terms_conditions_url":{"type":"string","description":"URL to get the fleet terms-and-conditions from"},"email":{"type":"string","example":"dispatch-co@karhoo.com","description":"Fleets's email address"}}},"LatLong":{"type":"object","description":"Specifies a geographic location in terms of its Latitude and Longitude coordinates.","required":["latitude","longitude"],"properties":{"latitude":{"type":"number","format":"float","description":"The latitude in degrees. It must be in the range [-90.0, +90.0]","example":51.5086692},"longitude":{"format":"float","type":"number","description":"The longitude in degrees. It must be in the range [-180.0, +180.0]","example":-0.1375291}}},"Luggage":{"type":"object","required":["total"],"properties":{"total":{"type":"number","format":"int32","description":"The total number of suitcases for a trip."}}},"MeetingPoint":{"type":"object","description":"Specifies a position to meet a taxi","properties":{"position":{"$ref":"#/components/schemas/LatLong"},"type":{"$ref":"#/components/schemas/MeetingPointType"},"instructions":{"description":"The meeting point instructions","type":"string"},"note":{"type":"string"}}},"MeetingPointType":{"type":"string","description":"If being picked up at an Airport, the pickup type:\n<ul>\n  <li>DEFAULT: Standard driver behavior for pickup or dropoff</li>\n  <li>PICK_UP: This is a special pick up point for this location</li>\n  <li>DROP_OFF: This is a special dropoff up point for this location</li>\n  <li>MEET_AND_GREET: Usually when the driver will meet the passenger with a greeting sign</li>\n  <li>CURB_SIDE: The driver will wait curbside at a designated pickup point</li>\n  <li>STAND_BY: The passenger must call when they are ready. Usually with their luggage when an airport</li>\n</ul>\n","enum":["NOT_SET","DEFAULT","PICK_UP","DROP_OFF","MEET_AND_GREET","CURB_SIDE","STAND_BY"]},"POIType":{"type":"string","description":"A \"Point of Interest\" (POI) is a location on the map where there are restrictions to where a driver can pick up a passenger. The type of Point of Interest:\n<ul>\n  <li>NOT_SET_POI_TYPE: Not specified</li>\n  <li>ENRICHED: Standard Karhoo POI Type that usually defines CURB_SIDE, MEET_AND_GREET or STAND_BY meeting points</li>\n  <li>REGULATED: POI usually defining restricted PICK_UP and DROP_OFF meeting points</li>\n  <li>NEAREST: POI usually defining recommended PICK_UP and DROP_OFF meeting points</li>\n</ul>\n","enum":["NOT_SET_POI_TYPE","ENRICHED","REGULATED","NEAREST"]},"PassengerInformation":{"type":"object","required":["last_name","phone_number"],"properties":{"first_name":{"type":"string","description":"Passenger's first name","example":"John"},"last_name":{"type":"string","description":"Passenger's last name","example":"Smith"},"email":{"type":"string","example":"john.smith@karhoo.com","description":"Passenger's email address"},"phone_number":{"type":"string","example":"+441234567890","description":"Passenger's contact phone number"},"locale":{"type":"string","example":"en_GB","description":"Passenger's preferred locale for communication"}}},"Passengers":{"type":"object","required":["passenger_details"],"properties":{"additional_passengers":{"type":"number","format":"int32","description":"Number of additional passengers, not including the first named passenger.","example":0},"passenger_details":{"description":"There should be details of at least one Passenger provided in this array","type":"array","items":{"$ref":"#/components/schemas/PassengerInformation"}},"luggage":{"$ref":"#/components/schemas/Luggage"}}},"Quote":{"type":"object","description":"Contains the breakdown of either the quoted fare for the trip.","required":["total","currency"],"properties":{"type":{"$ref":"#/components/schemas/QuoteType"},"total":{"type":"number","format":"int32","example":3550,"description":"The total amount in the base value of the currency, ie. penny, cents"},"currency":{"type":"string","description":"3-letter currency code defined in ISO 4217","example":"GBP"},"gratuity_percent":{"type":"number","format":"int32","example":15,"description":"Percentage of total quote that is the gratuity"},"breakdown":{"type":"array","items":{"$ref":"#/components/schemas/FareComponent"}},"vehicle_class":{"type":"string","description":"The requested vehicle category from the quote. This is historical in nature and will not change.\nRefer to the VEHICLE object for current vehicle class.\n","example":"Saloon"},"qta_high_minutes":{"type":"number","format":"int32","example":8,"description":"The highest estimated time of arrival at the time of trip."},"qta_low_minutes":{"type":"number","format":"int32","example":5,"description":"The lowest estimated time of arrival at the time of trip."},"vehicle_attributes":{"$ref":"#/components/schemas/VehicleAttributes"}}},"QuoteType":{"type":"string","description":"The status of the Trip Request:\n<ul>\n  <li>QUOTE_TYPE_NOT_SET - A null status. Never use this.</li>\n  <li>FIXED - The fare was quoted at a fixed price.</li>\n  <li>METERED - The fare was quoted as metered.</li>\n  <li>ESTIMATED - the fare quoted is an estimate and may change</li>\n</ul>\n","enum":["QUOTE_TYPE_NOT_SET","FIXED","METERED","ESTIMATED"],"example":"FIXED"},"User":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"id":{"type":"string"},"email":{"type":"string"}}},"Vehicle":{"type":"object","description":"Details of the vehicle that will service this trip","required":["vehicle_class","vehicle_license_plate","driver"],"properties":{"vehicle_class":{"type":"string","description":"Vehicle category","example":"MPV"},"description":{"type":"string","description":"Make, model and colour of vehicle","example":"Renault Scenic (Black)"},"vehicle_license_plate":{"type":"string","description":"Vehicle's licence plate value","example":"123 XYZ"},"driver":{"$ref":"#/components/schemas/Driver"},"attributes":{"$ref":"#/components/schemas/VehicleAttributes"}}},"VehicleAttributes":{"type":"object","description":"A list of attributes a vehicle can have","properties":{"passenger_capacity":{"type":"number","format":"int32","example":3},"luggage_capacity":{"type":"number","format":"int32","example":2},"hybrid":{"type":"boolean","example":false},"electric":{"type":"boolean","example":true},"child_seat":{"type":"boolean"}}},"FareAdjustmentState":{"type":"string","description":"The fare adjustment state. Possible values\n<ul>\n<li>NO_STATE: The fare adjustment state was not set.</li>\n<li>SET_BY_DMS: The fare adjustment state is set by DMS.</li>\n<li>SET_BY_KARHOO: The fare adjustment state is set by Karhoo.</li>\n<li>VERIFIED_BY_KARHOO: The fare adjustment state is verified by Karhoo.</li>\n<li>INVOICEABLE: The fare adjustment is invoiceable.</li>\n<li>ADJUSTMENT_PERIOD_EXPIRED: The adjustment period expired.</li>\n</ul>\n","enum":["NO_STATE","SET_BY_DMS","SET_BY_KARHOO","VERIFIED_BY_KARHOO","INVOICEABLE","ADJUSTMENT_PERIOD_EXPIRED"],"example":"SET_BY_KARHOO"},"State":{"type":"string","description":"The internal trip state. Possible values are:\n<ul>\n  <li>UNKNOWN: Unknown state.</li>\n  <li>INITIALISED: The trip is just initialised.</li>\n  <li>REQUESTED: The trip is matching to the most efficient available driver (By Dispatch).</li>\n  <li>CONFIRMED: The trip has been accepted by Dispatch.</li>\n  <li>ALLOCATED: Drive is allocated to the trip.</li>\n  <li>DRIVER_EN_ROUTE: A driver is \"en route\" to the start location. This state can occur multiple times in case of a driver re-assignment.</li>\n  <li>APPROACHING: A driver is \"en route\" to the start location. This state can occur multiple times in case of a driver re-assignment.</li>\n  <li>ARRIVED: The driver has arrived. This state might be skipped in some cases</li>\n  <li>PASSENGER_ON_BOARD: Passenger is in the vehicle and the ride has \"started\".</li>\n  <li>COMPLETED: Passenger has reached their destination.</li>\n  <li>CANCELLED_BY_USER: The trip has been cancelled by the rider</li>\n  <li>CANCELLED_BY_DISPATCH: The trip has been cancelled by the DMS</li>\n  <li>CANCELLED_BY_KARHOO: The trip has been cancelled by Karhoo</li>\n  <li>FAILED: There was an issue with the trip and Karhoo is investigating it.</li>\n  <li>INCOMPLETE: There was an issue with the trip and Karhoo is investigating it.</li>\n  <li>PREAUTH_DECLINED: There was an issue with payment preauth and Karhoo is investigating it.</li>\n</ul>\n","enum":["UNKNOWN","INITIALISED","REQUESTED","CONFIRMED","ALLOCATED","DRIVER_EN_ROUTE","APPROACHING","ARRIVED","PASSENGER_ON_BOARD","COMPLETED","CANCELLED_BY_USER","CANCELLED_BY_DISPATCH","CANCELLED_BY_KARHOO","FAILED","INCOMPLETE","PREAUTH_DECLINED"],"example":"REQUESTED"},"StateDetails":{"type":"string","description":"The state details of the Request:\n<ul>\n  <li>\n    <h4>Dispatch cancellation reasons</h4>\n    <ul>\n      <li>REQUESTED_BY_USER: Dispatch has cancelled the trip by user request.</li>\n      <li>PASSENGER_DIDNT_SHOW_UP: Dispatch has cancelled the trip because user didn't show up.</li>\n      <li>DRIVER_CANCELED: Driver has cancelled the trip.</li>\n      <li>SUPPLIER_CANCELLED: Supplier has cancelled the trip.</li>\n      <li>DISPATCH_CANCELLED: Dispatch has cancelled the trip.</li>\n      <li>NO_AVAILABILITY_IN_THE_AREA: Dispatch has cancelled the trip as no availability in the the area.</li>\n      <li>NO_FEE: Dispatch has cancelled the trip due to some fee issue.</li>\n      <li>OTHER_DISPATCH_REASON: Other dispatch cancellation reason.</li>\n    </ul>\n  </li>\n  <li>\n    <h4>User cancellation reasons</h4>\n    <ul>\n      <li>DRIVER_DIDNT_SHOW_UP: User has cancelled the trip because driver didn't show up.</li>\n      <li>ETA_TOO_LONG: User has cancelled the trip because estimated time of arival too long.</li>\n      <li>DRIVER_IS_LATE: User has cancelled the trip because driver is late.</li>\n      <li>CAN_NOT_FIND_VEHICLE: User has cancelled the trip because user can not find vehicle.</li>\n      <li>NOT_NEEDED_ANYMORE: User has cancelled the trip as not needed anymore.</li>\n      <li>ASKED_BY_DRIVER_TO_CANCEL: User has cancelled the trip because driver has asked user to cancel the trip.</li>\n      <li>FOUND_BETTER_PRICE: User has cancelled the trip because found better price.</li>\n      <li>NOT_CLEAR_MEETING_INSTRUCTIONS: User has cancelled the trip due to not clear meeting instructions.</li>\n      <li>COULD_NOT_CONTACT_CARRIER: User has cancelled the trip because could not contact carrier.</li>\n      <li>OTHER_USER_REASON: User has cancelled the trip.</li>\n    </ul>\n  </li>\n  <li>\n    <h4>Karhoo cancellation reasons</h4>\n    <ul>\n      <li>FRAUD: Karhoo has cancelled the trip as suspicious.</li>\n      <li>NO_AVAILABILITY: Karhoo has cancelled the trip because no availability found.</li>\n      <li>ASKED_BY_USER: Karhoo has cancelled the trip because user asked to cancel the trip.</li>\n      <li>ASKED_BY_DISPATCH: Karhoo has cancelled the trip because dispatch asked to cancel the trip.</li>\n      <li>ASKED_BY_DRIVER: Karhoo has cancelled the trip because driver asked to cancel the trip.</li>\n      <li>FAILIURE: Karhoo has cancelled the trip becuase booking is failed.</li>\n      <li>PREAUTH_FAILED: Karhoo has cancelled the trip. There was an issue with payment preauth and Karhoo is investigating it.</li>\n      <li>OTHER_KARHOO_REASON: Karhoo has cancelled the trip due to unknown reason.</li>\n    </ul>\n  </li>\n</ul>\n","example":"REQUESTED_BY_USER"},"ErrorDetails":{"type":"object","description":"Additional information about the error (such as which field failed validation)","properties":{"message":{"type":"string","description":"Summary of additional information"},"detail":{"type":"string","description":"Actual detail of the error"}}},"Fare":{"type":"object","description":"Contains the breakdown of the actual fare for the trip.","required":["total","currency"],"properties":{"total":{"type":"number","format":"int32","example":3550,"description":"The total amount in the base value of the currency, ie. penny, cents"},"currency":{"type":"string","description":"3-letter currency code defined in ISO 4217","example":"GBP"},"gratuity_percent":{"type":"number","format":"int32","example":15,"description":"Percentage of total fare that is the gratuity"},"breakdown":{"type":"array","items":{"$ref":"#/components/schemas/FareComponent"}}}},"FareComponent":{"type":"object","description":"Details of a particular component of the fare","required":["value","name"],"properties":{"value":{"type":"number","format":"int32","description":"Fare component amount in the base value of the currency, ie. penny, cents","example":1030},"name":{"type":"string","description":"Name of the fare component","example":"Basic amount"},"description":{"type":"string","description":"Description of the component","example":"Basic amount before any taxes or extras"}}},"CalculationFare":{"type":"object","required":["total","type"],"properties":{"type":{"$ref":"#/components/schemas/CalculationFareType"},"total":{"type":"number","format":"float"},"breakdown":{"type":"array","items":{"$ref":"#/components/schemas/CalculationFareComponent"}}}},"CalculationFareComponent":{"type":"object","description":"Details of a particular component of the fare","required":["value","name"],"properties":{"value":{"type":"number","format":"float"},"name":{"type":"string","description":"Name of the fare component","example":"Basic amount"}}},"CalculateFareRequest":{"type":"object","required":["organisation_id","fleet_id","fare"],"properties":{"organisation_id":{"type":"string","format":"uuid","example":"9975d6f2-75e0-463a-85f8-d6b17d2b0143"},"fleet_id":{"type":"string","format":"uuid","example":"9975d6f2-75e0-463a-85f8-d6b17d2b0143"},"country_code":{"type":"string"},"fare":{"$ref":"#/components/schemas/CalculationFare"}}},"CalculateFareResponse":{"type":"object","properties":{"fare":{"$ref":"#/components/schemas/CalculationFare"}}},"CalculationFareType":{"type":"string","description":"The status of the Trip Request:\n<ul>\n  <li>FARE_TYPE_NOT_SET - A null status. Never use this.</li>\n  <li>FARE_TYPE_FIXED - The fare was quoted at a fixed price.</li>\n  <li>FARE_TYPE_METERED - The fare was quoted as metered.</li>\n  <li>FARE_TYPE_ESTIMATED - the fare quoted is an estimate and may change</li>\n</ul>\n","enum":["FARE_TYPE_NOT_SET","FARE_TYPE_FIXED","FARE_TYPE_METERED","FARE_TYPE_ESTIMATED"],"example":"FIXED"},"TripStateHistoryResponse":{"description":"The entire history of a booking, made up of history entries","type":"object","required":["history_items"],"properties":{"history_items":{"description":"A list of booking history entries","type":"array","items":{"$ref":"#/components/schemas/TripStateHistoryEntry"}}}},"TripStateHistoryEntry":{"description":"One entry in the history of a booking","type":"object","required":["state","timestamp"],"properties":{"origin_timezone":{"type":"string","description":"Timezone of the address","example":"london/europe"},"state":{"$ref":"#/components/schemas/State"},"state_details":{"$ref":"#/components/schemas/StateDetails"},"timestamp":{"type":"string","format":"date-time"},"user_cancellation_explanation":{"type":"string","description":"Used when trip is cancelled by user with other reason"}}},"ReviewSubmittedRequest":{"type":"object","required":["trip_id","driver_rating"],"properties":{"trip_id":{"type":"string","example":"9975d6f2-75e0-463a-85f8-d6b17d2b0143"},"driver_rating":{"type":"number","example":5},"vehicle_rating":{"type":"number","example":5},"comment":{"type":"string"}}},"ReviewSubmittedResponse":{"type":"object","properties":{"status":{"type":"string","example":"OK"}}},"QuotesDmsPayloads":{"type":"object","description":"Contains dms raw request and response payloads","properties":{"dms_raw_request_payload":{"type":"object","description":"Dms raw request"},"dms_raw_response_payload":{"type":"object","description":"Dms raw response"}}}}},"x-readme":{"explorer-enabled":true,"proxy-enabled":true}}