Infringement API

Infringement API

Introduction

The Infringement API can be used to look up vehicle and driver details for infringements such as traffic fines.  You can also use it to record infringement details against a reservation, add a fee, and take a payment where applicable.

Please Note: There is a cost accosiated with this service. Please contact support@rentalcarmanager.com for more information. 

What is an Infringement?

An infringement is a notice of a traffic violation such as a speeding or parking fine that is usually issued by an Infringement Authority (police or local government).  A road toll may also be considered an infringement under this API.

Why use this API?

This Infringement API is designed to reduce the administrative overhead of processing infringements manually via RCM.  

Who is this document for?

This document gives an overview of the steps required to process infringements via our API. It is a technical document intended for web developers.

Overview

There are two methods to use:
1. Get Trip - pass in the vehicle registration number and date/time of the offence, and receive some information about the customer who was driving the vehicle at the time.  The information returned should be enough to produce a Statutory Declaration for the infringement, and to email the customer if necessary.
2. Process Infringement - record the infringement against the booking reservation inside RCM.  You can optionally decide to record an administration fee against the booking, and optionally indicate that RCM should attempt to collect a payment for that fee.  Note that at this time RCM does not produce a Statutory Declaration record via this API, nor does RCM email the customer to inform them of the fee taken (if applicable).

Note that to charge a fee for an infringement, it will need to be a fixed-amount fee, and you will need to set this up inside RCM and then let the RCM Support team which fee you would like to use.  It would typically be named something like "Infringement Processing Fee" or "Infringement Administration Charge".  The RCM Support team will then link this fee to your API.

More information about each method call is provided further down this article.

Getting Started

Developer Sandbox Area

The first thing you need to do is contact Rental Car Manager (RCM) and ask for a Sandbox Login via support@rentalcarmanager.com .  If you already have user credentials to RCM's Sandbox, please let us know your current username.
Note that for use of this API, your API Key will be linked to an "Infringement Processor" entity.  This could be your company name (if a third-party company).  
The Sandbox Area allows you to access your Live API Key.  Note that if you are from a third-party company, RCM will need to request permission from the Rental Car Company/s that you are working with before granting an API key.  

API Credentials

Every API request requires two pieces of information that is unique to you, as an API user.
  1. API Key
    The API key identifies you to RCM. It is used only for the initial Authorisation Request. This forms the “username” for the token request (see “Authorisation Token Request” below for more details)
  2. Shared Secret
    The shared secret forms your password for the initial Authorisation Request. It is essential that this value remains secure, i.e. do not publish it to the browser, do not include it in any email to RCM, or in a screenshot.
Your API Key along with the Shared Secret will be available to you through the sandbox area: https://sandbox.rentalcarmanager.com/developer/credentials.



If you are third-party that connects to more than one RCM company, you will be given one API Key/Shared Secret pair for each company.

Authorisation

Request Structure - Authorisation

The first call that you make to the API must be to request an Authorisation Token. Once you have received an Authorisation Token, you can use the token value with every subsequent request until the token has reached its expiry time.

Note that tokens are valid for 30 minutes. Once this period has expired you will need to re-authorise by requesting another token. Tokens are valid for multiple API calls.

IMPORTANT: Your shared secret value (which is used as the password) MUST be kept on your server and not sent out to the browser in HTML or javascript. This method call must be made from your server rather than client-side/ajax.

URL

Request Headers

The request body will be in name/value pairs “form” format, so you include the following header value:
  1. Content-Type : application/x-www-form-urlencoded

Request Body

The request body for authorisation is three name/value pairs in “form” format as follows:
username=<api_key>&password=<shared_secret>&grant_type=password

Only the green text above will need substituting for your values. The grant_type=password is fixed text, do not substitute your password here.

Note that if your api_key or your shared_secret contain any non-url-friendly characters (such as ‘&’ or ‘=’) you will need to UrlEncode them first.

Response Structure

