Vehicle API

The Vehicle API allows you to integrate with Autopay to check if the vehicle has a valid permit for ongoing parking session in a parking zone.

By accessing or using the API, the integrator agrees to be bound by the terms and conditions of Vehicle API.

Available resources

Access requirements

  • A valid authentication token is required to access the API. How to authenticate your application
  • Access to the Vehicle API is offered as a paid service. Please contact your Autopay representative for details.

GET - Check the permit and session data for a vehicle

This method allows you to check the following: does a valid permit exist for the current vehicle, is there a running parking session tied to this permit and does the current vehicle have an in progress parking session.

Endpoint

GET https://api.autopay.io/vehicle/v1/permit

Request parameters

  • The request body must be in JSON format and HTTP headers must include Content-Type: application/json.
  • The HTTP headers must include a valid access token.
  • The path must include vehicle registration number and zone id parameters (vehicle/v1/permit?vehicle={ABC123}&zone_id={12}). Please see the path parameters table below for more information.

Path parameter Type Mandatory Description
vehicle string yes Vehicle registration number (license plate)
zone_id integer yes ID of the parking zone

Request example

GET https://api.autopay.io/vehicle/v1/permit?vehicle=123TTC&zone_id=10

Request path example with multiple zones (zone id 100 and 123)

GET https://api.autopay.io/vehicle/v1/permit?vehicle=123ABC&zone_id=100&zone_id=123

Success response

HTTP Code: 200 OK

Parameter Type Description
has_valid_permit_in_zone boolean Has a permit
in_progress_parking_session boolean Has an in progress session
in_progress_parking_start_time string|null Start time of the in progress parking
in_progress_parking_session_start_time string|null Start time of the in progress parking session
permit_used_for_in_progress_parking_session boolean Permit was used for the in progress session
is_in_profile boolean Vehicle is in a profile
is_in_profile_with_valid_payment_card boolean Vehicle is in a profile with a valid payment card

Example success response

{
    "has_valid_permit_in_zone": false,
    "in_progress_parking_session": true,
    "in_progress_parking_start_time": "2020-03-27T09:40:29+0000",
    "in_progress_parking_session_start_time": "2020-03-27T13:12:17+0000",
    "permit_used_for_in_progress_parking_session": false,
    "is_in_profile": true,
    "is_in_profile_with_valid_payment_card": true
}

Error messages

Parameter Type Description
error_id string Specific code of error. See below for possible values
message string Description of error
description string Optional value. Additional description of error.

Example error response:

{
    "error_id": "authentication_error",
    "message": "No access token present in header!"
}

Possible error id-s:

Error id Explanation
forbidden Unauthorized
internal_server_error Internal server error
missing_property A required property in request is missing
message_not_readable A problem with the request body
method_not_supported Used REST method not supported
argument_type_mismatch A request argument is of incorrect type
get_vehicle_overview_error Error fetching permit info for specified licence plate
operator_not_found_error Operator not found
missing_operator_token_error Operator not found