Skip to main content

How to update an appointment with trip

This document explains how to update an existing appointment along with its associated pickup and delivery (PnD) trip in a single API call. This is useful when you need to modify both the appointment details and the trip details simultaneously.

Request

HTTP request

POST  https://api.mykaarma.com/appointment/v2/dealer/{dealerUuid}/sar/{sarUUID}/appointment-trip

Parameters

Path parameter:

Parameter NameValueDescriptionRequired
dealerUuidStringUnique identifier of dealerYes
sarUUIDStringUnique identifier of the service appointment request (appointment) to updateYes

Query parameters:

Parameter NameValueDescriptionRequired
enforcePreferencesBooleanWhether to enforce preferences configured for each dealer in myKaarmaNo

Authorization

This request requires the following authorization scopes:

ScopeLevelDescription
appointment.createDealerAuthorises client to create/update appointment for the provided dealer

Request Body

The request body is an UpdateAppointmentWithTripRequest object containing two main parts:

Property NameValueDescriptionRequired
updatePickupDeliveryTripEventRequestObjectDetails of the updated pickup and delivery trip eventYes
updateAppointmentForTripRequestObjectDetails of the appointment update, including trip metadataYes

Update Scenarios

The API supports three distinct scenarios based on the combination of pickupDeliveryTripEvent (in updatePickupDeliveryTripEventRequest) and tripUUID (in updateAppointmentForTripRequest.pickupDeliveryTripMetadata):

ScenariopickupDeliveryTripEventtripUUIDBehavior
Update existing tripProvided (not null)Provided (not null)Updates both the trip and the appointment
Create new tripProvided (not null)null or absentCreates a new trip and links it to the appointment. Fails if a trip already exists.
Delete existing tripnullProvided (not null)Deletes the existing trip and updates the appointment

Important: Both pickupDeliveryTripEvent and tripUUID cannot be null at the same time — this will cause an error.

updatePickupDeliveryTripEventRequest

Property NameValueDescriptionRequired
pickupDeliveryTripEventObjectThe updated pickup and delivery trip event details. Set to null to trigger the delete trip scenario.Conditional
requesterUserUUIDStringUUID of the user making the request. Passed as the user token to the PnD service for validation.Yes
dealerDepartmentUUIDListList<String>List of dealer department UUIDs associated with this tripYes
sourceStringSource of the request. Possible values: DEALER_APP, WEB, PND_API, EXTERNAL_CONTROLLERNo

pickupDeliveryTripEvent (for update/create scenarios)

When updating or creating a trip, include the trip event details. For the update scenario, the eventUUID field is required. For the create scenario, the fields follow the same requirements as the create appointment with trip page.

Note: For the update scenario, the PnD service validates that the trip exists in the database and that isValid is true.

