Stefna - Documentation
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

Rental Company Integration

Rental Company integration

For us to integrate with a rental company they need to provide 2 services.

Vehicle lookup

This service is optional.

If you want to do all processing on your end you can skip this service.

Implementation

What we expect back from the service is a unique identifier for the rental agreement.

Then we would use that when registering the payment.

If no agreement is found we would skip the payment register step.

We expect the service to response in a restfull way.

Request

GET https://baseUrl/lookup-vehicle?plate=test123&startOn=2022-09-13T10:48:25

Response

Expected response statuses

Success: 200 Invalid input: 400 Vehicle not found: 404 Rental agreement not found: 404

Example responses:

Success Response

{
    "rentalId": "7f559daf-ac48-4952-9764-5db69cbadbad"
}

Failure Response

{
    "message": "No rental agreement found"
}

Payment notification

This service would provide use with a way to register a payment in your system.

Implementation

We send all information about the payment.

And if you provided a vehicle lookup service we will also include the rentalId.

Request

POST https://baseUrl/lookup-vehicle

{
    "payment": {
        "amount": 1000,
        "currency": "ISK"
    },
    "vehicle": {
        "plate": "test123",
        "rentalId": "7f559daf-ac48-4952-9764-5db69cbadbad",
        "startOn": "2022-09-13T10:48:25"
    },
    "location": {
        "name": "test location"
    }
}

Response

Expected response statuses

Success: 200 Invalid input: 400 Vehicle not found: 404 Rental agreement not found: 404 Failed to process or save payment: 500

Example responses:

Success Response

{
    "transaction": "7853cc4c-9c32-48c4-9e97-cd9b1d6d0129"
}

Failure Response

{
    "message": "Duplicate transaction"
}