Statistics API

The Statistics API allows you to integrate with Autopay to retrieve data about parking sessions.

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

Available resources

Access requirements

  • A valid authentication token is required to access the API. How to authenticate your application
  • Access to the Statistics API is offered as a paid service. Please contact your Autopay representative for details.
  • Do not query API more than one time per 5 minutes for each parking zone.
  • The data from live environment will be available though API within 12 hours. Do not base real time system on this API.

GET - Get parkings

This method allows you to get a list of parkings in a date interval based on parking end time or time of the last update.

Endpoint

GET https://api.autopay.io/statistics/v1/parking

Request parameters

  • The HTTP headers must include a valid access token.
  • The path must include from and to or updated_at_from and updated_at_to parameters. Using parameters on parking time and update time at once is not supported. If you wish to apply both filters, you must first apply the primary filter and then post-process the data in your system.
  • Request parameters must be urlencoded.
Parameter Type Mandatory Description
from datetime (ISO 8601) no Date from which to query parkings e.g. 2016-02-02T12:15:00+0200 (URL encoded: 2016-02-02T12:15:00%2B0200)
to datetime (ISO 8601) no Date to which to query parkings e.g. 2016-02-02T12:15:00+0200 (URL encoded: 2016-02-02T12:15:00%2B0200)
updated_at_from datetime (ISO 8601) no Updated at date from which to query parkings e.g. 2016-02-02T12:15:00+0200 (URL encoded: 2016-02-02T12:15:00%2B0200)
updated_at_to datetime (ISO 8601) no Updated at date to which to query parkings e.g. 2016-02-02T12:15:00+0200 (URL encoded: 2016-02-02T12:15:00%2B0200)
zone_code string no Optional parameter to get only parkings with specified zone code
cursor string no Use the cursor string returned with response to get the next set of results.

Example request

https://api.autopay.io/statistics/v1/parking?from=2019-01-01T12:15:00%2B0200&to=2019-01-02T12:15:00%2B0200&cursor=jmhfgdd

Success response

HTTP Code: 200 OK

Parameter Type Description
parkings array of Parkings
summary Summary
Parking
parking_id string Unique parking ID
operator string Unique identification code of the parking operator.
updated_at datetime (ISO 8601) Last update time of parking
client_type string Client (customer) type. List of all client types
start_time datetime (ISO 8601) Start time of the parking
end_time datetime (ISO 8601) Parking end time, usually the time of payment. This coincides with exit time when automatic payment or permit were used.
exit_time datetime (ISO 8601) Time of vehicle exit from the parking zone
duration integer Duration of parking (in seconds)
landlord_id integer Unique identification number of the landlord
landlord_name string Landlord name
facility: Facility
cost Cost
revenue Cost The total revenue of a parking including both cost and calculated revenue from all Tap & Park parking sessions.
vehicle Vehicle
payment_status string Payment status of this parking. List of all payment statuses
payments array of Payments
removed boolean The flag determines whether the parking should be removed from the data set. If the flag is set to “true”, the parking should be removed from the data set and not included in the analysis and calculations.
parking_sessions array of ParkingSession
Facility
name string Name of the parking facility
code string Code of the parking facility
Cost
currency string Currency of the payment
vat_percent decimal Vat percentage
net_cost decimal Net cost
vat_amount decimal Vat amount
gross_cost decimal Gross cost
Zone
name string Name of the parking zone
code string Code of the parking zone
country string Name of the country
Vehicle
nationality string Registration country code of the vehicle.
holder_country_code string Country code of the vehicle holder if the vehicle belongs to a registered Autopay user
holder_postal_code string Postal (zip) code of the vehicle holder if the vehicle belongs to a registered Autopay user
Payment
id integer Payment ID
paid_at datetime (ISO 8601) Payment time
paid_amount decimal Total sum charged for all payments
payment_type string Payment type
payment_provider PaymentProvider When payment type is third party. List of third party payment providers
PaymentProvider
name string Name of third party payment provider
code string Unique code of third party payment provider
ParkingSession
id string Parking session ID
type string Type of the parking session. List of all parking session types
start_time datetime (ISO 8601) Start time of the parking session
end_time datetime (ISO 8601) End time of the parking session. Parking session may be ended by exit from the zone or permit expiry.
exit_time datetime (ISO 8601) Time of vehicle exit from the parking zone if any.
product_name string Name of parking product
concurrent_parking_exceeded boolean Is the number of parking permits issued for the tenant exceeded
concurrent_parking_billed_to_tenant boolean Is the exceeded parking billed to the tenant. If false end user is billed
cost Cost
revenue Cost The calculated revenue of the Tap & Park session.
tenant_id number Tenant ID
tenant_name string Name of the tenant
booking Booking
Booking
booking_id string Booking unique identifier
booking_prepaid_amount PrepaidAmount
booking_start_time datetime (ISO 8601) Start time of the booking
booking_end_time datetime (ISO 8601) End time of the booking
PrepaidAmount
amount decimal Prepaid amount
currency string Currency
Summary
total_results integer Number of parkings returned
more_results boolean True if not all parkings are returned
cursor boolean If there are more results, a cursor string is returned. This is used for pagination. To get the next batch of results, this string should be sent with the next request in the cursor parameter.

