Skip to main content

How to delete a partner appointment with trip

This document explains how to delete a partner appointment and its linked pickup/dropoff trips using the Partner v2 delete endpoint.

Use this API when you want to delete:

  • the appointment
  • the mapped pickup trip
  • any linked dropoff trip(s), if present

To delete a partner appointment with trip, you first need your credentials. If you don't already have one, head over to the Authentication and Authorization page to see how you can request credentials from us.

Request

HTTP request

DELETE  https://api.mykaarma.com/appointment/v2/departments/{dealerDepartmentUUID}/partner-appointments-with-trip/{appointmentUuid}
?updatedByDAUUID={updatedByDAUUID}
&source={source}

Parameters

Path parameters

Parameter NameValueDescriptionRequired
dealerDepartmentUUIDStringUnique identifier of the dealer departmentYes
appointmentUuidStringUUID of the appointment to delete. This is the SAR UUID.Yes

Query parameters

Parameter NameValueDescriptionRequired
updatedByDAUUIDStringUUID of the dealer associate performing the delete. Required unless source=WEB and the API can derive a fallback actor from the appointment.Conditional
sourceStringPlatform source of the request. Supported values include WEB, DEALER_APP, PND_API, and EXTERNAL_CONTROLLER.No

Authorization

ScopeLevelDescription
appointment.createDepartmentAuthorises client to delete appointment and trip data for the provided dealer department

Behavior

  • The API resolves the dealer internally from dealerDepartmentUUID.
  • The API resolves the mapped pickup trip internally from appointmentUuid.
  • The caller does not send tripUuid or dropoffTripUUID.
  • If the pickup trip has linked dropoff trip(s), they are deleted automatically through the same delete flow.
  • If source=WEB and updatedByDAUUID is omitted, the API attempts to derive the delete actor from:
    • the appointment assigned user
    • otherwise the appointment creator user
  • If source is omitted, the request is treated as non-WEB, so updatedByDAUUID is required.
  • If source is present and not WEB, updatedByDAUUID is required.
  • The endpoint deletes the appointment, removes the SAR-trip mapping, and deletes the linked trip records through the pickup/dropoff service.

To inspect the current pickup/dropoff trips before delete, call get partner trips for an appointment.

Curl Examples

Delete with explicit actor

curl --location --request DELETE 'https://api.mykaarma.com/appointment/v2/departments/{{department_uuid}}/partner-appointments-with-trip/{{appointment_uuid}}?updatedByDAUUID={{dealer_associate_uuid}}&source=WEB' \
--header 'Authorization: Basic {{basic_auth_token}}'

Delete with WEB fallback actor

Use this only when the appointment already has an assigned user or creator user that can be used as the delete actor.

curl --location --request DELETE 'https://api.mykaarma.com/appointment/v2/departments/{{department_uuid}}/partner-appointments-with-trip/{{appointment_uuid}}?source=WEB' \
--header 'Authorization: Basic {{basic_auth_token}}'

Delete with non-WEB source

For non-WEB sources, updatedByDAUUID must be provided.

curl --location --request DELETE 'https://api.mykaarma.com/appointment/v2/departments/{{department_uuid}}/partner-appointments-with-trip/{{appointment_uuid}}?updatedByDAUUID={{dealer_associate_uuid}}&source=DEALER_APP' \
--header 'Authorization: Basic {{basic_auth_token}}'

Response

The response is a DeleteAppointmentWithTripResponse object:

Property NameValueDescription
pickupEventUUIDStringUUID of the deleted pickup trip event
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

Response Example

{
"pickupEventUUID": "{{pickup_trip_uuid}}",
"appointmentUuid": "{{appointment_uuid}}",
"statusCode": 200,
"errors": null,
"warnings": null
}

Possible Errors

The delete API can fail at the authentication layer, request validation layer, or downstream pickup/delivery and appointment-cancel layers.

Authentication and authorization errors

HTTP StatusError CodeWhen it happens
401UNAUTHORIZEDThe Basic Auth credentials are missing or invalid.
403FORBIDDENThe client does not have the required appointment.create scope at the department level for the requested department.

Request validation errors

These are the explicit validation errors enforced by the partner delete endpoint before the downstream delete flow runs.

HTTP StatusError CodeError DescriptionWhen it happens
400INVALID_DEPT_UUIDInvalid dealer department UUID is provided in the requestdealerDepartmentUUID is blank, invalid, or cannot be resolved to a dealer.
400INVALID_SAR_UUIDInvalid SAR UUID is provided in the requestappointmentUuid is blank.
400PARTNER_DELETE_REQUEST_FIELDS_MISSINGupdatedByDAUUID is required in the partner delete request unless source is WEB and a fallback actor can be derived from the appointmentupdatedByDAUUID is missing for a non-WEB request, or source=WEB but the API cannot derive a fallback actor from the appointment.
400PARTNER_DELETE_TRIP_NOT_LINKED_TO_APPOINTMENTPickup trip is not linked to the given appointment for the partner delete requestThe appointment does not have an active mapped pickup trip, so the API cannot start the delete flow.

Downstream delete and cancel errors

After validation passes, the endpoint deletes the pickup/dropoff trip chain and then cancels the appointment. If either downstream step fails, the response can include one or more entries in errors.

HTTP StatusError CodeWhen it happens
4xx or 5xxdownstream service error codeThe pickup/dropoff delete service rejects the request or fails while deleting the trip chain. The API returns the downstream statusCode and propagates the downstream error in errors.
200 or downstream trip-delete statusdownstream appointment update error codeThe trip delete succeeds, but the appointment cancel step returns an error. In that case, the response includes the appointment update error in errors.
500INTERNAL_ERROR or INTERNAL_SERVER_ERRORAn unexpected server-side failure occurs while processing the delete request.

Error response example

{
"pickupEventUUID": null,
"appointmentUuid": null,
"statusCode": 400,
"errors": [
{
"errorCode": "PARTNER_DELETE_TRIP_NOT_LINKED_TO_APPOINTMENT",
"errorDescription": "Pickup trip is not linked to the given appointment for the partner delete request"
}
],
"warnings": null
}