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 3 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

curl --location 'https://staging-api.autoreturn.net/api-web/api/impound/lookup' \
--header 'Content-Type: application/json' \
--data '{
"regionCode": "IMP-TS",
"impoundStatus": [
"STORED"
],
"vehicleLookupData": {
"makeId": 148,
"modelId": 2307
},
"dateFrom": "2023-01-09T00:00:00",
"dateTo": "2023-01-10T00:00:00",
"start": 0,
"limit": 50
}
'

Note that the limit is very important here, as you could end up returning many vehicles if 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.

 Get detailed vehicle information

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.

 Creating a receipt

curl --location 'https://staging-api.autoreturn.net/api-web/api/impound/createReceipt' \
--header 'Content-Type: application/json' \
--data-raw '{
"vehicleId": 1067632,
"receiptType": "RELEASE",
"releasedTo": {
"firstName": "Joe",
"lastName": "Schmoe",
"address1": "Address",
"address2": "Address2",
"city": "City",
"state": "CA",
"zip": "12345",
"email": "joe@example.com",
"type": "PAID_BY",
"phoneNumber": "5555555555",
"identification": "ABC123",
"identificationType": "US_DL",
"idState": "CA"
},
"receiptMessage": "Example"
}'

From this request you will receive a receipt Id (labeled just id in the response). 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.

 Applying the payment to the receipt

curl --location 'https://staging-api.autoreturn.net/api-web/api/impound/applyPayment' \
--header 'Content-Type: application/json' \
--data '{
"receiptId": 1003947,
"amount": 8634.9800,
"paymentType": "ON_ACCOUNT",
"externalRefNumber": "YOUR_REF",
"impoundContact": {
"contactId": 12330
}
}'

Note the contactId was returned in the previous result. This allows you to reuse the same contact for who the receipt is issued to, and who is paying. Generally only the person the receipt is issued to can retrieve the vehicle from the lot, however this may vary by municipal policy.

Note that once a receipt has been created for a vehicle it must be paid for or voided.

  • No labels