Available resources
- POST - Connect parking
- POST - Manual stop
- POST - Manual start
- Callback POST - Successful end of parking
- Callback POST - Cancel parking
- Error handling
Access requirements
- A valid authentication token is required to access the API. How to authenticate your application
- Please note that Autopay provides separate API credentials to manage payments for different operators.
Note: Integrators must provide Autopay with two callbak URLs. We support URLs protected with basic authentication. More info about the callback below.
POST - Connect parking
This method allows you to register an external payment and connect it to the parking.
Endpoint
POST https://api.autopay.io/payment/v1/connect_parking
Request parameters
- The request body must be in JSON format and HTTP headers must include
Content-Type: application/json
. - The headers must include a valid access token.
Parameter | Type | Mandatory | Description |
---|---|---|---|
parking_area_code | string | yes | Code of the parking facility in payment provider's system |
reference | string | yes | Your unique identifier for the parking. Commonly a primary key is used. |
vehicle_reg | string | yes | Vehicle registration number (license plate) |
plate_issuer | string | yes | County code of the plate issuer (ISO 3166-1 alpha-3) |
plate_subdivision | string | no | Region (subdivision) of the vehicle |
Example request
{
"parking_area_code": "area1",
"reference": "ref1",
"vehicle_reg": "123ABC",
"plate_issuer": "NOR",
"plate_subdivision": null
}
Success response
HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
parking_id | string | The unique ID of the parking in Autopay |
reference | string | Your unique identifier for the parking. Commonly a primary key is used. |
start_time | date-time | Start time of the parking (ISO8601) |
Example request
POST https://api.autopay.io/payment/v1/connect_parking
Example success responce
{
"parking_id": "1234567890",
"reference": "ref1",
"start_time": "2019-02-26T11:52:16+0000"
}
POST - Manual stop
This method allows you to request manual stop for parking in Autopay.
Endpoint
POST https://api.autopay.io/payment/v1/manual_stop
Request parameters
- The request body must be in JSON format and HTTP headers must include
Content-Type: application/json
. - The headers must include a valid access token.
- The headers must include a valid access token.
- Please see the table below for post parameters.
Parameter | Type | Mandatory | Description |
---|---|---|---|
parking_id | string | yes | The unique ID of the parking in Autopay |
reference | string | yes | Your unique identifier for the parking. Commonly a primary key is used. |
end_time | datetime (ISO 8601) | yes | End time of the parking provided by the payment provider |
Example request
{
"parking_id": "1234567890",
"reference": "ref1",
"end_time": "2019-02-28T11:52:16+0000"
}
Success response
HTTP Code: 200 OK
POST - Manual start
This method allows you to manually start a parking session in Autopay.
Endpoint
POST https://api.autopay.io/payment/v1/manual_start
Request parameters:
- The request body must be in JSON format and HTTP headers must include
Content-Type: application/json
. - The headers must include a valid access token.
- Special permission is needed to use the manual start endpoint; credentials must include the scope “PAYMENT_PROVIDER_MANUAL_START“.
- Please see the table below for post parameters.
Parameter | Type | Mandatory | Description |
---|---|---|---|
parking_area_code | string | yes | Code of the parking facility in payment provider's system |
zone_code | string | yes | Id of the parking zone where the parking takes place |
reference | string | yes | Your unique identifier for the parking. Commonly a primary key is used. |
vehicle_reg | string | yes | Vehicle registration number (license plate) |
plate_issuer | string | yes | County code of the plate issuer (ISO 3166-1 alpha-3) |
plate_subdivision | string | no | Region (subdivision) of the vehicle |
start_time | datetime (ISO 8601) | yes | Start time of the parking provided by the payment provider |
Example request:
{
"parking_area_code": "area1",
"zone_code": "1111",
"reference": "ref1",
"vehicle_reg": "123ABC",
"plate_issuer": "NOR",
"plate_subdivision": null,
"start_time": "2021-07-28T11:52:16+0000"
}
Success response
HTTP Code: 204 OK
Callback POST - Successful end of parking
When parking ends, Autopay will send a POST request to the provided success callback URL with parking details. Parking is successful if Autopay finishes the parking, or the payment provider makes a manual stop.
Parking is successfully ended
Parameter | Type | Description |
---|---|---|
parking_id | string | The unique ID of the parking in Autopay |
reference | string | Your unique identifier for the parking. Commonly a primary key is used. |
end_time | date-time | End time of the parking provided by the payment provider (ISO8601). |
cost: | ||
currency | string | Currency of payment |
vat_percent | decimal | VAT percent of payment |
net_amount | decimal | Amount of payment without VAT |
vat_amount | decimal | Amount of VAT |
gross_amount | decimal | Amount of payment with VAT |
Example request body
{
"parking_id": "1234567890",
"reference": "ref1",
"end_time": "2019-02-28T11:52:16+0000",
"cost": {
"currency": "NOK",
"vat_percent": 20.0,
"net_amount": 100.0,
"vat_amount": 20.0,
"gross_amount": 120.0
}
}
Callback POST - Cancel parking
Autopay sends cancellation message to provided cancel callback URL if the parking goes into an error state in Autopay.
Parking is canceled
Parameter | Type | Description |
---|---|---|
parking_id | string | The unique ID of the parking in Autopay |
reference | string | Your unique identifier for the parking. Commonly a primary key is used. |
Example request body
{
"parking_id": "1234567890",
"reference": "ref1"
}
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 |
server_communication_error | Error communication with server |
operator_not_found_error | Operator not found |
missing_operator_token_error | Missing operator in access token |