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 Name | Value | Description | Required |
|---|---|---|---|
dealerUuid | String | Unique identifier of dealer | Yes |
Authorization
This request requires the following authorization scopes:
| Scope | Level | Description |
|---|---|---|
appointment.create | Dealer | Authorises client to create/delete appointment for the provided dealer |
Request Body
| Property Name | Value | Description | Required |
|---|---|---|---|
tripUuid | String | UUID of the pickup and delivery trip to delete. Validated as non-blank by the PnD service. | Yes |
appointmentUuid | String | UUID of the appointment to delete | Yes |
dealerDepartmentUUIDList | List<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 |
updatedByDAUUID | String | UUID of the dealer associate performing the deletion | Yes |
updatedByDeptUUID | String | UUID of the department of the dealer associate performing the deletion. Used as a path variable in the appointment cancellation callback. | Yes |
requesterUuid | String | UUID of the user requesting the deletion. Required unless source is WEB. | Conditional |
dealerUuid | String | UUID of the dealer. Used for logging purposes only. | No |
source | String | Source 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 Name | Value | Description |
|---|---|---|
tripUuid | String | UUID of the deleted pickup and delivery trip |
appointmentUuid | String | UUID of the deleted appointment |
statusCode | Integer | HTTP status code of the response |
errors | List<Object> | List of errors, if any |
warnings | List<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
}