The response will be in JSON format as in the following sample:

{"access_token":"GthjLr8m4ovocrNyr7oWWWGbUuC3bnfVAs1Pt2aaPtOk9ys_oeMtidDGN2fzWnTeYDufxO4LFFdg4BKjhBdpihw3mWoxpnhC9QimgwWYNF6aOtP0TdsYUNn59kW7qVMOCsZPq26HLn12XwAYhuxRkUMNre_P3kBLy29DDHDbY-wSIAC-3UZKQb-VsawJKixStJoJ80vM-dW4bqPDsc49zO6MtCTnu51KnJojqx9fOU_dkZvhob3TGtHp98eQ_NHVta6k_-NOyHK1-B5-uMnED7SfXLfkfB6azfUx4TgcDLan_O-qfBAFd7MU_OEfpZlKHfJc8FOukmqEdYlAajprQ-Cnv7_SRGfvgH7urqvpHoKxMHsAHkekC9oGBGwiwPAj70XD8NRAqHmwss-mdiD7keUHHAe6UDqgkaYsdHUEMKmfvNHFO-TeRQBd5HsQIdwf8Z-phRyCjG-4qe7yhHD-0kKNPBuWPFDhwedBGmuayRSu2_AiJCyHRaYimAX0xskX",
"token_type":"bearer",
"expires_in":1799,
"userName":"<your api key>",
".issued":"Fri, 06 Jul 2022 04:33:37 GMT",
".expires":"Fri, 06 Jul 2022 05:03:37 GMT"}

You will need to pull out the value for “access_token” and forward this value with all api requests as described below.

API Method Calls

This section gives general information about how to call a method.  See further below in this article for the technical specification of each method.

Request Structure - API Method Calls

Once you have gained your authorisation token using the above token call, you can then proceed to call the relevant API method. Each API method call will follow the same structure:

URL

Request Headers

You will need to include the Authorization header with the auth token value that you received in the Authorisation request described previously:
  1. Authorization : Bearer <auth token value> (Note that there is a single space between “Bearer” and the auth token value.)
The request body will need to be in JSON format, so add the header to indicate this:
  1. Content-Type : application/json

Request Body

The request body is a JSON structure, which includes the method name, followed by the name/value pairs of request data. For example:
{
    "method""gettrip",
    "infringementdate""15/04/2022",
    "infringementtime""14:45",
    "vehicleregistrationno""QQQ555",
    "requestid":"1653275849",
    "infringementid""2022040000A123456789"
}

Response Structure

The response from each API method call is in JSON format, and is in the general structure below:

{"status":"OK", "error": "", "results":{<results here>},"ms":100,"issues":[]}

status: either “OK” or “ERR”. If “ERR”, then refer to the error field below for more information

error: Empty if no errors encountered, otherwise a description of the error. E.g. “ReservationNo must be numeric.”

results: Results from the method call are output here. Result sets will vary depending on the method.

ms: The length of time, in milliseconds, that it took to process the request on RCM’s server. Examining this value if you are getting slow requests may help pinpoint where the delay is.

issues: Any warnings about the API request that didn’t prevent the request from executing. For example, an invalid value for a non-mandatory field, or where the main request succeeded but a secondary function failed.

Checking for Errors

After making an API call, always check the error JSON field first. If this is empty, it is safe to proceed. See the Troubleshooting section for more information.

Testing and Help

Testing

We do not provide test systems.  The ideal way to test is to ask the Rental Car Company to set up some test reservations for you, and liaise with them regarding expected results etc.

Troubleshooting

The first stage of your testing should be to make sure that your key is valid and working. You can do this by requesting the Authorisation token as described above. If there is a problem here, double-check your credentials, and then please contact RCM Support (support@rentalcarmanager.com) as it is possible that there is an issue with your key.  Do not provide your Shared Secret in any correspondence with RCM.

Any errors generated from your API calls will be returned in the “errors” field in your response.

