Available resources
- POST - Connect parking
- POST - Manual stop
- 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 callback URLs, one for Callback POST - Successful end of parking and the other for Callback POST - Cancel parking. We support URLs protected with the following authentication methods:
- basic authentication,
- token authentication (uses the Authorization header),
- API key (uses the X-API-Key header).
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. This code has to be configured under the zone configuration (Provider codes) in Autopay. |
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
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
POST - Manual stop
This method allows the payment provider to request a manual stop for parking in Autopay if, for example, an exit event is missed in the Autopay system. After a manual stop is requested, a Successful end of parking message with the details of the parking will be sent to the corresponding callback URL. However, a follow-up session will be created in the Autopay system. If a corresponding exit event happens, the follow-up session is finished and charged to the customer using the regular means in Autopay.
Note: The manual stop method should only be used if there is a missed exit event or some other issue with the parking. It should not be used to allow customers to finish their parking using the external payment application.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
Success response
HTTP Code: 200 OK
Callback POST - Successful end of parking
When parking ends successfully, Autopay will send a POST request with the parking details to the provided success callback URL. Parking is considered successful if Autopay finishes the parking successfully or the payment provider makes a manual stop request.
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
Callback POST - Cancel parking
If the parking goes into an error state in Autopay and shouldn't be charged to the customer, Autopay sends a cancellation message to the provided cancel callback URL.
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
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
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 |