Parking API

The Parking API consists of two parts: the ability to be notified when vehicle enters a zone and the ability to change the product for the parking session.

Access to the Parking API is offered as a paid service. Please contact your Autopay representative for details.

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

Available resources:

Webhook POST

Service: makes a HTTP POST request to your webhook endpoint when vehicles enters a zone in your facility

Webhook endpoint requirements:

  1. Provide a webhook endpoint with HTTPS support
  2. Support HTTP header authorization (we will send you the secret you provide us in the "Authorization" header)

What we need to configure your webhook:

Webhook URL The URL to your webhook endpoint
Authorization token value What we will send you in the "Authorization" HTTP header
Facility code The code for the facility you want to receive events from
Zone code The code for the zone(s) you want to receive events from
Should all zones be included? If all zones in facility, including new ones, should be included
Landlord id The id for the landlord that the facility belongs to

Webhook POST JSON:

Parameter Type Description
event_id string A unique id for the entry event. Updates on the same event uses the same id. So if a license plate is updated, it will be present with the corrected license plate with the same 'event_id'.
parking_session_id String Id can be used to change the product for this parking session.
time_in_utc yyyy-MM-dd'T'HH:mm:ssZ Time of entry event in UTC.
operator_id String Id of the parking operator.
landlord
landlord_id string Id of the landlord of the parking facility where the parking takes place
name string Display name of the landlord
zone
code string Id of the parking zone where the parking takes place
name string Display name of zone
facility
code string Id of the parking facility where the parking takes place
name string Display name of the facility
time_zone string Time zone of the facility, in the format "Europe/Oslo"(https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
plate
plate_number string The vehicle registration number
country_alpha2_code string? The plate country code in Alpha 2 code (iban.com/country-codes)
subdivision string? Subdivision on the vehicle registration if it exists

Example request:

{
    "event_id":"event-id-1",
    "parking_session_id":"parking1",
    "time_in_utc":"2020-12-12T12:12:12+0000",
    "operator_id":"twopark_no",
    "landlord":{
        "landlord_id":"landlord-id",
        "name":"Landlord Name"
    },
    "zone":{
        "name":"Zone 1",
        "code":"zone1"
    },
    "facility":{
        "name":"Facility Name",
        "code":"facility1",
        "time_zone":"Europe/Oslo"
    },
    "plate":{
        "plate_number":"AB123",
        "country_alpha2_code":"NO",
        "subdivision":null
    }
}

Resource: PUT

Access requirements

  • A valid authentication token is required to access the API. How to authenticate your application.
  • You will need to provide the product IDs you will use for different product changes that can be done to your Autopay representative.

Service: change the product of a parking session

This method allows you to change the product of a parking session, so that you can e.g. allow some customers to park longer for free.

Endpoint

PUT https://api.autopay.io/parking/product/{parkingSessionId}

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 the parking session ID received in webhook.
Parameter Type Mandatory Description
facility_code string yes Id of the parking facility where the parking takes place.
zone_code string yes Id of the parking zone where the parking takes place.
product string yes The product ID of the new product the parking should receive.

Request example:

GET https://api.autopay.io/parking/product/parking1

Body:

{
    "facility_code":"facility1",
    "zone_code":"zone1",
    "product":"2092_two_hour_free_parking"
}

Success response

HTTP Code: 200 OK

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
message_not_readable A problem with the request body
method_not_supported Used REST method not supported
invalid_operator_id The operator id in the authorization is invalid
error_validating_facility Internal Server Error
product_not_found Requested product change was not found for the zone
facility_or_zone_not_found Facility or zone in request is invalid
invalid_parking_session The parking session is invalid/does not exist
invalid_status The parking session has invalid status (e.g. it's set to error)