Property NameValueDescriptionRequired
eventUUIDStringUUID of the existing trip event. Required for the update scenario. Not needed for create.Conditional
appointmentTimeStringThe scheduled time for the trip. Format: yyyy-MM-dd'T'HH:mm:ssZ (ISO 8601 with timezone offset, e.g., 2024-10-25T11:15:00-0700).Yes
rideTypeStringType of ride. Must be one of: PICKUP_CUSTOMER, PICKUP_VEHICLE, DROPOFF_CUSTOMER, DROPOFF_VEHICLE, LOANER_SWAP, MISCELLANEOUS, RIDE_SHARE.Yes
customerUUIDStringUUID of the customer. Required for all ride types except MISCELLANEOUS.Conditional
dealerUUIDStringUUID of the dealerYes
dealerDepartmentUUIDStringUUID of the dealer departmentYes
assignedByDealerAssociateUUIDStringUUID of the dealer associate who assigned the trip. Required unless source is WEB.Conditional
customerFirstNameStringFirst name of the customer. Auto-populated from customer data if not provided.No
customerLastNameStringLast name of the customer. Auto-populated from customer data if not provided.No
vehicleIdentifiersObjectIdentifiers for the customer's vehicleNo
roNumberStringRepair order number associated with the tripNo
dealerOrderUUIDStringUUID of the dealer orderNo
originAddressStringPickup address for the tripNo
originLocationLatDoubleLatitude of the pickup locationNo
originLocationLonDoubleLongitude of the pickup locationNo
destinationAddressStringDelivery address for the tripNo
destLocationLatDoubleLatitude of the delivery locationNo
destLocationLonDoubleLongitude of the delivery locationNo
loanerVehicleRequiredBooleanWhether a loaner vehicle is required. Cannot be true simultaneously with isDropCar.No
isDropCarBooleanWhether this is a drop car trip. Cannot be true simultaneously with loanerVehicleRequired.No (defaults to false)
loanerVehicleUuidStringUUID of the loaner vehicle. For LOANER_SWAP, cannot be the same as swappedLoanerVehicleUuid.No
swappedLoanerVehicleUuidStringUUID of the swapped loaner vehicle (for LOANER_SWAP ride type only)No
loanerDescriptionStringDescription of the loaner vehicleNo
serviceAdvisorUUIDStringUUID of the service advisorNo
serviceAdvisorNameStringName of the service advisorNo
primaryDriverUUIDStringUUID of the primary driver. For PICKUP_VEHICLE/DROPOFF_VEHICLE, cannot be blank if secondaryDriverUUID is present.Conditional
secondaryDriverUUIDStringUUID of the secondary driver. Cannot be the same as primaryDriverUUID.No
tripStatusStringStatus of the trip. If set to DRAFT or AUTO_DRAFT, customer messaging is suppressed.No
linkedAppointmentUuidStringUUID of a linked appointmentNo
linkedTripUuidsList<String>UUIDs of linked trips. Each must correspond to a valid existing trip.No
subTripsList<Object>List of sub-trips associated with this trip eventNo
optionalFieldsMap<String, String>Additional optional key-value pairsNo

updateAppointmentForTripRequest

Property NameValueDescriptionRequired
appointmentInformationObjectUpdated appointment detailsYes
customerAppointmentPreferenceObjectUpdated communication preferences for the customerNo
serviceListList<Object>Updated list of services/opcodes for the appointmentNo
vehicleInformationObjectUpdated vehicle detailsNo
updatedByUserDetailsObjectDetails of the user making the updateNo
pickupDeliveryTripMetadataObjectMeta data of the pickup and delivery trip containing trip and transport option informationYes

appointmentInformation

Important: The update endpoint uses separate date and time fields, which is different from the create endpoint's combined appointmentStartDateTime format. The system concatenates appointmentDate + "T" + appointmentStartTime internally to produce the yyyy-MM-dd'T'HH:mm:ss format.

Property NameValueDescriptionRequired
appointmentDateStringUpdated appointment date. Format: yyyy-MM-dd (e.g., 2024-10-26).Yes
appointmentStartTimeStringUpdated appointment start time. Format: HH:mm:ss (e.g., 10:00:00).Yes
appointmentEndTimeStringUpdated appointment end time. Format: HH:mm:ss (e.g., 10:29:59). If not provided, auto-computed from dealer configuration.No
userUuidStringUUID of the assigned user/advisorNo
commentsStringUpdated comments for the appointmentNo
internalNotesStringUpdated internal notes for dealership personnel onlyNo
altTransportationStringUpdated alternate transportation optionNo
sourceStringSource of the updateNo

updatedByUserDetails

Property NameValueDescriptionRequired
uuidStringUnique token assigned to the user making the updateNo
deptUUIDStringUnique token assigned to the department of the userNo
teamUuidStringUnique token assigned to the team the user belongs toNo

customerAppointmentPreference

Property NameValueDescriptionRequired
emailConfirmationBooleanWhether to send an email for appointment confirmationNo
textConfirmationBooleanWhether to send a text for appointment confirmationNo
emailReminderBooleanWhether to send a reminder email for the appointmentNo
textReminderBooleanWhether to send a reminder text for the appointmentNo
notifyCustomerBooleanWhether to send appointment notifications to the customerNo
sendCommunicationToDABooleanWhether to send appointment communications to the dealer associateNo
confirmationEmailStringEmail ID where appointment confirmation email should be sentNo
confirmationPhoneNumberStringPhone number where appointment confirmation text should be sentNo

pickupDeliveryTripMetadata

Property NameValueDescriptionRequired
tripUUIDStringUnique token assigned to a pickup and delivery trip in myKaarma. Set to null to trigger the create trip scenario; provide an existing UUID for update or delete trip scenarios.Conditional
subTransportOptionRequestObjectDetails of the sub transport optionNo

