How to create a trip
This document is designed to help you understand how you can create a trip using the pickup delivery API. To create trips, 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 for credentials from us.
The endpoint mentioned below can help you with creating a trip -
- Parameters Used:
{{requesterUserUuid}}
- UUID of the user who is creating the trip{{dealerAssociateUuid}}
- UUID of the dealer associate who is creating the trip{{dealerDepartmentUuid}}
- UUID of the dealer department you want to create trip for{{dealerUuid}}
- UUID of the dealer you want to create trip for{{customerUuid}}
- UUID of the customer for which the trip is to be created{{appointmentTime}}
- Start time for the created trip. eg. "2023-01-06T12:00:03-0500"{{rideType}}
- Ride type of trip to be created. Possible values are "PICKUP_CUSTOMER", "PICKUP_VEHICLE", "DROPOFF_CUSTOMER", "DROPOFF_VEHICLE", "LOANER_SWAP", "MISCELLANEOUS", "RIDE_SHARE"{{tripStatus}}
- Status of the trip to be created. eg. "UNASSIGNED"{{originLocationLon}}
,{{originLocationLat}}
- Coordinates (in double) of the origin address for the trip{{destLocationLon}}
,{{destLocationLat}}
- Coordinates (in double) of the destination address for the trip{{originAddress}}
- Origin address string for the trip{{destinationAddress}}
- Destination address string for the trip{{basic_auth_token}}
- Authorization: Basic "generate using username password"
Scope: The service subscriber needs to have the following scope for the department in the request -
pickupdelivery.trip.create
Endpoint
curl --location --request PUT 'https://api.mykaarma.com/pickupdelivery/v3/event/create' \
--header 'Authorization: {{basic_auth_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"requesterUserUUID": "{{requesterUserUuid}}",
"dealerDepartmentUUIDList": [
"{{dealerDepartmentUuid}}"
],
"pickupDeliveryTripEvent": {
"optionalFields": {},
"sendMessageToCustomer": true,
"isDropCar": false,
"isValid": true,
"sharedRidePartner": null,
"assignedByDealerAssociateUUID": "{{dealerAssociateUuid}}",
"rideType": "{{rideType}}",
"loanerVehicleRequired": false,
"customerDlVerified": false,
"customerInsuranceVerified": false,
"loanerVehicleUuid": null,
"loanerModel": null,
"primaryDriverLastName": null,
"primaryDriverFirstName": null,
"primaryDriverUUID": null,
"tripStatus": {{tripStatus}},
"secondaryDriverLastName": null,
"secondaryDriverFirstName": null,
"secondaryDriverUUID": null,
"vehicleIdentifiers": null,
"originLocationLon": {{originLocationLon}},
"originLocationLat": {{originLocationLat}},
"originAddress": "{{originAddress}}",
"destLocationLon": {{destLocationLon}},
"destLocationLat": {{destLocationLat}},
"destinationAddress": "{{destinationAddress}}",
"appointmentTime": "{{appointmentTime}}",
"mustStartBy": null,
"dealerUUID": "{{dealerUuid}}",
"dealerDepartmentUUID": "{{dealerDepartmentUuid}}",
"subTrips": null,
"customerFirstName": null,
"customerLastName": null,
"customerUUID": "{{customerUuid}}"
"createdDate": null
}
}'
- Response
{
"statusCode": integer,
"error": {
"errorCode": "string",
"errorDescription": "string",
"metadata": "string"
},
"warnings": [
{
"warningCode": "string",
"warningDescription": "string"
}
],
"eventUUID": "string"
}
{eventUUID} - the UUID of the created trip