Small
- Companies can manage vehicles via Fleet API, and the vehicles can use the permits assigned to the company.
In addition to the functionalities under small, the medium level includes:
- Requesting information about unpaid parking and toll road passings,
- Locking payments for unpaid parking and toll road passings,
- Declining to pay for unpaid parking and toll road passings,
- Invoicing all parking and toll road passings to the company (on one invoice per parking operator.
To use Medium level services, the company must have an agreement with a parking operator.
Enterprise- Notifications when a vehicle from the company's fleet is parking, passes a toll road or has parked longer than a preconfigured period.
The fleet profile is Autopay-wide, meaning you will only need one profile across all operators and countries. You need an agreement with each Autopay operator to get the "fleet service" on levels Medium and Enterprise. We can help and facilitate the process.
Autopay Fleet is a paid service. Getting a fleet company profile is manually handled. Please get in touch with your Autopay representative or sales@autopay.io for more information.
Fleet API
Resources to manage the fleet vehicles:- GET - Get all vehicles
- POST - Add a vehicle
- DELETE - Remove a vehicle
- POST - Detach a vehicle from all user profiles
- Webhook - Get notified when a vehicle parks or pass through a toll road
- POST - Decline to pay for the vehicle
- GET - Get all unpaid parkings and toll road passings
- GET - Get unpaid parkings and toll road passings for a vehicle
- POST - Lock/disable payment of parkings and toll road passing for users in Autopay
Access requirements
A valid authentication token is required to access the API. How to authenticate your application
To acquire Fleet API access, please contact an Autopay representative.
GET - Get all vehicles
This endpoint gives you all vehicles currently registered to the fleet. A fleet company profile on the level Small
is needed to use this service.
Endpoint
GET https://api.autopay.io/fleet/v2/vehicles
Request parameters
The HTTP headers must include a valid access token for Fleet API.
Success response
HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
license_plate_number | string | The vehicle registration number |
country_code | string | The plate country code in Alpha 2 code |
subdivision | string | Region on the vehicle registration, if it exists |
created_at | datetime (ISO 8601) | The time when the vehicle was added to the fleet |
Example success response
POST - Add a vehicle
This method allows adding vehicles to the fleet. A fleet company profile on the level Small
is needed to use this service.
Endpoint
POST https://api.autopay.io/fleet/v2/vehicles
Request parameters
- The HTTP headers must include a valid access token for Fleet API.
- The request body must be in JSON format and HTTP headers must include
Content-Type: application/json
.
Parameter | Type | Mandatory | Description |
---|---|---|---|
license_plate_number | string | yes | The vehicle registration number |
country_code | string | yes | The plate country code in Alpha 2 code |
subdivision | string | no | Region of the vehicle registration, if it exists |
Success response
HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
license_plate_number | string | The vehicle registration number |
country_code | string | The plate country code in Alpha 2 code |
subdivision | string? | Region of the vehicle registration, if it exists |
created_at | datetime (ISO 8601) | The time when the vehicle was added to the fleet |
Example success responses
DELETE - Remove a vehicle
This method allows removing vehicles from the fleet. A fleet company profile on the level Small
is needed to use this service.
Endpoint
DELETE https://api.autopay.io/fleet/v2/vehicles
Request parameters
- The HTTP headers must include a valid access token for Fleet API.
Parameter | Type | Mandatory | Description |
---|---|---|---|
license_plate_number | string | yes | The vehicle registration number |
country_code | string | yes | The plate country code in Alpha 2 code |
subdivision | string | no | Region of the vehicle registration, if it exists |
Request example
DELETE https://api.autopay.io/fleet/v2/vehicles?license_plate_number=AA12345&country_code=NO
Success response
HTTP Code: 200 OK
POST - Detach a vehicle from all user profiles
This method detaches a fleet's vehicle from all user profiles. It can be used, for example, to prevent situations where previous users are charged when the vehicle is used by the new users. A fleet company profile on the level Small
is needed to use this service.
Endpoint
POST https://api.autopay.io/fleet/v2/vehicles/detach
Request parameters
- The HTTP headers must include a valid access token for Fleet API.
- The request body must be in JSON format and HTTP headers must include
Content-Type: application/json
.
Parameter | Type | Mandatory | Description |
---|---|---|---|
license_plate_number | string | yes | The vehicle registration number |
country_code | string | yes | The plate country code in Alpha 2 code |
subdivision | string | no | Region of the vehicle registration, if it exists |
Request examples
Success response
HTTP Code: 200 OK
Getting notified when a vehicle parks, passes through a toll road or has parked longer than preconfigured periods
Fleet API offers functionality to get HTTP POST requests to a configured Webhook endpoint to create a notification about a new service for a vehicle in the fleet.
The webhook endpoint requires HTTPS support, and the endpoint URLs must be provided when requesting access to the Fleet API.
It's possible to use different URLs and access tokens for entry notification webhook and periodical notification webhook.
A fleet company profile on the level Enterprise
is needed to use this service.
Webhook Authentication
When configured, access token will be sent using Authorization
header in the form of Bearer Yo!8lWDaGfZy
.
Webhook POST JSON
Request body
Parameter | Type | Mandatory | Description | ||
---|---|---|---|---|---|
id | string | yes | A unique id of the service | ||
vehicle | |||||
license_plate_number | string | yes | The vehicle registration number | ||
country_code | string | yes | The plate country code in Alpha 2 code | ||
subdivision | string | no | Region of the vehicle registration, if it exists | ||
created_at | datetime (ISO 8601) | yes | The time when the vehicle was added to the fleet | ||
facility | |||||
code | string | yes | Facility's code | ||
name | string | yes | Facility's name | ||
zone | |||||
code | string | yes | Zone's code | ||
name | string | yes | Zone's name | ||
start_time | datetime (ISO 8601) | yes | Start time of the service in UTC | ||
operator_id | string | yes | ID of the operator | ||
type | string | yes | Type of the service. Possible types: PARKING , TOLL_ROAD | ||
notification_period | string | no | Amount of time in seconds between entry event and this notification. This field is only present on periodical notification webhook's request. | ||
service_data | map | no | Any additional data of the service |
Request examples
POST - Decline to pay for the vehicle
In some cases Fleet companies may wish to not take payment responsibility for a parking or toll road passings. Meaning the cost will not be invoice to the fleet company profile.
By calling this endpoint you can decline the payment responsibility for a specific parking or toll road passing. In doing so the normal invoice process will kick in and the owner of the vehicle will be invoiced instead.
The default behaviour is that all cost for a fleet vehicle are invoiced to the fleet company.
Most companies do not wish to use this endpoint.
A fleet company profile on the level Medium
is needed to use this service.
Endpoint
POST https://api.autopay.io/fleet/v2/services/{service_id}/decline
Request parameters
- The HTTP headers must include a valid access token for Fleet API.
Success response
HTTP Code: 200 OK
GET - Get all unpaid parkings and toll road passings
This method allows you to get a list of unpaid parkings and toll road passings for all of your vehicles in the fleet. Note that only finished sessions will be included in the results when using this endpoint.
A fleet company profile on the level Medium
is needed to use this service.
Endpoint
GET https://api.autopay.io/fleet/v2/services
Request parameters
- The HTTP headers must include a valid access token for Fleet API.
Parameter | Type | Mandatory | Description |
---|---|---|---|
cursor | string | no | Use the cursor string returned with response to get the next set of results |
Request example
GET https://api.autopay.io/fleet/v2/services?cursor=ClQSTmoTaH5hdXRvcGF5LXRlc3QtY29yZXI3CxINZmxlZXRfc2VydmljZSIkMjc0Y2M2NGYtOTk5Yi00OTY0LThhZDQtZDEzYWY4MjMwNDY0DBgAIAA=
Success response
HTTP Code: 200 OK
Parameter | Type | Mandatory | Description | ||
---|---|---|---|---|---|
services | array of Services | yes | |||
summary | Summary | yes | |||
Service | |||||
id | string | yes | A unique id for the service. | ||
facility | |||||
code | string | yes | Facility's code | ||
name | string | yes | Facility's name | ||
zone | |||||
code | string | yes | Zone's code | ||
name | string | yes | Zone's name | ||
product_name | string | no | Product's name | ||
vehicle | Vehicle | yes | |||
start_time | datetime (ISO 8601) | yes | Start time of the service in UTC | ||
end_time | datetime (ISO 8601) | no | End time of the service in UTC | ||
cost | Cost | no | |||
operator_id | string | yes | ID of the service operator | ||
type | string | yes | Type of the service. Possible types: PARKING , TOLL_ROAD | ||
service_data | map | no | Any additional data of the service | ||
invoicing_status | string | yes | Status of invoice: NOT_INVOICED , NOT_INVOICEABLE , IN_INVOICING , INVOICED | ||
Vehicle | |||||
license_plate_number | string | yes | The vehicle registration number | ||
country_code | string | yes | The plate country code in Alpha 2 code | ||
subdivision | string | no | Region of the vehicle registration, if it exists | ||
created_at | datetime (ISO 8601) | yes | The time when the vehicle was added to the fleet | ||
Cost | |||||
currency | string | yes | Currency in Alpha 3 code | ||
vat_percent | double | yes | VAT percentage | ||
net_amount | double | yes | Net amount | ||
vat_amount | double | yes | VAT amount | ||
gross_amount | double | yes | Gross amount | ||
Summary | |||||
total results | integer | yes | Total number of results returned | ||
more_results | boolean | yes | Is there more results matching the path parameters | ||
cursor | string | no | Cursor string to fetch the next batch of results if more_results is true |
Example response:
GET - Get unpaid parkings and toll road passings for a vehicle
This method allows you to get a list of parkings and toll road passings for a vehicle in the fleet.
A fleet company profile on the level Medium
is needed to use this service.
Endpoint
GET https://api.autopay.io/fleet/v2/vehicles/services
Request parameters
- The HTTP headers must include a valid access token for Fleet API.
- The specified period in the
from
andto
parameters cannot exceed the maximum limit of 50 days.
Parameter | Type | Mandatory | Description |
---|---|---|---|
license_plate_number | string | yes | The vehicle registration number |
country_code | string | yes | The plate country code in Alpha 2 code |
subdivision | string | no | Region of the vehicle registration, if it exists |
type | string | no | Type of service. Possible types: PARKING , TOLL_ROAD |
from | datetime (ISO 8601) | no | Filters out the services where the end_time is before from . The default value is to minus 50 days. |
to | datetime (ISO 8601) | no | Filters out the services where the end_time is after to . The default value is the current datetime. |
include_running_services | boolean | no | If set true, the response will include services that are still in progress |
Request example
GET https://api.autopay.io/fleet/v2/vehicles/services?license_plate_number=AA12345&country_code=NO&type=PARKING&from=2022-06-06T19%3A34%3A40%2B0300&to=2022-07-06T19%3A40%3A40%2B0300&include_running_services=true
Success response
HTTP Code: 200 OK
Response body is a list of unpaid services.
Service object attributes
Parameter | Type | Mandatory | Description |
---|---|---|---|
id | string | yes | A unique id for the service. |
facility | |||
code | string | yes | Facility's code |
name | string | yes | Facility's name |
zone | |||
code | string | yes | Zone's code |
name | string | yes | Zone's name |
product_name | string | no | Product's name |
vehicle | yes | ||
license_plate_number | string | yes | The vehicle registration number |
country_code | string | yes | The plate country code in Alpha 2 code |
subdivision | string | no | Region of the vehicle registration, if it exists |
created_at | datetime (ISO 8601) | yes | The time when the vehicle was added to the fleet |
start_time | datetime (ISO 8601) | yes | Start time of the service in UTC |
end_time | datetime (ISO 8601) | no | End time of the service in UTC |
cost | no | ||
currency | string | yes | Currency in Alpha 3 code |
vat_percent | double | yes | VAT percentage |
net_amount | double | yes | Net amount |
vat_amount | double | yes | VAT amount |
gross_amount | double | yes | Gross amount |
operator_id | string | yes | ID of the service operator |
type | string | yes | Type of the service. Possible types: PARKING , TOLL_ROAD |
service_data | map | no | Any additional data of the service |
invoicing_status | string | yes | Status of invoice: NOT_INVOICED , NOT_INVOICEABLE , IN_INVOICING , INVOICED |
Example response:
POST - Lock/disable payment of parkings and toll road passing for users in Autopay
By default all payment options except invoice are enabled for fleet vehicles. So when someone is driving a fleet vehicle they can use Autopay like normal e.g. pay in the kiosk, automatically on exit or online within 48 hours. To avoid the situation where the customer pays twice, both in Autopay and to the fleet company when the vehicle is returned use this endpoint to stop Autopay from taking payment.
Once a parking or toll road passings is marked and payed externally Autopay will block all payment options making it impossible for a customer to pay twice for the same service.
The response to the request includes a list of successfully locked services with the relevant details.
A fleet company profile on the level Medium
is needed to use this service.
Endpoint
POST https://api.autopay.io/fleet/v2/vehicles/disable_payments
Request parameters
- The HTTP headers must include a valid access token for Fleet API.
- The request body must be in JSON format and HTTP headers must include
Content-Type: application/json
. - The specified period in the
from
andto
parameters cannot exceed the maximum limit of 50 days.
Parameter | Type | Mandatory | Description |
---|---|---|---|
license_plate_number | string | yes | The vehicle registration number |
country_code | string | yes | The plate country code in Alpha 2 code |
subdivision | string | no | Region of the vehicle registration, if it exists |
type | string | no | Type of service. Possible types: PARKING , TOLL_ROAD |
from | datetime (ISO 8601) | no | Filters out the services where the end_time is before from . The default value is to minus 50 days. |
to | datetime (ISO 8601) | no | Filters out the services where the end_time is after to . The default value is the current datetime. |
include_running_services | boolean | no | If set true, the response will include services that are still in progress |
Request examples
Success response
HTTP Code: 200 OK
Response body is list of unpaid and locked services.
Service object attributes
Parameter | Type | Mandatory | Description |
---|---|---|---|
id | string | yes | A unique id for the service. |
vehicle | yes | ||
license_plate_number | string | yes | The vehicle registration number |
country_code | string | yes | The plate country code in Alpha 2 code |
subdivision | string | no | Region the vehicle registration, if it exists |
created_at | datetime (ISO 8601) | yes | The time when the vehicle was added to the fleet |
start_time | datetime (ISO 8601) | yes | Start time of the service in UTC |
end_time | datetime (ISO 8601) | no | End time of the service in UTC |
cost | no | ||
currency | string | yes | Currency in Alpha 3 code |
vat_percent | double | yes | VAT percentage |
net_amount | double | yes | Net amount |
vat_amount | double | yes | VAT amount |
gross_amount | double | yes | Gross amount |
operator_id | string | yes | ID of the service operator |
type | string | yes | Type of the service. Possible types: PARKING , TOLL_ROAD |
service_data | map | no | Any additional data of the service |
invoicing_status | string | yes | Status of invoice: NOT_INVOICED , NOT_INVOICEABLE , IN_INVOICING , INVOICED |
Example responses
Error handling
Example error response
Possible error ids
Error id | Explanation |
---|---|
forbidden | Unauthorized |
internal_server_error | Internal server error |
fleet_vehicle_get_error | Failed to get vehicles |
fleet_vehicle_save_error | Failed to save vehicles |
fleet_vehicle_delete_error | Failed to delete vehicle |
vehicle_services_invalid_date_range | The specified period exceeds the maximum limit |
cursor_decoding_error | Failed to decode cursor |