Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Fundamentally submitting a payment for an impound vehicle consists of 4 steps:

  1. Finding the correct vehicle

  2. finding its fees/total to the user

  3. Creating the receipt

  4. Creating the payment

Finding the correct vehicle is done by calling the /impound/lookup endpoint with a payload containing either

  1. Partial or full VIN

  2. License plate number & License state

  3. Date + vehicle details

You’ll also need to send along your region code, and the statuses you’re interested in. In this case the status you’re interested in is “STORED”. Here is an example looking for vehicle in the test region of IMP-TS, in the stored status, with a particular license and license state

 Lookup by license and license state code

curl --location 'https://staging-api.autoreturn.net/api-web/api/impound/lookup' \
--header 'Content-Type: application/json' \
--data '{
"regionCode": "IMP-TS",
"impoundStatus": [
"STORED"
],
"vehicleLookupData": {
"license": "KK00001",
"licenseStateCode": "NC"
},
"start": 0,
"limit": 50
}'

Here is an example of looking up by VIN

 Lookup by VIN

curl --location 'https://qa.autoreturn.net/api-web/api/impound/lookup' \
--header 'Content-Type: application/json' \
--data '{
"regionCode": "IMP-TS",
"impoundStatus": [
"STORED"
],
"vehicleLookupData": {
"VIN": "2P4GP2539YR506044"
},
"start": 0,
"limit": 50
}'

Looking up by vehicle details is more complicated, since you need our list of makes, models and colors.

You can get these lists by calling /api-web/api/refdata/{regionCode}/colors
/api-web/api/refdata/{regionCode}/makes

and once you have the make, you can request all models for that make using

/api-web/api/refdata/{regionCode}/models/by-make/{makeCode}

Once the user has selected a value for these they should select a date, then you can send those to us, for example.

 Lookup by vehicle details

Note that the limit is very important here, as you could end up returning many vehicles you allow the user to select something very broad, like all toyotas towed in January.


Once you have the correct vehicle you can then retrieve its fees by its vehicleId.

VehicleId is the unique id for each time a vehicle gets towed. If it gets towed twice, it will get 2 vehicleIds. You then make a request to the /impound endpoint which will get you the complete vehicle details including the fees as of the time of the request.

https://staging-api.autoreturn.net/api-web/api/impound?id=1067632

for example will give a response containing most of the details of the vehicle. In particular you’ll want to look at

  • currentLocation which represents the best way to get into contact with whoever has current possession of the vehicle

  • make.name , model.name , color.name , license , licenseState.code

  • unpaidFeeItems which contains all of the fee items that are not paid yet. If you want the total then you can sum unpaidFeeItems.totalPrice which is the total price of the vehicle, including tax.

  • eligibleForRelease indicates if the vehicle is currently releasable. Holds may prevent release of the vehicle, in which case you probably don’t want to let people pay for it.

Once the user has indicated that they want to pay you must collect contact information from the user, this is used to ensure that the vehicle is released to the correct person later in the process.

You then call the /createReceipt endpoint with the vehicleId and contact details the list of fees you want to pay. If you want to just always pay all of the fees then you can leave that element null or empty.

From this request you will receive a receiptId. This receipt must then be paid. call the /applyPayment endpoint with that receiptId and the details of the payment.

Note that even if a vehicle has been paid for, it might not be releasable if for example it has holds that prevent release.

  • No labels