Access requirements:
- A valid authentication token is required to access the API. How to authenticate your application
The Permit E-commerce API can be used by landlords to issue permit allocations to tenants. The API supports creating, updating and deleting permit allocations as well as creating and querying tenants.
This method allows you to get all available permit definitions for a landlord that can be used to issue permit allocations.
GET https://api.autopay.io/permit/v2/landlord/{landlordId}/permitDefinitions
operator_id
and landlord_id
.landlordId
is the ID of the landlord for which this query should be run.HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
landlord_id | string | The ID of the landlord that the following permit definitions belong to. |
permit_definitions | array | The actual list of permit definitions that are available under the given landlord. |
permit_definition_id | string | Permit definition ID |
permit_definition_name | string | Permit definition name |
facilities | array | The list of facilities in which this kind of permit is valid. |
facility_code | string | The ID (code) of the facility |
facility_name | string | The display name of the facility |
zones | array | The list of zones within the facility where this kind of permit is valid. |
zone_code | string | The ID (code) of the zone |
zone_name | string | The display name of the zone |
Creates a new tenant and returns the new tenant's ID. Even though the tenant ID is returned, it might take a couple of seconds for the tenant to be created in all subsystems. Using the newly created tenant ID in a subsequent request might lead to an error in case the second request is sent in immediately after the first one. In such case the second request should be retried a few seconds later.
PUT https://api.autopay.io/permit/v2/landlord/{landlordId}/tenant/new
operator_id
and landlord_id
.landlordId
is the ID of the landlord under which the new tenant should be created.Parameter | Type | Description |
---|---|---|
name | string | The name of the new tenant. This will be set both as tenant name & the display name for the tenant which is visible only for landlords. |
manager_email | string | The email address of the new tenant's manager. |
type | enum | Sets the type of the new tenant. The possible values are FULL and BASIC . Use FULL if the tenant is a company, or if they will receive more than one permit per allocation. Such tenants will have access to other functionality too in autopay.io - like booking and Tap & Park. BASIC tenant should be used in case the tenant is an individual, and should be receiving exactly one permit per allocation. |
HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
tenant_id | string | The ID of the new tenant. |
This method returns all existing permit allocations that belong to the given tenant. The list includes all permit allocations, regardless of whether they were created via this API, or in autopay.io.
GET https://api.autopay.io/permit/v2/landlord/{landlordId}/tenant/{tenantId}
operator_id
and landlord_id
.landlordId
is the ID of the landlord which the tenant in question belongs to.tenantId
is the ID of the tenant for which this query should be run.HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
name | string | The display name of the tenant, as set by the tenant manager(s) |
tenant_id | string | The ID of the tenant to which the following permit allocations belong. |
permit_allocations | array | The list of permit allocations that the tenant has access to. |
updated_via_api | boolean | This field is true if the given allocation was created or has been updated via this API. Allocations that have been created directly in autopay.io (and have not been updated by this API) will have this flag set to false . |
permit_allocation_id | string | The ID of the permit allocation. |
permit_definition_id | string | The ID of the permit definition that this allocation was created with. |
parking_spaces_count | number | The number of parking spaces that can be used simultaneously by the users of this permit allocation. |
permit_count | number | The number of permits that the tenant is allowed to issue to end-users. |
valid_from | ISO date | The day from which this permit allocation is valid. |
valid_to | ISO date | The day until which this permit allocation is valid. |
time_zone_id | string | The ID of the time zone where the validity dates should be interpreted |
Code | Explanation |
---|---|
409 Conflict | The tenant that the query was run for is not fully created yet. This condition should not last more than a few seconds. Retry the request later. |
Creates a new permit allocation on an existing tenant.
PUT https://api.autopay.io/permit/v2/landlord/{landlordId}/permitAllocations/new
operator_id
and landlord_id
.landlordId
is the ID of the landlord under which the new allocation should be created.Parameter | Type | Description |
---|---|---|
tenant_id | string | The ID of the tenant for which the new allocation should be created. |
permit_definition_id | string | The ID of the permit definition that this allocation should be created with. |
parking_spaces_count | number | The number of parking spaces that can be used simultaneously by the users of this permit allocation. For basic tenants, this should be set to 1. |
permit_count | number | The number of permits that the tenant is allowed to issue to end-users. For basic tenants, this should be set to 1. |
valid_from | ISO date | The day from which this permit allocation is valid. |
valid_to | ISO date | The day until which this permit allocation is valid. The latest date accepted is 2099-01-01, which means no end date. |
HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
tenant_id | string | The ID of the tenant to which the following, new permit allocation belongs. |
permit_allocation_id | string | The ID of the permit allocation. |
parking_spaces_count | number | The number of parking spaces that can be used simultaneously by the users of this permit allocation. |
permit_count | number | The number of permits that the tenant is allowed to issue to end-users. |
valid_from | ISO date | The day from which this permit allocation is valid. |
valid_to | ISO date | The day until which this permit allocation is valid. |
time_zone_id | string | The ID of the time zone where the validity dates should be interpreted |
Code | Explanation |
---|---|
409 Conflict | The tenant that should be receiving the permit allocation is not fully created yet. This condition should not last more than a few seconds. Retry the request later. |
Updates an existing permit allocation. If the allocation was originally created via autopay.io (and hence has the updated_via_api
flag set to false
), it will cause this flag to be set to true
permanently. It might happen that the update cannot be applied as requested, e.g due to more permits being issued than the updated number of available permits. In this case the new number is going to be as close as possible to what was requested. The result of the update is returned in the response.
POST https://api.autopay.io/permit/v2/landlord/{landlordId}/tenant/{tenantId}/permitAllocations/{permitAllocationId}
operator_id
and landlord_id
.landlordId
is the ID of the landlord under which the allocation should be updated.tenantId
is the ID of the tenant under which the allocation should be updated.permitAllocationId
is the ID of allocation to be updated.Parameter | Type | Description |
---|---|---|
parking_spaces_count | number | The number of parking spaces that can be used simultaneously by the users of this permit allocation. For basic tenants, this should be set to 1. |
permit_count | number | The number of permits that the tenant is allowed to issue to end-users. For basic tenants, this should be set to 1. |
valid_from | ISO date | The day from which this permit allocation is valid. It can only be changed if the permit allocation has not been activated, meaning the valid_from date has passed. Not required. |
valid_to | ISO date | The day until which this permit allocation is valid. The latest date accepted is 2099-01-01, which means no end date. |
HTTP Code: 200 OK
Parameter | Type | Description |
---|---|---|
tenant_id | string | The ID of the tenant to which the following permit allocation belongs. |
permit_allocation_id | string | The ID of the permit allocation. |
parking_spaces_count | number | The number of parking spaces that can be used simultaneously by the users of this permit allocation. |
permit_count | number | The number of permits that the tenant is allowed to issue to end-users. |
valid_from | ISO date | The day from which this permit allocation is valid. |
valid_to | ISO date | The day until which this permit allocation is valid. |
time_zone_id | string | The ID of the time zone where the validity dates should be interpreted |
Deletes an existing permit allocation.
DELETE https://api.autopay.io/permit/v2/landlord/{landlordId}/tenant/{tenantId}/permitAllocations/{permitAllocationId}
operator_id
and landlord_id
.landlordId
is the ID of the landlord under which the allocation should be deleted.tenantId
is the ID of the tenant under which the allocation should be deleted.permitAllocationId
is the ID of allocation to be deleted.HTTP Code: 200 OK
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. |
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 |
fetch_tenant_issued_permits_error | Error fetching tenant's issued permits. |
fetch_tenant_allocations_error | Error fetching tenant allocations. |
allocate_end_user_permit_error | Error allocating end user permit. |
update_end_user_permit_error | Error updating end user permit. |
remove_end_user_permit_error | Error removing end user permit. |
operator_not_found_error | Operator not found. |
update_permit_allocation_request_failure | Request failure when updating permit allocation |
update_permit_allocation_failed_to_fetch_landlord | Failed to fetch landlord |
update_permit_allocation_failed_to_authorize_for_landlord | The landlord is not under the given operator |
update_permit_allocation_api_access_not_enabled_for_operator | API access is not enabled for landlord |
delete_permit_allocation_request_failure | Request failure when updating permit allocation |
delete_permit_allocation_failed_to_fetch_landlord | Failed to fetch landlord |
delete_permit_allocation_failed_to_authorize_for_landlord | The landlord is not under the given operator |
delete_permit_allocation_api_access_not_enabled_for_operator | API access is not enabled for landlord |
missing_operator_token_error | Missing operator in access token |
missing_landlord_token_error | Missing landlord in access token |