Payment API

Through Payment API, third party payment providers can take on payment responsibilities for parking in Autopay. The payment provider finds the ongoing parking in Autopay based on a vehicle’s license plate. When the parking has ended, Autopay will send the cost for the parking to the payment provider who then charges the customer.

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

Available resources

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. We support URLs protected with either basic authentication, token authentication, or API keys. 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


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