Help

For more help with API implementation problems, please contact RCM Support (support@rentalcarmanager.com).

For all Help requests, please ensure that you include debugging information in your email - this includes the full URL, the full REQUEST, and the full RESPONSE.  An indication of the date/time that you made the request will also help our support team zero in on the issue.


API Method Specification

Method 1 - Get Trip

Description

Use this method to look up details of the customer who had the vehicle at the time of the infringement.
You can call this method any number of times using the same InfringmentId.  For example, if the first time you call the method you receive "No Payment Details Recorded", you may follow up a week later to find that the customer now has a credit card token stored against the booking, so this method would return slightly different results.

Request

The following parameters form part of the request:

Parameter Name
Required or Optional
Type
Description
Sample
method
Required
string
name of method you are calling.  Must be "gettrip"
"gettrip"
infringementdate
Required
date dd/MM/yyyy
Date of the infringement in format dd/MM/yyyy
16/04/2022, 31/10/2022
infringementtime
Required
time HH:mm
Time of the infringement in format HH:mm (use 24 hour time, with leading zero if necessary) 
09:14, 15:36
vehicleregistrationno
Required
string, max 15 chars
Registration number of the vehicle 
"QQQ555"
vehicleregistrationstate
Required (use 0 if unknown)
integer
State of the registration plates of the vehicle.  Must be an integer.  For Australia 1=ACT,2=NSW,2=VIC,4=QLD,5=SA,6=WA,7=TAS,8=NT.
Pass 0 if no match or unknown.
2
description
Optional
string, max 100 characters
Description of the infringement or offence., max 100 characters.  

requestid
Required
string, max 20 characters
A unique identifier for this request, it could be generated for each request, or the same per infringement.  E.g. an ID from your system.  We can use this to trace the request if there is a problem identified.
any value determined by you
infringementid
Required
string, max 35 characters
A unique identifier/number for the infringement.  This should be obtained from the infringement notice, we will use this to ensure that an individual infringement is only processed once.
731680172   

Sample Request:
{
    "method""gettrip",
    "infringementdate""15/04/2022",
    "infringementtime""14:45",
    "vehicleregistrationno""QQQ555",
"vehicleregistrationstate"4,
    "requestid":"1653275849ABC",
    "infringementid""731680172"
}

Response

The general response format is described above.  The Results section will contain the following fields:

Field Name
Type
Description
Sample
infringementid
string
The InfringementID that was passed in the request
731680172   
tripstatuscode
int
Indicates the status of this trip.  Possible values are:
1 = Trip found - the vehicle was found and was matched to a reservation.
2 = Vehicle not found - the vehicle is unknown in the system
3 = Trip not found - the vehicle was found but there was no reservation for this date/time
4 = Error - unspecified problem occurred