Example request

GET https://api.autopay.io/statistics/v1/parking?from=2017-01-01T12:15:00%2B0200&to=2018-01-01T22:15:00%2B0200

Note that this request path includes the path parameters from and to.


Example success responce

{
    "parkings":[
        {
            "parking_id":"1234uiu",
            "operator":"onepark_no",
            "updated_at":"2019-01-01T08:00:00+0000",
            "client_type":"REGISTERED_CUSTOMER",
            "start_time":"2017-01-01T08:00:00+0000",
            "end_time":"2017-01-01T11:05:00+0000",
            "exit_time":"2017-01-01T11:05:00+0000",
            "duration":11100,
            "cost":{
                "currency":"EUR",
                "net_cost":19.14,
                "gross_cost":21.15
            },
            "revenue":{
                "currency":"EUR",
                "net_cost":19.14,
                "gross_cost":21.15
            },
            "landlord_id":3726,
            "landlord_name":"Paleet",
            "facility":{
                "code":"3000",
                "name":"Some facility"
            },
            "zone":{
                "name":"Paleet 2-8",
                "code":"3001",
                "country":"NOR"
            },
            "vehicle":{
                "nationality":"NOR",
                "holder_country_code":"NOR",
                "holder_postal_code":"1900"
            },
            "payment_status":"PAID",
            "payments":[
                {
                    "id":123,
                    "paid_at":"2017-01-01T11:05:00+0000",
                    "paid_amount":9.01,
                    "payment_type":"Voucher"
                },
                {
                    "id":456,
                    "paid_at":"2017-01-01T11:05:00+0000",
                    "paid_amount":12.14,
                    "payment_type":"Thirdparty",
                    "payment_provider":{
                        "name":"Easypark",
                        "code":"23"
                    }
                }
            ],
            "removed":false,
            "parking_sessions":[
                {
                    "id":"101",
                    "type":"BOOKING",
                    "start_time":"2017-01-01T08:00:00+0000",
                    "end_time":"2017-01-01T10:00:00+0000",
                    "exit_time":"2017-01-01T10:00:00+0000",
                    "product_name":"Perfect Hotel's loyalty parking",
                    "concurrent_parking_exceeded":false,
                    "concurrent_parking_billed_to_tenant":false,
                    "cost":{
                        "currency":"EUR",
                        "vat_percent":10.5,
                        "net_cost":16.41,
                        "vat_amount":1.73,
                        "gross_cost":18.14
                    },
                    "revenue":{
                        "currency":"EUR",
                        "vat_percent":10.5,
                        "net_cost":16.41,
                        "vat_amount":1.73,
                        "gross_cost":18.14
                    },
                    "tenant_id":7563,
                    "tenant_name":"Perfect Hotel",
                    "booking":{
                        "booking_id":"12345",
                        "booking_prepaid_amount":{
                            "amount":100.15,
                            "currency":"EUR"
                        },
                        "booking_start_time":"2017-01-01T08:00:00+0000",
                        "booking_end_time":"2017-01-01T10:00:00+0000"
                    }
                },
                {
                    "id":"102",
                    "type":"REGULAR_PARKING",
                    "start_time":"2017-01-01T10:00:00+0000",
                    "end_time":"2017-01-01T11:05:00+0000",
                    "exit_time":"2017-01-01T11:05:00+0000",
                    "concurrent_parking_exceeded":false,
                    "concurrent_parking_billed_to_tenant":false,
                    "cost":{
                        "currency":"EUR",
                        "vat_percent":10.5,
                        "net_cost":8.15,
                        "vat_amount":0.86,
                        "gross_cost":9.01
                    }
                }
            ]
        },
        {
            "parking_id":"4321erer",
            "operator":"onepark_no",
            "updated_at":"2018-12-12T08:00:00+0000",
            "client_type":"REGISTERED_CUSTOMER",
            "start_time":"2018-05-01T08:00:00+0000",
            "end_time":"2018-05-01T10:01:00+0000",
            "exit_time":"2018-05-01T10:01:00+0000",
            "duration":7260,
            "cost":{
                "currency":"EUR",
                "net_cost":8.15,
                "gross_cost":9.01
            },
            "landlord_id":3726,
            "landlord_name":"Paleet",
            "facility":{
                "code":"3000",
                "name":"Some facility"
            },
            "zone":{
                "name":"Paleet 2-8",
                "code":"3001",
                "country":"NOR"
            },
            "vehicle":{
                "nationality":"NOR",
                "holder_country_code":"NOR",
                "holder_postal_code":"1364"
            },
            "payment_status":"UNPAID",
            "payments":[

            ],
            "removed":false,
            "parking_sessions":[
                {
                    "type":"REGULAR_PERMIT",
                    "start_time":"2018-05-01T10:00:00+0000",
                    "end_time":"2018-05-01T10:01:00+0000",
                    "exit_time":"2018-05-01T10:01:00+0000",
                    "concurrent_parking_exceeded":true,
                    "concurrent_parking_billed_to_tenant":false,
                    "cost":{
                        "currency":"EUR",
                        "vat_percent":10.5,
                        "net_cost":8.15,
                        "vat_amount":0.86,
                        "gross_cost":9.01
                    },
                    "tenant_id":9898,
                    "tenant_name":"Happy Nails"
                }
            ]
        }
    ],
    "summary":{
        "total_results":2,
        "more_results":true,
        "cursor":"jmhfgdd"
    }
}

