Fundamentally submitting a payment for an impound vehicle consists of 4 3 steps:
Finding the correct vehicle
finding its fees/total to the user and eligibility for release
Creating the receipt Creating the & payment
Finding the correct vehicle is done by calling the /impound/lookup endpoint with a payload containing either
...
Expand | ||
---|---|---|
| ||
curl --location 'https://qastaging-api.autoreturn.net/api-web/api/impound/lookup' \ |
...
Expand | ||
---|---|---|
|
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.
...
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.
curl --location 'https://staging-api.autoreturn.net/api-web/api/impound |
...
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 vehiclemake.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 sumunpaidFeeItems
.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.
...
/lookup' \ |
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.
Expand | ||
---|---|---|
| ||
|
Once you have the correct vehicle you can then retrieve its fees and total unpaid amount 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.
Expand | ||
---|---|---|
| ||
curl --location '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 vehiclemake.name , model.name , color.name , license , licenseState.code
unpaidFeeItems
which contains all of the fee items that are not paid yet.totalUnpaid
which contains the total unpaid amount for this vehicleeligibleForOnlinePayment
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. The vehicle may also enter other states that would make online payments not apply correctly.
Here is an example of the response
Expand | ||
---|---|---|
| ||
|
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 /createReceiptAndPayment endpoint with the vehicleId, contact details and amount paid.
Note how in the response the vehicle’s status has changed to RELEASE_PENDING. This happens when a vehicle in a releasable state has been fully paid for. Also note the value in vehicle
.releaseAuthorizedThrough
, this is the latest time that the vehicle owner can show up to the yard to retrieve the vehicle before additional fees might be applied.
Expand | ||
---|---|---|
| ||
curl --location 'https://staging-api.autoreturn.net/api-web/api/impound/createReceiptAndPayment' \ --header 'Content-Type: application/json' \ --data-raw '{ "vehicleId": 1067632, "amount": 9181.2200, "paymentType": "CREDIT_CARD", "receiptMessage": "Payment was made online", "creditCardType": "VISA", "authorizationNumber": "string", "checkNumber": "string", "externalRefNumber": "string", "impoundContact": { "firstName": "Joe", "lastName": "Schmoe", "address1": "Address1", "address2": "address2", "city": "City", "state": "CA", "zip": "12345", "identification": "ABC123", "identificationType": "US_DL", "idState": "CA", "email": "joe@example.com", "type": "PAID_BY", "phoneNumber": "5555555555" }, "paymentDate": "2024-02-01T12:15:50" }' |
Expand | ||
---|---|---|
| ||
|