1
tripstatus
string
Text description of above trip status code.  Possible values:
Trip Found
Vehicle Not Found
Trip Not Found
ERR: more than one trip found
Trip Found
paymenttypecode
int
Indicates the payment status for this trip.  Possible values are:
0 = N/A - No trip
1 = Credit Card supplied - this customer has a payment gateway token that may be able to be charged to recover a processing fee or toll payment
2 = On Account - customer has set up an account for billing
3 = Non-Revenue booking - infringement was incurred on a maintenance/staff/internal movement booking such as vehicle relocation or shuttle.  Payment processing cannot occur on this booking.
4 = No payment details recorded.  Payment processing cannot occur for this booking until a credit card is supplied by the customer.
5 = Payment has already been processed for this infringement.
1
paymenttype
string
Text description of above payment status code.  Possible values:
Credit Card Token Supplied
On Account
Non Revenue Trip
No Payment Details Recorded
Already Paid
Credit Card Token Supplied
rcmreferenceid
string 
Unique identifier for this reservation (if found). This is required for some other RCM API methods (but not for "processinfringement")
817AD2FA8775
reservationno
int
Unique identifier for this reservation (if found).  This is required for some other API methods including "processinfringement".
123456
pickupdatetime
date time format dd-MMM-yyyy HH:mm
Date and time of the start (pick up) of this reservation
14-Apr-2022 09:00
dropoffdatetime
date time format dd-MMM-yyyy HH:mm
Date and time of the return (drop off) of this reservation
20-Apr-2022 14:00
customerfirstname
string
First name of the customer/primary driver of this reservation
John
customerlastname
string
Last name of the customer/primary driver of this reservation
Johnson
customeraddress
string
Address of the customer/primary driver of this reservation
1 Test Street
customercity
string
City/suburb of the customer/primary driver of this reservation
Test Town
customerpostcode
string
Postcode of the customer/primary driver of this reservation
4000
customerstate
string 
State of the customer/primary driver of this reservation
Queensland
csutomercountry
string 
Country of the customer/primary driver of this reservation
Australia
customermobile
string
Mobile number of the customer/primary driver of this reservation
0444444444
customerphone
string 
Phone number of the customer/primary driver of this reservation
0744444444
customeremail
string 
Email of the customer/primary driver of this reservation
customerlicense
string
License number of the customer/primary driver of this reservation
DL123456
customerlicenseissuedby
string
Country or State the License was issued in
Queensland
customerdob
date
Date of Birth of the customer/primary driver of this reservation.  If not recorded this will be 01-Jan-0001
01-Jan-1980 00:00
customerpassport
string
Passport number of the customer/primary driver of this reservation
P123456
vehiclemake
string
Make of the vehicle against the reservation.
Toyota
vehiclemodel
string
Model of the vehicle against the reservation.
Camery
vehicleyear
string
The year of the vehicle against the reservation.
2008
vehicleregistrationno
string
Registration Number of the vehicle against the reservation.
RCM123
customerlicenseexpiry
date
The license expiry date for the customer/driver against this reservation.
01-Jan-2025 00:00
Some other fields may be returned empty, these can be ignored




Sample Reponse:
{
    "status""OK",
    "error""",
    "results": [
        {
            "infringementid""731680172",
            "tripstatuscode"1,
            "tripstatus""Trip Found",
            "paymenttypecode"1,
            "paymenttype""Credit Card Token Supplied",
            "rcmreferenceid""817AD2FA8775",
            "reservationno"123456,
            "pickupdatetime""14-Apr-2022 09:00",
            "dropoffdatetime""20-Apr-2022 14:00",
            "customerfirstname""John",
            "customerlastname""JOHNSON",
            "customeraddress""1 Test St",
            "customercity""Test Town",
            "customerpostcode""4000",
            "customerstate""Queensland",
            "customercountry""Australia",
            "customermobile""0444444444",
            "customerphone""0744444444",
            "customeremail""johnjohnson@test.com",
            "customerlicense""DL123456",
 "customerlicenseissuedby""Queensland",
            "customerdob""01-Jan-0001 00:00",
            "customerpassport""",
            "paymenttoken""",
            "billingcompany""",
            "billingaccountno""",
            "billingaddress""",
            "billingcity""",
            "billingstate""",
            "billingpostcode""",
            "billingphone""",
            "billingemail"""
            "vehiclemake""Toyota",
            "vehiclemodel""Camry",
            "vehicleyear""2008",
            "vehicleregistrationno""RCM123",
            "customerlicenseexpiry""01-Jan-2026 00:00",
        }
    ],
    "ms"662,
    "issues": []
}


Method 2 - Process Infringement

Description

After a successful "Get Trip" response, you should now have enough information to create a Statutory Declaration and/or email the customer.  Note that RCM does not do either of these functions via the API at this time.  In order to pass infringement information back into RCM to record against the booking, optionally add a fee to the booking, and optionally take a payment for that fee...  you will need to call this "Process Infringement" method.  

Prerequisites

