Skip to main content

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:

  1. A valid JWT: see Generating and Signing a Valid JWT Guide.
  2. A Trip ID: see How to Get a Trip ID.
  3. 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.
  4. 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 to true 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 to true in the regions where a parking photo is required
    • parkingPhotoSkipReason: 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:

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'