For details on serviceList, vehicleInformation, and subTransportOptionRequest, please refer to the create appointment with trip page and the create appointment page.

Response

The response is a SaveAppointmentWithTripResponse object (same as create):

Property NameValueDescription
eventUUIDStringUUID of the updated pickup and delivery trip event
appointmentUUIDStringUUID of the updated appointment
statusCodeIntegerHTTP status code of the response
errorsList<Object>List of errors, if any
warningsList<Object>List of warnings, if any

Minimal Curl (update scenario, required fields only)

curl --location --request POST 'https://api.mykaarma.com/appointment/v2/dealer/{{dealer_uuid}}/sar/{{sar_uuid}}/appointment-trip' \
--header 'Authorization: Basic {{basic_auth_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"updatePickupDeliveryTripEventRequest": {
"pickupDeliveryTripEvent": {
"eventUUID": "{{event_uuid}}",
"appointmentTime": "2024-10-26T10:00:00-0700",
"rideType": "PICKUP_CUSTOMER",
"dealerUUID": "{{dealer_uuid}}",
"dealerDepartmentUUID": "{{department_uuid}}",
"customerUUID": "{{customer_uuid}}"
},
"requesterUserUUID": "{{requester_uuid}}",
"dealerDepartmentUUIDList": ["{{department_uuid}}"],
"source": "WEB"
},
"updateAppointmentForTripRequest": {
"appointmentInformation": {
"appointmentDate": "2024-10-26",
"appointmentStartTime": "10:00:00"
},
"pickupDeliveryTripMetadata": {
"tripUUID": "{{trip_uuid}}"
}
}
}'

Complete Curl

curl --location --request POST 'https://api.mykaarma.com/appointment/v2/dealer/{{dealer_uuid}}/sar/{{sar_uuid}}/appointment-trip' \
--header 'Authorization: Basic {{basic_auth_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"updatePickupDeliveryTripEventRequest": {
"pickupDeliveryTripEvent": {
"eventUUID": "{{event_uuid}}",
"appointmentTime": "2024-10-26T10:00:00-0700",
"rideType": "PICKUP_CUSTOMER",
"dealerUUID": "{{dealer_uuid}}",
"dealerDepartmentUUID": "{{department_uuid}}",
"customerUUID": "{{customer_uuid}}",
"assignedByDealerAssociateUUID": "{{da_uuid}}",
"originAddress": "789 New Address, City, State 12345",
"originLocationLat": 34.0522,
"originLocationLon": -118.2437,
"destinationAddress": "456 Dealer Avenue, City, State 12345",
"destLocationLat": 34.0622,
"destLocationLon": -118.2537,
"serviceAdvisorUUID": "{{advisor_uuid}}"
},
"requesterUserUUID": "{{requester_uuid}}",
"dealerDepartmentUUIDList": ["{{department_uuid}}"],
"source": "WEB"
},
"updateAppointmentForTripRequest": {
"appointmentInformation": {
"appointmentDate": "2024-10-26",
"appointmentStartTime": "10:00:00",
"appointmentEndTime": "10:29:59",
"userUuid": "{{advisor_uuid}}",
"comments": "",
"internalNotes": ""
},
"vehicleInformation": {
"vehicleUuid": "{{vehicle_uuid}}"
},
"customerAppointmentPreference": {
"emailConfirmation": false,
"textConfirmation": false,
"emailReminder": false,
"textReminder": false,
"notifyCustomer": true,
"sendCommunicationToDA": true
},
"serviceList": [
{
"title": "{{labor_opcode}}",
"operationUuid": "{{operation_uuid}}",
"operationType": "OPCODE",
"isCustomConcern": false
}
],
"updatedByUserDetails": {
"uuid": "{{updater_uuid}}",
"deptUUID": "{{department_uuid}}"
},
"pickupDeliveryTripMetadata": {
"tripUUID": "{{trip_uuid}}",
"subTransportOptionRequest": {
"transportOptionUuid": "{{transport_option_uuid}}"
}
}
}
}'

Response Example

{
"eventUUID": "abc12345-def6-7890-ghij-klmnopqrstuv",
"appointmentUUID": "xyz98765-uvw4-3210-abcd-efghijklmnop",
"statusCode": 200,
"errors": null,
"warnings": null
}