Skip to main content

How to delete an appointment with trip

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

Request

HTTP request

DELETE  https://api.mykaarma.com/appointment/v2/dealer/{dealerUuid}/appointment-trip

Parameters

Path parameter:

Parameter NameValueDescriptionRequired
dealerUuidStringUnique identifier of dealerYes

Authorization

This request requires the following authorization scopes:

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

Request Body

Property NameValueDescriptionRequired
tripUuidStringUUID of the pickup and delivery trip to delete. Validated as non-blank by the PnD service.Yes
appointmentUuidStringUUID of the appointment to deleteYes
dealerDepartmentUUIDListList<String>List of dealer department UUIDs. Must contain at least one entry — the first element is used internally for department-to-dealer mapping and SAR-trip mapping removal.Yes
updatedByDAUUIDStringUUID of the dealer associate performing the deletionYes
updatedByDeptUUIDStringUUID of the department of the dealer associate performing the deletion. Used as a path variable in the appointment cancellation callback.Yes
requesterUuidStringUUID of the user requesting the deletion. Required unless source is WEB.Conditional
dealerUuidStringUUID of the dealer. Used for logging purposes only.No
sourceStringSource of the request. Possible values: DEALER_APP, WEB, PND_API, EXTERNAL_CONTROLLER. If WEB, token validation for requesterUuid is relaxed.No

Response

The response is a DeleteAppointmentWithTripResponse object:

Property NameValueDescription
tripUuidStringUUID of the deleted pickup and delivery trip
appointmentUuidStringUUID of the deleted appointment
statusCodeIntegerHTTP status code of the response
errorsList<Object>List of errors, if any
warningsList<Object>List of warnings, if any

Minimal Curl (required fields only)

curl --location --request DELETE 'https://api.mykaarma.com/appointment/v2/dealer/{{dealer_uuid}}/appointment-trip' \
--header 'Authorization: Basic {{basic_auth_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"tripUuid": "{{trip_uuid}}",
"appointmentUuid": "{{appointment_uuid}}",
"dealerDepartmentUUIDList": ["{{department_uuid}}"],
"updatedByDAUUID": "{{da_uuid}}",
"updatedByDeptUUID": "{{department_uuid}}",
"source": "WEB"
}'

Complete Curl

curl --location --request DELETE 'https://api.mykaarma.com/appointment/v2/dealer/{{dealer_uuid}}/appointment-trip' \
--header 'Authorization: Basic {{basic_auth_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"tripUuid": "{{trip_uuid}}",
"appointmentUuid": "{{appointment_uuid}}",
"requesterUuid": "{{requester_uuid}}",
"dealerUuid": "{{dealer_uuid}}",
"dealerDepartmentUUIDList": ["{{department_uuid}}"],
"updatedByDAUUID": "{{da_uuid}}",
"updatedByDeptUUID": "{{department_uuid}}",
"source": "WEB"
}'

Response Example

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