Skip to main content

How to get trips for an appointment

This document explains how to fetch pickup and delivery (PnD) trips linked to an appointment. This is useful when you want to view the trip details associated with a specific service appointment.

Request

HTTP request

PATCH  https://api.mykaarma.com/appointment/v2/dealer/{dealerUuid}/trips

Parameters

Path parameter:

Parameter NameValueDescriptionRequired
dealerUuidStringUnique identifier of dealerYes

Authorization

This request requires the following authorization scopes:

ScopeLevelDescription
appointment.trip.readDealerAuthorises client to read trip details for appointments at the provided dealer

Request Body

Property NameValueDescriptionRequired
sarUuidStringUUID of the service appointment request (appointment) for which to fetch linked trips. Validated as non-blank.Yes

Response

The response is a PickupDeliveryTripViewDtoResponse object:

Property NameValueDescription
totalCountIntegerTotal number of trips linked to the appointment
tripViewDtosList<Object>List of trip view details
statusCodeIntegerHTTP status code of the response
errorObjectError details, if any
warningsList<Object>List of warnings, if any

tripViewDtos

Each trip view object contains the following key fields:

Property NameValueDescription
eventUuidStringUnique identifier for the trip event
versionLongVersion number of the trip
appointmentTimeStringScheduled time for the trip
mustStartByStringLatest time by which the trip must start
rideTypeStringType of ride. Possible values: PICKUP_CUSTOMER, PICKUP_VEHICLE, DROPOFF_CUSTOMER, DROPOFF_VEHICLE, LOANER_SWAP, MISCELLANEOUS, RIDE_SHARE
tripStatusStringCurrent status of the trip
parentEventUuidStringUUID of the parent trip event, if this is a sub-trip
subTripsList<Object>List of sub-trips
internalRideTypeStringInternal classification of the ride type
customerObjectCustomer details including name and contact information
vehicleObjectVehicle details
dealerOrderObjectDealer order details
departmentObjectDepartment details
loanerObjectLoaner vehicle details, if applicable
serviceAdvisorObjectService advisor details
primaryDriverObjectPrimary driver details
secondaryDriverObjectSecondary driver details
assignedByObjectDetails of who assigned the trip
updatedByObjectDetails of who last updated the trip
isValidBooleanWhether the trip is valid
createdDateStringDate when the trip was created
linkedAppointmentUuidStringUUID of the linked appointment
linkedTripUuidsList<String>UUIDs of other linked trips
optionalFieldsMap<String, String>Additional optional key-value pairs

Curl Example

curl --location --request PATCH 'https://api.mykaarma.com/appointment/v2/dealer/{{dealer_uuid}}/trips' \
--header 'Authorization: Basic {{basic_auth_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"sarUuid": "{{appointment_uuid}}"
}'

Response Example

{
"totalCount": 1,
"tripViewDtos": [
{
"eventUuid": "abc12345-def6-7890-ghij-klmnopqrstuv",
"appointmentTime": "2024-10-25T11:15:00",
"rideType": "PICKUP_CUSTOMER",
"tripStatus": "SCHEDULED",
"customer": {
"firstName": "John",
"lastName": "Doe"
},
"vehicle": {
"vin": "1HGBH41JXMN109186"
},
"serviceAdvisor": {
"uuid": "xyz98765-uvw4-3210-abcd-efghijklmnop",
"firstName": "Jane",
"lastName": "Smith"
},
"isValid": true,
"linkedAppointmentUuid": "appt12345-def6-7890-ghij-klmnopqrstuv"
}
],
"statusCode": 200,
"error": null,
"warnings": null
}