Client types

Client type Description
TENANT This client is a Tenant in Autopay
REGISTERED_CUSTOMER This client is a registered customer in Autopay
UNREGISTERED_CUSTOMER This client is an unregistered customer in Autopay

Payment status types

Payment status Description
FREE This parking is free of charge (Set to free by operator)
GRATIS This parking is free of charge (The price is 0)
UNPAID This parking has not been paid for
PAID This parking has been paid for
PARTIALLY_PAID This parking has been partially paid for
CONTRACT Permit was used for this parking and the price was 0
INVOICED The parking is unpaid in parts or full and are sent to invoicing
UNDETERMINED The payment status of this parking is undetermined

Parking session types

Parking session type Description
REGULAR_PERMIT This parking session is bound to a contract
REGULAR_PARKING This is a regular parking session
BOOKING A booking is used for the parking session
CUSTOMER_CLUB A customer club is used for the parking session
TIMEBANK_PERMIT A timebank permit is used for the parking session
TAP_N_PARK Tap & Park is used for the parking session

Payment types

Payment type Comment
Voucher Paid with voucher in kiosk
48 hour CC payment Payed online within 48 hours of exit
Automatic CC payment Credit card is debited automatically on exit from Autopay.io profile
Kiosk CC payment Paid with credit card in kiosk
Kiosk Coins payment Paid with coins in kiosk
Thirdparty Third party payment options was used

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
search_param_error Can search either by 'from' and 'to' OR 'updated_at_from' and 'updated_at_to'.
missing_updated_at_error Failed to update parking. New entity is missing the updated_at parameter although the existing entity has one.
operator_not_found_error Operator not found
cursor_decoding_error Invalid cursor.