You must have called "Get Trip" with the Infringement before calling this method.  If "Get Trip" resulted in any status other than "Trip Found", you will get an error calling this method. 

Request

The following parameters form part of the request:
Parameter NameRequired or OptionalTypeDescriptionSample
methodRequiredstringname of method you are calling.  Must be "processinfringement""processinfringement"
infringementidRequiredstring, max 35 charactersThe unique identifier/number for the infringement.  This should be the exact value that was passed in for the relevant "gettrip" method call.731680172   
reservationno
Required
int
The reservationno that was returned from the "gettrip" method call.
123456
infringementauthority
Required
string, max 60 characters
The name of the authority who issued the infringement
Test Town City Council
declarationdispatchdate
Required
date, format dd/MM/yyyy
The date of dispatch of the infringement notification. This is different from the date of the offence.
20/05/2022
infringementnoticeurl
Optional
string, max 100 characters
Optional - if you have a URL that displays the infringement notification you can pass it in here.  This is added to the notes against the customer's booking.
statutorydeclarationurl
Optional
string, max 100 characters
Optional - if you have a URL that displays the statutory declaration arising from this infringement, you can pass it in here.  This is added to the notes against the customer's booking.
addfeetobooking
Optional
boolean true/false
If "true", RCM will add an infringement processing fee to the customer's booking.  The fee is a set fee as defined through RCM and the value will be the same for each infringement.  If this parameter is not passed in it is assumed "false"  
true
processpayment
Optional
boolean true/false
If "true", RCM will attempt to take a payment for the infringement processing fee.  Only applies if "addfeetobooking" is "true", and the fee was successfully added to the booking.  If this parameter is not passed in it is assumed "false".
true

Sample Request:
{
    "method""processinfringement",
    "infringementid""731680172",
    "reservationno"123456,
    "infringementauthority":"Test Town City Council",
    "declarationdispatchdate":"20/05/2022",
    "infringementnoticeurl""http://thirdpartywebsite.com/infringment/731680172",
    "statutorydeclarationurl""http://thirdpartywebsite.com/statdec/731680172",
    "addfeetobooking":"true",
    "processpayment" : "true"
}

Response

The general response format is described above.  The Results section will contain the following fields:

Field
Type
Description
Sample
feerecorded
boolean true/false
true if the fee was successfully added to the booking.
false could be for any number of reasons
true
paymenttaken
boolean true/false
true if the payment was successfully taken.
false could be for any number of reasons
true
totalpaymentamount
decimal
if paymenttaken = true, this will show the amount of the payment.  In all other scenarios this will have 0 value
50.0000


Sample Response:
{
    "status""OK",
    "error""",
    "results": {
        "feerecorded"true,
        "paymenttaken"true,
        "totalpaymentamount"50.0000
    },
    "ms"1511,
    "issues": []
}



    Important Articles


      • Related Articles

      • Useful API V3.2 Methods

        Overview As well as the methods which are used in the Booking Process, there are other methods which are part of the API V3.2. They are all discussed below. Editing a Booking or Quotation Post-booking methods are available to edit booking details ...
      • API V3.2 Booking Process

        Overview The RCM API and Agent API allow you to make unallocated bookings for a specified vehicle category, for a specified pickup and drop off date. An unallocated booking is a booking that has been made for a particular category (e.g. small car), ...
      • Post Booking API Process

        Overview The RCM Post Booking API allows you to retrieve booking information and also update bookings that already exist within RCM.  The following information cannot be changed on the booking using the Post Booking API: Pickup/drop off locations ...
      • Export API Methods

        Overview Rental Car Manager offers an Export API to export certain datasets. Each of the methods available is discussed below. For detailed information about getting started with connecting to the Export API, see the article Getting Started with ...
      • Getting Started with API V3.2

        Overview Rental Car Manager (RCM) provides a Web API through which you are able to use to build a set of booking steps which you can plug into your website. This API also allows for Agents to have access and search for availability of vehicles and to ...