Ending a Trip
Learn how to end a trip remotely on behalf of a user.
Requirements
For the request to be successful the following is required:
- A valid JWT: see Generating and Signing a Valid JWT Guide.
- A Trip ID: see How to Get a Trip ID.
- The vehicle must be placed in an authorized parking zone. Guide the user to the nearest allowed parking spot to help them avoid a parking fine.
- A photo of the parked vehicle is required in certain regions. If the user cant't upload a photo a valid reason why it cannot be done must be provided.
To end a trip make a call to the EndTrip API endpoint with the following body parameters:
acceptOutOfBoundsRelocationFee
: must be set totrue
if the vehicle has been parked in a restricted area and the user accepts the imposed fine- one of the following:
promiseParkingPhoto
: must be set totrue
in the regions where a parking photo is requiredparkingPhotoSkipReason
: reason why a photo of a parked vehicle cannot be uploaded.
info
promiseParkingPhoto
must not be set to false
in the regions where a
parking photo is required. Provide parkingPhotoSkipReason
instead.
Code Sample
Test it:
- Staging
- Production
curl --location --request POST \
--header 'Content-Type: application/json' \
--header 'User-Agent: {COMPANY_NAME}' \
--header 'Authorization: Bearer {JWT}' \
-d '{"acceptOutOfBoundsRelocationFee": "false", "parkingPhotoSkipReason": "PARKING_PHOTO_SKIP_REASON_PHONE_BATTERY_LOW"}' \
'https://web.maas.api.staging.ridedott.com/v1alpha2/trips/{tripId}:end'
curl --location --request POST \
--header 'Content-Type: application/json' \
--header 'User-Agent: {COMPANY_NAME}' \
--header 'Authorization: Bearer {JWT}' \
-d '{"acceptOutOfBoundsRelocationFee": "false", "parkingPhotoSkipReason": "PARKING_PHOTO_SKIP_REASON_PHONE_BATTERY_LOW"}' \
'https://web.maas.api.ridedott.com/v1alpha2/trips/{tripId}:end'