MENU navbar-image

Introduction

This documentation aims to provide all the information you need to work with our API.

Authenticating requests

This API is not authenticated.

3rd Party

This endpoint registers a new tap card and links it to an existing vehicle. The vehicle registration number must already exist in the system.

Charge Vehicle Registration via Wallet This endpoint activates a unified revenue-collection workflow by initiating a wallet deduction for vehicle registration. The service intelligently resolves a vehicle using multiple identity vectors — registration number, tag number, or tap card — ensuring seamless interoperability with tolling, access control, and roadside verification ecosystems. The engine automatically validates identity consistency, enforces anti-replay safeguards (no repeat transactions within 60 seconds), and triggers exception-handling pathways (e.g., stolen or lost vehicle workflows).

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/api/wallet/vehicle/transact" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABE1234\",
    \"tag_number\": \"12345678\",
    \"cardnumber\": \"9900112233\",
    \"plaza_name\": \"Mupfurudzi\",
    \"gate\": 1,
    \"cashier\": 7,
    \"zinara_ref\": \"ZTS14042025000020v20\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/api/wallet/vehicle/transact"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABE1234",
    "tag_number": "12345678",
    "cardnumber": "9900112233",
    "plaza_name": "Mupfurudzi",
    "gate": 1,
    "cashier": 7,
    "zinara_ref": "ZTS14042025000020v20"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "message": "Payment successful"
}
 

Example response (400):


{
    "error": "Either registration number or tag number is required"
}
 

Example response (402):


{
    "error": "Insufficient balance in all wallets"
}
 

Example response (404):


{
    "error": "Vehicle not found"
}
 

Example response (404):


{
    "error": "Vehicle not found by registration number"
}
 

Example response (404):


{
    "error": "Vehicle not found by tag number"
}
 

Example response (404):


{
    "error": "TapCard not found"
}
 

Example response (409):


{
    "error": "Can not process same transaction within a minute",
    "reg_number": "ABC1234"
}
 

Example response (422):


{
    "error": "Tag and registration number do not match the same vehicle"
}
 

Example response (423):


{
    "reg_number": "ABC1234"
}
 

Request      

POST api/wallet/vehicle/transact

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string  optional  

The vehicle registration number. Example: ABE1234

tag_number   string  optional  

The RFID tag number mapped to the vehicle. Example: 12345678

cardnumber   string  optional  

The TapCard number used by the customer. Example: 9900112233

plaza_name   string  optional  

The name of the tolling plaza initiating the transaction. Example: Mupfurudzi

gate   integer  optional  

The ID of the gate used for the transaction. Example: 1

cashier   integer  optional  

The cashier or operator ID initiating the request. Example: 7

zinara_ref   string  optional  

The external Zinara transaction reference. Example: ZTS14042025000020v20

Get Customer Wallets via Vehicle Info This endpoint retrieves all wallets belonging to the customer associated with a specific vehicle. You can provide either the vehicle's registration number or the assigned tag number.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/api/vehicle/wallets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABE1234\",
    \"tag_number\": \"ZIN12345678\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/api/vehicle/wallets"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABE1234",
    "tag_number": "ZIN12345678"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "wallets": [
        {
            "id": 1,
            "balance": 100,
            "priority": 1,
            "currency": {
                "id": 1,
                "name": "USD",
                "symbol": "$"
            }
        },
        {
            "id": 2,
            "balance": 50,
            "priority": 0,
            "currency": {
                "id": 2,
                "name": "ZWL",
                "symbol": "Z$"
            }
        }
    ]
}
 

Example response (404):


{
    "error": "Vehicle or customer not found"
}
 

Request      

POST api/vehicle/wallets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string  optional  

The vehicle's registration number. Optional if tag_number is provided. Example: ABE1234

tag_number   string  optional  

The tag number assigned to the vehicle. Optional if reg_number is provided. Example: ZIN12345678

Get All Vehicles with Associated Customer Wallets Returns all vehicles in the system along with their associated customer's wallets and currency details.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/api/vehicle/wallets/all" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/api/vehicle/wallets/all"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "vehicle": {
            "id": 1,
            "reg_number": "ABE1234",
            "make": "Toyota"
        },
        "wallets": [
            {
                "id": 1,
                "balance": 100,
                "priority": 1,
                "currency": {
                    "name": "USD",
                    "symbol": "$"
                }
            }
        ]
    }
]
 

Request      

POST api/vehicle/wallets/all

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get Transaction by BUSE Reference This endpoint retrieves a transaction using the provided BUSE reference number (`buse_ref`).

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/api/ref/transaction?buse_ref=BUSE20250413456789" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"buse_ref\": \"fuga\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/api/ref/transaction"
);

const params = {
    "buse_ref": "BUSE20250413456789",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "buse_ref": "fuga"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "transaction": {
        "id": 21,
        "buse_ref": "BUSE20250413456789",
        "amount": 5,
        "currency": {
            "id": 1,
            "name": "USD",
            "symbol": "$"
        },
        "vehicle": {
            "id": 3,
            "reg_number": "ABE1234"
        },
        "toll_gate": {
            "id": 2,
            "name": "Norton Toll Gate"
        },
        "tolling_station": {
            "id": 1,
            "name": "Harare South Station"
        }
    }
}
 

Example response (404):


{
    "error": "Transaction not found"
}
 

Request      

POST api/ref/transaction

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

buse_ref   string   

The BUSE reference number of the transaction. Example: BUSE20250413456789

Body Parameters

buse_ref   string   

Example: fuga

Assign an RFID tag to a vehicle.

Assigns an RFID tag to a registered vehicle if it doesn't already have an active tag assignment and no pending tag application. If all conditions are met, a tag application is created and immediately approved, then the tag is assigned to the vehicle.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/api/vehicle/tag/add" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABC123\",
    \"tag_number\": \"TAG987654\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/api/vehicle/tag/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABC123",
    "tag_number": "TAG987654"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Tag assigned."
}
 

Example response (203):


{
    "message": "Vehicle already has a valid tag assignment, deactivate and reassign."
}
 

Example response (400):


{
    "message": "Vehicle not found."
}
 

Example response (409):


{
    "message": "A pending tag application already exists for this vehicle."
}
 

Request      

POST api/vehicle/tag/add

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle. Example: ABC123

tag_number   string   

The RFID tag number to assign. Example: TAG987654

Store a newly created tap card in the system.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/api/vehicle/tapcard/add" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ADG1234\",
    \"owner\": \"John Dube\",
    \"cardnumber\": \"00019284756\",
    \"active\": true
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/api/vehicle/tapcard/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ADG1234",
    "owner": "John Dube",
    "cardnumber": "00019284756",
    "active": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Saved."
}
 

Example response (400):


{
    "message": "Vehicle not found."
}
 

Example response (409):


{
    "message": "Duplicate card."
}
 

Request      

POST api/vehicle/tapcard/add

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle. Example: ADG1234

owner   string   

The name of the card owner. Example: John Dube

cardnumber   string   

The unique tap card number. Example: 00019284756

active   boolean   

Indicates whether the card is active. Example: true

Deactivate Tap Card

This endpoint operationalizes the deactivation lifecycle for a vehicle-linked tap card. It drives a streamlined workflow where the system cross-references a vehicle’s registration metadata, resolves ownership, and pivots the associated TapCard entity into an inactive state.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/api/vehicle/tag/deactivate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"esse\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/api/vehicle/tag/deactivate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "esse"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "TapCard deactivated"
}
 

Example response (400):


{
    "message": "Vehicle not found."
}
 

Example response (404):


{
    "message": "TapCard not found."
}
 

Request      

POST api/vehicle/tag/deactivate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registered vehicle number (e.g. "ACB1234"). This field orchestrates the lookup to identify the corresponding customer asset. Example: esse

Admin

Authenticate an Admin user. This endpoint allows an admin to log in using their email and password. If the credentials are correct, and the user is verified, their details are returned. Otherwise, appropriate error responses are sent.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/auth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"customer@example.com\",
    \"password\": \"password123\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/auth"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "customer@example.com",
    "password": "password123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "John Doe",
    "email": "admin@example.com",
    "verified": 1,
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
}
 

Example response (203):


{
    "message": "failed"
}
 

Example response (403):


{
    "message": "unverified"
}
 

Request      

POST admin/auth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The customer's email address. Example: customer@example.com

password   string   

The customer's password. Example: password123

Verify OTP for Admin Login This endpoint verifies the One-Time Password (OTP) provided by the admin. The OTP is retrieved from the cache and validated.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/otp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"admin_id\": 123,
    \"otp\": 654321
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/otp"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "admin_id": 123,
    "otp": 654321
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "OTP verified successfully"
}
 

Example response (401):


{
    "message": "Invalid or expired OTP"
}
 

Request      

POST admin/otp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

admin_id   integer   

The ID of the customer. Example: 123

otp   integer   

The OTP sent to the customer's email. Example: 654321

Reset Admin Password This endpoint generates a new strong password for the customer and sends it via email. The customer is advised to change this password after logging in.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/password/reset" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"user@example.com\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/password/reset"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "user@example.com"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "A new password has been sent to your email."
}
 

Example response (404):


{
    "message": "Email not found."
}
 

Request      

GET admin/password/reset

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email address of the customer. Example: user@example.com

Change Admin Password Allows an authenticated customer to change their password. Sends an email notification confirming the password change.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/password/change" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"old_password\": \"oldP@ssw0rd\",
    \"new_password\": \"N3wP@ssw0rd!\",
    \"confirm_password\": \"N3wP@ssw0rd!\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/password/change"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "old_password": "oldP@ssw0rd",
    "new_password": "N3wP@ssw0rd!",
    "confirm_password": "N3wP@ssw0rd!"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Password changed successfully."
}
 

Example response (203):


{
    "message": "Unauthenticated."
}
 

Example response (401):


{
    "message": "Current password is incorrect."
}
 

Request      

POST admin/password/change

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

old_password   string   

The current password. Example: oldP@ssw0rd

new_password   string   

The new password. Example: N3wP@ssw0rd!

confirm_password   string   

Must match the new password. Example: N3wP@ssw0rd!

Store a new admin record in the database. This function allows the creation of a new admin by accepting and validating input data. The created record will include personal details, contact information, and login credentials. All fields are assigned to the model's `$fillable` property to ensure proper mass assignment.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fname\": \"\\\"John\\\"\",
    \"mname\": \"\\\"David\\\"\",
    \"surname\": \"\\\"Doe\\\"\",
    \"address\": \"\\\"123 Main Street, Harare\\\"\",
    \"phone\": \"\\\"+263772123456\\\"\",
    \"email\": \"\\\"johndoe@example.com\\\"\",
    \"password\": \"\\\"SecurePassword123\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fname": "\"John\"",
    "mname": "\"David\"",
    "surname": "\"Doe\"",
    "address": "\"123 Main Street, Harare\"",
    "phone": "\"+263772123456\"",
    "email": "\"johndoe@example.com\"",
    "password": "\"SecurePassword123\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{"message": "saved"} Indicates that the admin record was successfully created.
 

Request      

POST admin

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

fname   string   

The first name of the admin. Example: "John"

mname   string  optional  

optional The middle name of the admin. Example: "David"

surname   string   

The surname of the admin. Example: "Doe"

address   string   

The physical address of the admin. Example: "123 Main Street, Harare"

phone   string   

The phone number of the admin. Example: "+263772123456"

email   string   

The email address of the admin. Example: "johndoe@example.com"

password   string   

The password for the admin account (will be hashed). Example: "SecurePassword123"

Retrieve paginated vehicles. This endpoint allows an authenticated admin to retrieve vehicles in groups of 100. If the `last_id` parameter is provided, it fetches the next 100 vehicles after that ID. If not provided, it returns the first 100 vehicles.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/vehicles?last_id=50" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/vehicles"
);

const params = {
    "last_id": "50",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": [
      {
          "id": 1,
          "reg_number": "ABC1234",
          "color": "Blue",
          "make": "Toyota",
          "model": "Corolla",
          "class": "Sedan",
          ...
      },
      ...
  ],
  "pagination": {
      "last_id": 100,
      "has_more": true
  }
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

GET admin/vehicles

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

last_id   integer  optional  

The ID of the last vehicle in the previous batch. Example: 50

Retrieve the registration book of a vehicle.

requires authentication

This endpoint allows an authenticated admin to retrieve the registration book of a vehicle using its ID.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/vehicle/regbook" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"vehicle\": 10
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/vehicle/regbook"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "vehicle": 10
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "reg_book": "j842h4u2io529n442"
}
 

Example response (203):


{
    "message": "Not authenticated."
}
 

Request      

GET admin/vehicle/regbook

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

vehicle   integer   

The ID of the vehicle. Example: 10

Find a vehicle by registration number. This endpoint allows an authenticated admin to retrieve a vehicle's details by its registration number.

requires authentication

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/vehicle/find" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"\\\"ABC1234\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/vehicle/find"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "\"ABC1234\""
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "reg_number": "ABC1234",
    "color": "Blue",
    "make": "Toyota",
    "model": "Corolla",
    "class": "Sedan",
    "reg_book": "path/to/file.pdf",
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

GET admin/vehicle/find

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle to find. Example: "ABC1234"

Approve a tag application. This endpoint allows an authenticated admin to approve a tag application. Upon approval, the status of the application is updated, and an email is sent to the customer notifying them of the approval of their tag application.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/application/approve" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bbq\": 123,
    \"reg_number\": \"ABC1234\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/application/approve"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bbq": 123,
    "reg_number": "ABC1234"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "approved"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

POST admin/application/approve

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

bbq   integer   

The ID of the tag application to approve. Example: 123

reg_number   string   

The registration number of the vehicle associated with the tag application. Example: ABC1234

Decline a tag application. This endpoint allows an authenticated admin to decline a tag application. Upon declining, the status of the application is updated, and an email is sent to the customer notifying them of the decline of their tag application.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/application/decline" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bbq\": 123,
    \"reg_number\": \"ABC1234\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/application/decline"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bbq": 123,
    "reg_number": "ABC1234"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "approved"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

POST admin/application/decline

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

bbq   integer   

The ID of the tag application to approve. Example: 123

reg_number   string   

The registration number of the vehicle associated with the tag application. Example: ABC1234

Find a tag application by vehicle registration number. This endpoint allows an authenticated admin to retrieve the details of a tag application associated with a specific vehicle registration number.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/application/find" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABC1234\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/application/find"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABC1234"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "reg_number": "ABC1234",
    "status": 1,
    "declined": 0,
    "created_at": "2025-01-25T12:34:56.000000Z",
    "updated_at": "2025-01-25T12:34:56.000000Z"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

POST admin/application/find

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle whose tag application is being searched. Example: ABC1234

Store a new tag. This endpoint allows an authenticated admin to create a new tag entry in the system. The request should include the tag number and serial of the tag.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/tag" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"tag_number\": \"\\\"TAG12345\\\"\",
    \"serial\": \"\\\"SN123456789\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/tag"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "tag_number": "\"TAG12345\"",
    "serial": "\"SN123456789\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Example response (203):


{
    "message": "unauthenticated"
}
 

Request      

POST admin/tag

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

tag_number   string   

The unique identifier for the tag. Example: "TAG12345"

serial   string   

The serial number of the tag. Example: "SN123456789"

Get all tags. This endpoint retrieves a list of all tags in the system. Only accessible to authenticated admins.

requires authentication

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/tags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/tags"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Tag A",
        "status": "active",
        "created_at": "2025-01-28T10:30:00.000000Z",
        "updated_at": "2025-01-28T10:30:00.000000Z"
    },
    {
        "id": 2,
        "name": "Tag B",
        "status": "inactive",
        "created_at": "2025-01-27T12:00:00.000000Z",
        "updated_at": "2025-01-27T12:00:00.000000Z"
    }
]
 

Example response (203):


{
    "message": "unauthenticated"
}
 

Request      

GET admin/tags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Assigns a tag to a vehicle after the tag application has been approved. This function is used to assign a tag to a vehicle once the tag application has been approved. The function performs the following steps: 1. Authenticates the admin user. 2. Fetches the most recent tag application based on the provided registration number. 3. Updates the status of the application to indicate that it has been approved. 4. Creates a new tag if it doesn't exist already, or fetches an existing tag. 5. Creates a tag assignment that links the vehicle, tag, and application.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/assignappliedtag" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"incidunt\",
    \"tag_number\": \"sint\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/assignappliedtag"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "incidunt",
    "tag_number": "sint"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "tag assigned"
}
 

Example response (203):


{"message": "no authenticated"} Unauthorized if the admin is not authenticated.
 

Example response (403):


{"message": "no authorized"} Forbidden if the application doesn't exist or the vehicle cannot be found.
 

Example response (409):


{"message": "tag already assigned another vehicle"} Forbidden if the application
 

Request      

POST admin/assignappliedtag

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The vehicle's registration number. Example: incidunt

tag_number   string   

The tag number to be assigned. Example: sint

Get Count of Pending Applications

This endpoint retrieves the count of pending applications where the status is 0 (indicating pending), and the application has not been declined. If the admin is not authenticated, an error message is returned.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/pendingapplications/count" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/pendingapplications/count"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
   15
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

GET admin/pendingapplications/count

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get Paginated Admin Logs

requires authentication

This endpoint retrieves the activity logs of the authenticated admin or another specified admin. It expects an admin_id parameter to fetch logs for a different admin. It also expects a last_id parameter to fetch logs in batches of 20. If last_id is 0, it fetches the first 20 logs.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/audits?admin_id=2&last_id=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/audits"
);

const params = {
    "admin_id": "2",
    "last_id": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "logs": [
        {
            "id": 201,
            "admin": 2,
            "action": "Deactivated a customer account",
            "created_at": "2024-03-11 10:15:30",
            "updated_at": "2024-03-11 10:15:30"
        },
        {
            "id": 200,
            "admin": 2,
            "action": "Updated system settings",
            "created_at": "2024-03-11 11:00:00",
            "updated_at": "2024-03-11 11:00:00"
        }
    ],
    "last_id": 200
}
 

Example response (203):


{
    "message": "Unauthenticated"
}
 

Request      

POST admin/audits

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

admin_id   integer  optional  

The ID of the admin whose logs should be retrieved. If not provided, the authenticated admin's logs will be fetched. Example: 2

last_id   integer   

The ID of the last log entry from the previous request. Use 0 to fetch the first batch. Example: 0

Get Paginated Customer Logs (Admin Access)

requires authentication

This endpoint allows an authenticated admin to retrieve the activity logs of a specified customer. It supports pagination using the last_id parameter, fetching logs in batches of 20.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/customer/audits?client=5&last_id=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/audits"
);

const params = {
    "client": "5",
    "last_id": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "logs": [
        {
            "id": 105,
            "customer": 5,
            "action": "Logged in",
            "created_at": "2024-03-11 10:15:30",
            "updated_at": "2024-03-11 10:15:30"
        },
        {
            "id": 104,
            "customer": 5,
            "action": "Updated profile information",
            "created_at": "2024-03-11 11:00:00",
            "updated_at": "2024-03-11 11:00:00"
        }
    ],
    "last_id": 104
}
 

Example response (203):


{
    "message": "Unauthenticated"
}
 

Request      

POST admin/customer/audits

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

client   integer   

The ID of the customer whose logs should be retrieved. Example: 5

last_id   integer  optional  

The ID of the last log entry from the previous request. Use 0 to fetch the first batch. Default: 0 Example: 0

Retrieve paginated customers. This endpoint allows an authenticated admin to retrieve customers in groups of 100. If the `last_id` parameter is provided, it fetches the next 100 customers after that ID. If not provided, it returns the first 100 customers.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/customer?last_id=100&verified=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer"
);

const params = {
    "last_id": "100",
    "verified": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "data": [
      {
          "id": 1,
          "fname": "John",
          "mname": "Doe",
          "surname": "Smith",
          "email": "john@example.com",
          ...
      },
      ...
  ],
  "pagination": {
      "last_id": 100,
      "has_more": true
  }
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

GET admin/customer

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

last_id   integer  optional  

The ID of the last customer in the previous batch. Example: 100

verified   boolean  optional  

The account status . Example: true

Get transactions for the authenticated admin. This endpoint allows an authenticated admin to retrieve transactions related to vehicles and their associated information. The results are paginated based on the last transaction ID.

requires authentication

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/transactions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"last_id\": 100
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/transactions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "last_id": 100
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
  "data": [
    {
      "id": 1,
      "vehicle": {
        "id": 123,
        "reg_number": "ABC-1234",
        "vihicleClass": {
          "price": 150
        }
      },
      "currency": {
        "name": "USD"
      },
      "amount": 100
    },
    ...
  ],
  "pagination": {
    "last_id": 150,
    "has_more": true
  }
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

GET admin/transactions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

last_id   integer  optional  

The last transaction ID to fetch the next set of transactions. Example: 100

Create a new Gate for a Toll Station.

requires authentication

This endpoint allows an authenticated admin to create a new gate for a specific toll station.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/gate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"Gate 1\",
    \"gate\": \"G01\",
    \"toll_station\": 10
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/gate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "Gate 1",
    "gate": "G01",
    "toll_station": 10
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Gate created successfully"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (404):


{
    "message": "TollStation not found"
}
 

Request      

POST gate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the gate. Example: Gate 1

gate   string   

The gate number or identifier. Example: G01

toll_station   integer   

The ID of the toll station where the gate will be assigned. Example: 10

Admin Management

Verify and Activate Customer Account This endpoint allows an authenticated admin to verify and activate a customer's account. Once verified, an email notification is sent to the customer confirming activation.

requires authentication

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/activate?customer=123" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fname\": \"John\",
    \"email\": \"john.doe@example.com\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/activate"
);

const params = {
    "customer": "123",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fname": "John",
    "email": "john.doe@example.com"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "verified"
}
 

Example response (203):


{
    "message": "unauthenticated"
}
 

Request      

GET customer/activate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

customer   integer   

The ID of the customer to be verified. Example: 123

Body Parameters

fname   string   

The first name of the customer. Example: John

email   string   

The email address of the customer. Example: john.doe@example.com

Create a new customer account.

requires authentication

This endpoint allows an authenticated admin to create a new customer account. The request must include the required customer details, and the password will be securely hashed before storage.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/customer" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fname\": \"John\",
    \"mname\": \"Michael\",
    \"surname\": \"Doe\",
    \"male\": true,
    \"national_id\": \"12-3456789Z-12\",
    \"address\": \"123 Example Street, City\",
    \"phone\": \"+263712345678\",
    \"email\": \"johndoe@example.com\",
    \"id_file\": \"ea\",
    \"password\": \"secret123\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fname": "John",
    "mname": "Michael",
    "surname": "Doe",
    "male": true,
    "national_id": "12-3456789Z-12",
    "address": "123 Example Street, City",
    "phone": "+263712345678",
    "email": "johndoe@example.com",
    "id_file": "ea",
    "password": "secret123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

POST admin/customer

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

fname   string   

The first name of the customer. Example: John

mname   string  optional  

The middle name of the customer. Example: Michael

surname   string   

The surname of the customer. Example: Doe

male   boolean   

Indicates if the customer is male (true) or female (false). Example: true

national_id   string   

The national ID of the customer. Example: 12-3456789Z-12

address   string   

The residential address of the customer. Example: 123 Example Street, City

phone   string   

The phone number of the customer. Example: +263712345678

email   string   

The email address of the customer. Example: johndoe@example.com

id_file   string  optional  

base64 encoded customer_id image or document Example: ea

password   string   

The password for the customer account. Example: secret123

Add a new vehicle to the system.

requires authentication

This endpoint allows an authenticated admin to register a new vehicle for an existing customer. If the vehicle registration number already exists, an error response is returned.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/customer/vehicle" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABC-1234\",
    \"reg_book\": \"RB123456789\",
    \"customer\": 10
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/vehicle"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABC-1234",
    "reg_book": "RB123456789",
    "customer": 10
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
  "message": "saved"-*
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Example response (403):


{
    "message": "Vehicle exists, contact admin"
}
 

Example response (403):


{
    "message": "Customer exists, contact admin"
}
 

Request      

POST admin/customer/vehicle

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The vehicle's registration number. Example: ABC-1234

reg_book   string   

The registration book reference for the vehicle. Example: RB123456789

customer   integer   

The ID of the customer to whom the vehicle belongs. Example: 10

Add a new wallet for a customer.

requires authentication

This endpoint allows an authenticated admin to create a new wallet for an existing customer. A customer cannot have multiple wallets with the same currency.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/customer/wallet" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 10,
    \"currency\": \"USD\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/wallet"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 10,
    "currency": "USD"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Wallet Created"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (403):


{
    "message": "Wallet exists"
}
 

Request      

POST admin/customer/wallet

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer who owns the wallet. Example: 10

currency   string   

The currency of the wallet. Example: USD

Retrieve a customer's wallets.

requires authentication

This endpoint allows an authenticated admin to fetch all wallets associated with a specific customer.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/customer/wallets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 10
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/wallets"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 10
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "currency": "USD",
        "balance": 150.75
    },
    {
        "id": 2,
        "currency": "EUR",
        "balance": 75.5
    }
]
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (404):


{
    "message": "No wallets found"
}
 

Request      

GET admin/customer/wallets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer whose wallets are being retrieved. Example: 10

Recharge a customer's wallet.

requires authentication

This endpoint allows an authenticated admin to update the balance of a customer's wallet.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/customer/wallet/recharge" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 10,
    \"wallet\": 5,
    \"amount\": \"100.50\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/wallet/recharge"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 10,
    "wallet": 5,
    "amount": "100.50"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Wallet balance updated"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (404):


{
    "message": "Wallet not found"
}
 

Request      

POST admin/customer/wallet/recharge

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer whose wallet is being recharged. Example: 10

wallet   integer   

The ID of the wallet to be recharged. Example: 5

amount   numeric   

The amount to set as the new wallet balance. Example: 100.50

Retrieve a customer's vehicles.

requires authentication

This endpoint allows an authenticated admin to retrieve all vehicles belonging to a specific customer. Each vehicle record includes related tag assignment details.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/customer/vehicles" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 10
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/vehicles"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 10
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "vehicles": [
        {
            "id": 1,
            "reg_number": "ABC-1234",
            "color": "Red",
            "make": "Toyota",
            "model": "Corolla",
            "class": "Sedan",
            "reg_book": "RB123456789",
            "customer": 10,
            "tagassignment": {
                "tag": {
                    "id": 5,
                    "serial_number": "TAG-98765"
                }
            }
        }
    ]
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

GET admin/customer/vehicles

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer whose vehicles are being retrieved. Example: 10

Retrieve a specific vehicle for a customer.

requires authentication

This endpoint allows an authenticated admin to fetch details of a specific vehicle belonging to a customer by providing the customer ID and vehicle registration number.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/customer/vehicle" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 10,
    \"reg_number\": \"\\\"ABC-1234\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/vehicle"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 10,
    "reg_number": "\"ABC-1234\""
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
  "id": 1,
  "reg_number": "ABC-1234",
  "color": "Red",
  "make": "Toyota",
  "model": "Corolla",
  "class": "Sedan",
  "reg_book": "RB123456789",
  "customer": 10,
      "tagassignment": {
        "tag": {
          "id": 5,
          "tag_number": "TAG-98765"
        }
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (404):


{
    "message": "Vehicle not found"
}
 

Request      

GET admin/customer/vehicle

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer who owns the vehicle. Example: 10

reg_number   string   

The registration number of the vehicle to retrieve. Example: "ABC-1234"

Retrieve full customer details, including wallets and vehicles.

requires authentication

This endpoint allows an authenticated admin to fetch a customer's details, including their wallets and registered vehicles.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/customer/full" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 10
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/customer/full"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 10
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "customer": {
        "id": 10,
        "fname": "John",
        "mname": "Doe",
        "surname": "Smith",
        "email": "john.doe@example.com",
        "wallets": [
            {
                "id": 1,
                "currency": "USD",
                "balance": 100.5
            }
        ]
    },
    "vehicles": [
        {
            "id": 5,
            "reg_number": "ABC-1234",
            "color": "Red",
            "make": "Toyota",
            "model": "Corolla",
            "vihicleClass": {
                "id": 2,
                "class_name": "Sedan"
            },
            "tagassignment": {
                "id": 3,
                "tag": {
                    "id": 7,
                    "tag_number": "TAG-9876"
                }
            }
        }
    ]
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (404):


{
    "message": "Customer not found"
}
 

Request      

GET admin/customer/full

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer whose details are being retrieved. Example: 10

Set the priority wallet for a customer.

requires authentication

This endpoint allows an admin to set a specific wallet as the priority wallet for a given customer. Only one wallet can have priority at a time, so all other wallets for the customer will be reset.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/wallet/priority" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 12,
    \"wallet\": 45
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/wallet/priority"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 12,
    "wallet": 45
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Priority Wallet Updated"
}
 

Example response (203):


{
    "message": "unauthorized"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (400):


{
    "message": "Customer not found."
}
 

Request      

POST admin/wallet/priority

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer. Example: 12

wallet   integer   

The ID of the wallet to set as priority. Example: 45

Get all Gates for a specific Toll Station.

requires authentication

This endpoint retrieves all the gates associated with a specific toll station.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/gates" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"toll_station\": 10
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/gates"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "toll_station": 10
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Gate 1",
        "gate": "G01",
        "toll_station": 10,
        "created_at": "2025-02-14T12:00:00",
        "updated_at": "2025-02-14T12:00:00"
    },
    {
        "id": 2,
        "name": "Gate 2",
        "gate": "G02",
        "toll_station": 10,
        "created_at": "2025-02-14T12:00:00",
        "updated_at": "2025-02-14T12:00:00"
    }
]
 

Example response (403):


{
    "message": "Unauthorized"
}
 

Request      

GET gates

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

toll_station   integer   

The ID of the toll station to fetch the gates for. Example: 10

Chatbot API

Intelligent chatbot response system. This endpoint allows users to interact with a chatbot for common inquiries related to account management, vehicle registration, wallet recharge, and toll fees.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/chat" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"query\": \"\\\"add vehicle\\\"\",
    \"user_id\": 12345
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/chat"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "query": "\"add vehicle\"",
    "user_id": 12345
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "response": "You can add a vehicle to your account by logging in and navigating to the 'Vehicles' section."
}
 

Example response (400):


{
    "status": "error",
    "message": "Invalid input. Please provide a valid query."
}
 

Request      

POST customer/chat

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

query   string   

The user's query. Example: "add vehicle"

user_id   integer  optional  

nullable The ID of the user for personalized responses. Example: 12345

Currency

Store a new currency. This endpoint allows an authenticated admin to create a new currency entry in the system. The request should include the currency's name and symbol.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/currency" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"name\": \"\\\"US Dollar\\\"\",
    \"symbol\": \"\\\"$\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/currency"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "name": "\"US Dollar\"",
    "symbol": "\"$\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Example response (203):


{
    "message": "unauthenticated"
}
 

Request      

POST admin/currency

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

name   string   

The name of the currency, e.g., "US Dollar". Example: "US Dollar"

symbol   string   

The symbol of the currency, e.g., "$". Example: "$"

Retrieve all available currencies. This endpoint fetches a list of all available currencies in the system.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/currencies" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/currencies"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "US Dollar",
        "code": "USD",
        "symbol": "$",
        "created_at": "2025-01-25T12:00:00.000000Z",
        "updated_at": "2025-01-25T12:00:00.000000Z"
    },
    {
        "id": 2,
        "name": "Euro",
        "code": "EUR",
        "symbol": "€",
        "created_at": "2025-01-25T12:05:00.000000Z",
        "updated_at": "2025-01-25T12:05:00.000000Z"
    }
]
 

Request      

GET admin/currencies

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get active exchange rates. This endpoint retrieves all currencies with their active exchange rates. It ensures that only one exchange rate is active at a time and filters out inactive ones.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/currency/exchangerates" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/currency/exchangerates"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "currencies": [
    {
      "currency": "USD",
      "exchange_rate": {
        "rate": 1.2,
        "active": true
      }
    },
    ...
  ]
}
 

Request      

GET currency/exchangerates

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Customer

This endpoint allows a customer to activate their account via a unique activation link.

Activate customer account using self-activation link.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/activate/self" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/activate/self"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "verified"
}
 

Example response (404):


{
    "message": "invalid link"
}
 

Request      

GET customer/activate/self

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

URL Parameters

pbq   string   

The encoded customer ID (base64 triple encoded). Example: repudiandae

Authenticate a customer user. This endpoint allows a customer to log in using their email and password. If the credentials are correct, and the user is verified, their details are returned. Otherwise, appropriate error responses are sent.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/auth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"customer@example.com\",
    \"password\": \"password123\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/auth"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "customer@example.com",
    "password": "password123"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "John Doe",
    "email": "customer@example.com",
    "verified": 1,
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-01T00:00:00.000000Z"
}
 

Example response (203):


{
    "message": "failed"
}
 

Example response (403):


{
    "message": "unverified"
}
 

Request      

POST customer/auth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The customer's email address. Example: customer@example.com

password   string   

The customer's password. Example: password123

Verify OTP for Customer Login This endpoint verifies the One-Time Password (OTP) provided by the customer. The OTP is retrieved from the cache and validated.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/otp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer_id\": 123,
    \"otp\": 654321
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/otp"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer_id": 123,
    "otp": 654321
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "OTP verified successfully"
}
 

Example response (401):


{
    "message": "Invalid or expired OTP"
}
 

Request      

POST customer/otp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer_id   integer   

The ID of the customer. Example: 123

otp   integer   

The OTP sent to the customer's email. Example: 654321

Create a new customer. This endpoint allows the creation of a new customer by providing their personal details. If the operation is successful, a success message is returned.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer" \
    --header "Content-Type: multipart/form-data" \
    --header "Accept: application/json" \
    --form "fname=John"\
    --form "mname=Michael"\
    --form "surname=Doe"\
    --form "male=1"\
    --form "national_id=63-123456X78"\
    --form "address=123 Main Street, Harare"\
    --form "phone=+263771234567"\
    --form "email=customer@example.com"\
    --form "password=password123"\
    --form "id_file=@C:\Users\leoha\AppData\Local\Temp\phpDBCC.tmp" 
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer"
);

const headers = {
    "Content-Type": "multipart/form-data",
    "Accept": "application/json",
};

const body = new FormData();
body.append('fname', 'John');
body.append('mname', 'Michael');
body.append('surname', 'Doe');
body.append('male', '1');
body.append('national_id', '63-123456X78');
body.append('address', '123 Main Street, Harare');
body.append('phone', '+263771234567');
body.append('email', 'customer@example.com');
body.append('password', 'password123');
body.append('id_file', document.querySelector('input[name="id_file"]').files[0]);

fetch(url, {
    method: "POST",
    headers,
    body,
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Request      

POST customer

Headers

Content-Type      

Example: multipart/form-data

Accept      

Example: application/json

Body Parameters

fname   string   

The customer's first name. Example: John

mname   string  optional  

The customer's middle name. Example: Michael

surname   string   

The customer's surname. Example: Doe

male   integer   

The customer's gender. Use 1 for male and 0 for female. Example: 1

national_id   string   

The customer's national ID number. Example: 63-123456X78

address   string   

The customer's physical address. Example: 123 Main Street, Harare

phone   string   

The customer's phone number. Example: +263771234567

email   string   

The customer's email address. Example: customer@example.com

id_file   file   

A file representing the customer's identification document. Example: C:\Users\leoha\AppData\Local\Temp\phpDBCC.tmp

password   string   

The customer's account password. Example: password123

Add a new vehicle. This endpoint allows an authenticated customer to add a new vehicle to their account. If the vehicle registration number already exists in the system, the request is rejected.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/addvehicle" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"\\\"ABC-1234\\\"\",
    \"reg_book\": \"\\\"RB-56789\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/addvehicle"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "\"ABC-1234\"",
    "reg_book": "\"RB-56789\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Example response (403):


{
    "message": "Vehicle exists, contact admin"
}
 

Request      

POST customer/addvehicle

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle. Example: "ABC-1234"

reg_book   string   

The registration book number. Example: "RB-56789"

Apply for a vehicle tag. This endpoint allows an authenticated customer to apply for a tag for a specified vehicle by providing the vehicle's registration number. If the vehicle does not belong to the authenticated customer, the request is rejected. Additionally, duplicate applications with a pending status are not allowed.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/apply" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABC-1234\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/apply"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABC-1234"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "applied"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (403):


{
    "message": "You do not have a vehicle with the provided reg number."
}
 

Example response (409):


{
    "message": "A pending tag application already exists for this vehicle."
}
 

Request      

POST customer/apply

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The vehicle's registration number for which the tag is being applied. Example: ABC-1234

Add a new wallet for the authenticated customer. This endpoint allows an authenticated customer to create a new wallet associated with their account. If a wallet with the specified currency already exists for the customer, the request is rejected.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/wallet" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"currency\": 1
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/wallet"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "currency": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Wallet Created"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Example response (403):


{
    "message": "Wallet exists"
}
 

Request      

POST customer/wallet

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

currency   integer   

The ID of the currency type for the wallet. Example: 1

Set Priority Wallet for Logged-In Customer This endpoint allows a customer to set one of their wallets as the priority wallet. It first resets all wallet priorities to 0, then sets the selected wallet to 1.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/wallet/priority" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"wallet\": 12
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/wallet/priority"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "wallet": 12
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Priority Wallet Updated"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

POST customer/wallet/priority

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

wallet   integer   

The ID of the wallet to set as priority. Example: 12

Get all wallets for the authenticated customer. This endpoint allows an authenticated customer to view all wallets associated with their account.

requires authentication

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/wallets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/wallets"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "currency": "USD",
        "customer": 123,
        "created_at": "2025-01-25T12:34:56.000000Z",
        "updated_at": "2025-01-25T12:34:56.000000Z"
    },
    {
        "id": 2,
        "currency": "EUR",
        "customer": 123,
        "created_at": "2025-01-25T12:40:00.000000Z",
        "updated_at": "2025-01-25T12:40:00.000000Z"
    }
]
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

GET customer/wallets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Retrieve a specific vehicle for the authenticated customer. This endpoint fetches a vehicle associated with the authenticated customer based on the provided registration number.

requires authentication

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/vehicle" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABC123\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/vehicle"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABC123"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "reg_number": "ABC123",
    "model": "Toyota Corolla",
    "customer": 123,
    "created_at": "2025-01-25T12:34:56.000000Z",
    "updated_at": "2025-01-25T12:34:56.000000Z"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

GET customer/vehicle

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle to retrieve. Example: ABC123

Retrieve all vehicles for the authenticated customer. This endpoint fetches all vehicles associated with the authenticated customer.

requires authentication

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/vehicles" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/vehicles"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "reg_number": "ABC123",
        "model": "Toyota Corolla",
        "customer": 123,
        "created_at": "2025-01-25T12:34:56.000000Z",
        "updated_at": "2025-01-25T12:34:56.000000Z"
    },
    {
        "id": 2,
        "reg_number": "XYZ789",
        "model": "Honda Civic",
        "customer": 123,
        "created_at": "2025-01-25T12:35:00.000000Z",
        "updated_at": "2025-01-25T12:35:00.000000Z"
    }
]
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

GET customer/vehicles

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Get paginated transactions for a customer's vehicles.

requires authentication

This endpoint retrieves transactions for vehicles that belong to the authenticated customer. Transactions are ordered by ID in descending order to show the latest transactions first. The response includes the last transaction ID and a flag indicating whether more transactions exist.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/transactions?per_page=10&last_id=50" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/transactions"
);

const params = {
    "per_page": "10",
    "last_id": "50",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 50,
            "transaction_date": "2025-01-20T10:00:00",
            "vehicle": {
                "id": 123,
                "vihicleClass": {
                    "price": 100
                }
            },
            "currency": {
                "name": "USD"
            }
        }
    ],
    "last_id": 45,
    "has_more": true
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

GET customer/transactions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

per_page   integer  optional  

Number of transactions per page. Default is 10. Example: 10

last_id   integer  optional  

The last transaction ID from the previous request for pagination. Example: 50

Reset Customer Password This endpoint generates a new strong password for the customer and sends it via email. The customer is advised to change this password after logging in.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/password/reset" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"user@example.com\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/password/reset"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "user@example.com"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "A new password has been sent to your email."
}
 

Example response (404):


{
    "message": "Email not found."
}
 

Request      

GET customer/password/reset

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The email address of the customer. Example: user@example.com

Change Customer Password Allows an authenticated customer to change their password. Sends an email notification confirming the password change.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/password/change" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"old_password\": \"oldP@ssw0rd\",
    \"new_password\": \"N3wP@ssw0rd!\",
    \"confirm_password\": \"N3wP@ssw0rd!\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/password/change"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "old_password": "oldP@ssw0rd",
    "new_password": "N3wP@ssw0rd!",
    "confirm_password": "N3wP@ssw0rd!"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Password changed successfully."
}
 

Example response (203):


{
    "message": "Unauthenticated."
}
 

Example response (401):


{
    "message": "Current password is incorrect."
}
 

Request      

POST customer/password/change

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

old_password   string   

The current password. Example: oldP@ssw0rd

new_password   string   

The new password. Example: N3wP@ssw0rd!

confirm_password   string   

Must match the new password. Example: N3wP@ssw0rd!

Update Customer Information

requires authentication

This endpoint allows an authenticated customer to update their profile information. Only non-null fields will be updated.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/update" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customer\": 1,
    \"fname\": \"John\",
    \"mname\": \"Doe\",
    \"surname\": \"Smith\",
    \"male\": true,
    \"national_id\": \"12-3456789X12\",
    \"address\": \"123 Street, City\",
    \"phone\": \"+263771234567\",
    \"email\": \"john.doe@example.com\",
    \"id_file\": \"id123.png\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customer": 1,
    "fname": "John",
    "mname": "Doe",
    "surname": "Smith",
    "male": true,
    "national_id": "12-3456789X12",
    "address": "123 Street, City",
    "phone": "+263771234567",
    "email": "john.doe@example.com",
    "id_file": "id123.png"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Customer updated successfully."
}
 

Example response (203):


{
    "message": "Not authenticated."
}
 

Example response (409):


{
    "message": "Customer exists."
}
 

Request      

POST customer/update

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customer   integer   

The ID of the customer. Example: 1

fname   string  optional  

The first name of the customer. Example: John

mname   string  optional  

The middle name of the customer. Example: Doe

surname   string  optional  

The surname of the customer. Example: Smith

male   boolean  optional  

Indicates if the customer is male (1 for male, 0 for female). Example: true

national_id   string  optional  

The national ID of the customer. Example: 12-3456789X12

address   string  optional  

The customer's address. Example: 123 Street, City

phone   string  optional  

The customer's phone number. Example: +263771234567

email   string  optional  

The customer's email address. Example: john.doe@example.com

id_file   string  optional  

A file reference for the customer's ID. Example: id123.png

Get Paginated Customer Logs

requires authentication

This endpoint retrieves the activity logs of the authenticated customer in paginated format. It expects a last_id parameter to fetch logs in batches of 20. If last_id is 0, it fetches the first 20 logs.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/audits?last_id=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/audits"
);

const params = {
    "last_id": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "logs": [
        {
            "id": 101,
            "customer": 55,
            "action": "Logged in",
            "created_at": "2024-03-11 10:15:30",
            "updated_at": "2024-03-11 10:15:30"
        },
        {
            "id": 100,
            "customer": 55,
            "action": "Updated profile",
            "created_at": "2024-03-11 11:00:00",
            "updated_at": "2024-03-11 11:00:00"
        }
    ],
    "last_id": 100
}
 

Example response (203):


{
    "message": "Unauthenticated"
}
 

Request      

POST customer/audits

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

last_id   integer   

The ID of the last log entry from the previous request. Use 0 to fetch the first batch. Example: 0

Deactivate a Tag

requires authentication

This endpoint allows an authenticated admin to deactivate a tag on behalf of a customer. A customer can also deactivate their own tag.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicle/tag/deactivate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABC1234\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/tag/deactivate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABC1234"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


json {
  "message": "Tag deactivated"
}
 

Example response (203):


json {
  "message": "Not authenticated"
}
 

Example response (403):


json {
  "message": "Unauthorized action"
}
 

Example response (404):


json {
  "message": "Tag not found for the specified vehicle"
}
 

Request      

POST vehicle/tag/deactivate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The vehicle registration number associated with the tag. Example: ABC1234

Temporarily transfer a vehicle to another user.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/tranfer/temp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"vehicle\": 12,
    \"temp_client\": 34,
    \"duration\": 48,
    \"customer\": 34
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/tranfer/temp"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "vehicle": 12,
    "temp_client": 34,
    "duration": 48,
    "customer": 34
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Transferred successfully"
}
 

Example response (400):


{
    "message": "Vehicle not found or does not belong to the authenticated client."
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Request      

POST customer/tranfer/temp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

vehicle   integer   

The ID of the vehicle to transfer. Example: 12

temp_client   integer   

The ID of the temporary client. Example: 34

duration   integer   

The duration of the transfer in hours. Example: 48

customer   integer   

The ID of the client if admin. Example: 34

Get customer details by national ID.

Retrieves the first name, middle name, and surname of a customer based on the provided national ID. Only authenticated customers can access this endpoint.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/get/temp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"national_id\": \"12345678901234\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/get/temp"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "national_id": "12345678901234"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "fname": "John",
    "mname": "Doe",
    "surname": "Smith"
}
 

Example response (401):


{
    "message": "Unauthenticated"
}
 

Example response (404):


{
    "message": "Customer not found"
}
 

Request      

POST customer/get/temp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

national_id   string   

The national ID of the customer to look up. Example: 12345678901234

Customer Management

Bulk verify and activate customer accounts.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/activate/bulk" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"customers\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/activate/bulk"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "customers": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "All selected customers verified, emails are being sent"
}
 

Request      

POST customer/activate/bulk

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

customers   string[]   

An array of customer IDs to activate.

Endpoints

POST _ignition/execute-solution

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/_ignition/execute-solution" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"solution\": \"quia\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/_ignition/execute-solution"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "solution": "quia"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST _ignition/execute-solution

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

solution   string   

Example: quia

parameters   object  optional  

POST _ignition/update-config

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/_ignition/update-config" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"theme\": \"dark\",
    \"editor\": \"voluptas\",
    \"hide_solutions\": true
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/_ignition/update-config"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "theme": "dark",
    "editor": "voluptas",
    "hide_solutions": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST _ignition/update-config

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

theme   string   

Example: dark

Must be one of:
  • light
  • dark
  • auto
editor   string   

Example: voluptas

hide_solutions   boolean   

Example: true

Retrieve paginated tag applications.

requires authentication

This endpoint allows an authenticated admin to retrieve tag applications in batches of 100. If a last_id is provided, the next 100 applications after that ID will be returned. Otherwise, the first 100 applications are retrieved.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/admin/applications?last_id=100" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/applications"
);

const params = {
    "last_id": "100",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "tag_applications": [
        {
            "id": 1,
            "reg_number": "ABC1234",
            "created_at": "2024-01-01T00:00:00.000000Z",
            "updated_at": "2024-01-01T00:00:00.000000Z"
        },
        {
            "id": 2,
            "reg_number": "XYZ5678",
            "created_at": "2024-01-01T01:00:00.000000Z",
            "updated_at": "2024-01-01T01:00:00.000000Z"
        }
    ],
    "pagination": {
        "last_id": 2,
        "has_more": true
    }
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

GET admin/applications

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

last_id   integer  optional  

Optional. The ID of the last tag application retrieved in the previous call. Example: 100

Top-up a customer's wallet balance.

requires authentication

This endpoint allows an authenticated customer to top up their wallet by adding a specified amount to the existing balance. The wallet will be identified by the bpd parameter, and the amount will be added to the current balance.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/wallet/topup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"bpd\": 12345,
    \"amount\": 50
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/wallet/topup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "bpd": 12345,
    "amount": 50
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 12345,
    "customer": 67890,
    "balance": 150
}
 

Example response (203):


{not authenticated"}
 

Request      

POST customer/wallet/topup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

bpd   integer   

The ID of the wallet to be topped up. Example: 12345

amount   number   

The amount to be added to the wallet balance. Example: 50

POST customer/transact/mobile

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/transact/mobile" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/transact/mobile"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST customer/transact/mobile

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Store a new gate status.

This endpoint allows you to store a new gate status with the provided information.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/gate/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"gate\": 1,
    \"name\": \"\\\"Main Gate\\\"\",
    \"state\": \"\\\"Open\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/gate/status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "gate": 1,
    "name": "\"Main Gate\"",
    "state": "\"Open\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Gate created successfully"
}
 

Request      

POST gate/status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

gate   integer   

The gate identifier. Example: 1

name   string   

The name of the gate. Example: "Main Gate"

state   string   

The state of the gate (e.g., "Open", "Closed"). Example: "Open"

Get the latest statuses for each gate.

This endpoint retrieves the latest status for each gate, including the state and name.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/gates/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/gates/status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
 {
     "gate": 1,
     "name": "Main Gate",
     "state": "Open",
     "created_at": "2025-03-01T12:00:00",
 },
 {
     "gate": 2,
     "name": "Side Gate",
     "state": "Closed",
     "created_at": "2025-03-01T12:30:00",
 }
]
 

Request      

GET gates/status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

POST customer/verify/id

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/verify/id" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/verify/id"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST customer/verify/id

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Exchange Rates

Store a new exchange rate. This endpoint stores a new exchange rate in the system. It checks if the user is authenticated as an admin before storing the exchange rate. If the user is not authenticated, it returns a response indicating the failure.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/exchangerate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"currency\": \"1\",
    \"rate\": 1.2,
    \"active\": true
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/exchangerate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "currency": "1",
    "rate": 1.2,
    "active": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Saved"
}
 

Example response (203):


{
    "message": "not authenticated"
}
 

Request      

POST exchangerate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

currency   intger   

The currency id for the exchange rate. Example: 1

rate   number   

The exchange rate for the given currency. Example: 1.2

active   boolean   

Indicates whether the exchange rate is active or not. Example: true

Retrieve exchange rates. This endpoint fetches all exchange rates stored in the system.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/exchangerates" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/exchangerates"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Success):


[
    {
        "id": 1,
        "currency": "USD",
        "rate": "370.50",
        "created_at": "2024-02-16T10:00:00.000000Z",
        "updated_at": "2024-02-16T10:00:00.000000Z"
    },
    {
        "id": 2,
        "currency": "EUR",
        "rate": "400.75",
        "created_at": "2024-02-16T10:05:00.000000Z",
        "updated_at": "2024-02-16T10:05:00.000000Z"
    }
]
 

Request      

GET exchangerates

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Gate

Process a vehicle's toll payment using the wallet associated with the vehicle.

This endpoint processes the toll payment for a vehicle using its specific wallet. The function retrieves the vehicle's wallet and checks if it has enough balance to pay for the toll.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/transact" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"\\\"ABC123\\\"\",
    \"tag_number\": \"\\\"XYZ789\\\"\",
    \"gate\": 1
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/transact"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "\"ABC123\"",
    "tag_number": "\"XYZ789\"",
    "gate": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "cleared"
}
 

Example response (400):


{
    "message": "insufficient funds"
}
 

Example response (404):


{
    "message": "Vehicle wallet not found"
}
 

Example response (404):


{
    "message": "Wallet not found"
}
 

Example response (404):


{
    "message": "Vehicle or tag not found"
}
 

Request      

POST customer/transact

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The vehicle's registration number. Example: "ABC123"

tag_number   string  optional  

optional The vehicle's tag number. Example: "XYZ789"

gate   integer   

The gate ID the vehicle is passing through. Example: 1

This endpoint processes a cash transaction for a vehicle passing through a gate. It calculates the transaction amount based on the vehicle's class price and the exchange rate for the given currency.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/customer/transact/cash" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"gate\": 1,
    \"vehicle\": 123,
    \"currency\": \"USD\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/transact/cash"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "gate": 1,
    "vehicle": 123,
    "currency": "USD"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "cleared"
}
 

Example response (404):


{
    "message": "Gate not found"
}
 

Request      

POST customer/transact/cash

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

gate   integer   

The ID of the gate where the vehicle is passing through. Example: 1

vehicle   integer   

The ID of the vehicle making the transaction. Example: 123

currency   string   

The currency code (e.g., USD, EUR) for the payment. Example: USD

Operators

Store a new operator. This endpoint allows an authenticated admin to create a new operator account. If the operator's email already exists in the system, the request is rejected. Upon successful creation, an email is sent to the operator with their credentials.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/operator" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"fname\": \"\\\"John\\\"\",
    \"mname\": \"\\\"Michael\\\"\",
    \"surname\": \"\\\"Doe\\\"\",
    \"address\": \"\\\"123 Main Street, Harare\\\"\",
    \"phone\": \"\\\"+263777123456\\\"\",
    \"email\": \"\\\"operator@example.com\\\"\",
    \"password\": \"\\\"securePassword123\\\"\",
    \"toll_station\": \"\\\"Harare North\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/operator"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "fname": "\"John\"",
    "mname": "\"Michael\"",
    "surname": "\"Doe\"",
    "address": "\"123 Main Street, Harare\"",
    "phone": "\"+263777123456\"",
    "email": "\"operator@example.com\"",
    "password": "\"securePassword123\"",
    "toll_station": "\"Harare North\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Example response (403):


{
    "message": "Operator exists"
}
 

Request      

POST admin/operator

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

fname   string   

The first name of the operator. Example: "John"

mname   string  optional  

The middle name of the operator (optional). Example: "Michael"

surname   string   

The surname of the operator. Example: "Doe"

address   string   

The address of the operator. Example: "123 Main Street, Harare"

phone   string   

The phone number of the operator. Example: "+263777123456"

email   string   

The email of the operator (must be unique). Example: "operator@example.com"

password   string   

The password for the operator. Example: "securePassword123"

toll_station   string   

The toll station assigned to the operator. Example: "Harare North"

Authenticate an operator. This endpoint allows an operator to log in using their email and password. If authentication is successful and the operator is verified, their details are returned. If the operator is unverified, access is denied.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/operator/auth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"email\": \"\\\"operator@example.com\\\"\",
    \"password\": \"\\\"securePassword123\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/operator/auth"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "email": "\"operator@example.com\"",
    "password": "\"securePassword123\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "fname": "John",
    "mname": "Michael",
    "surname": "Doe",
    "address": "123 Main Street, Harare",
    "phone": "+263777123456",
    "email": "operator@example.com",
    "toll_station": "Harare North",
    "verified": 1
}
 

Example response (203):


{
    "message": "failed"
}
 

Example response (403):


{
    "message": "unverified"
}
 

Request      

POST operator/auth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

email   string   

The operator's email. Example: "operator@example.com"

password   string   

The operator's password. Example: "securePassword123"

Price

Store a new price entry for a given class. This function is used to store a new price entry in the database for a specific class. The function performs the following steps: 1. Authenticates the admin user. 2. Creates a new price entry with the provided class, price, and active status.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/price" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"class\": \"rerum\",
    \"price\": 231936,
    \"active\": false
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/price"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "class": "rerum",
    "price": 231936,
    "active": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Price saved successfully"
}
 

Example response (203):


{"message": "no authenticated"} Unauthorized if the admin is not authenticated.
 

Request      

POST admin/price

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

class   string   

The class for which the price is being set. Example: rerum

price   number   

The price to be set for the specified class. Example: 231936

active   boolean   

Optional Indicates whether the price is active (1) or inactive (0). Example: false

Tolling Transactions

Get consolidated transactions for a specific date.

This endpoint retrieves all transactions for a given date where currency and payment are not zero. It also consolidates the total amounts per currency and provides details about the toll gate and tolling station.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/gate/consolidate_today" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"2025-02-14\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/gate/consolidate_today"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date": "2025-02-14"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "transactions": [
        {
            "id": 272,
            "vehicle": 19,
            "payment": 1,
            "currency": {
                "id": 4,
                "name": "Euro",
                "symbol": "E",
                "created_at": "2025-02-01T10:31:50.000000Z",
                "updated_at": "2025-02-01T10:31:50.000000Z"
            },
            "amount": 2.76,
            "created_at": "2025-02-14T17:39:23.000000Z",
            "updated_at": "2025-02-14T17:39:23.000000Z",
            "gate": 1,
            "station": 2,
            "toll_gate": {
                "id": 1,
                "name": "Buse Exit",
                "gate": 1,
                "toll_station": 2,
                "created_at": "2025-02-14T17:02:45.000000Z",
                "updated_at": "2025-02-14T17:02:45.000000Z"
            },
            "tolling_station": {
                "id": 2,
                "name": "Buse",
                "created_at": "2025-02-01T10:32:05.000000Z",
                "updated_at": "2025-02-01T10:32:05.000000Z"
            }
        }
    ],
    "consolidations": [
        {
            "date": "2025-02-14",
            "currency": 1,
            "total_amount": 2.76,
            "toll_gate": {
                "id": 1,
                "name": "Buse Exit"
            },
            "tolling_station": {
                "id": 2,
                "name": "Buse"
            }
        }
    ]
}
 

Request      

GET gate/consolidate_today

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

date   date   

The date for which transactions should be retrieved (format: Y-m-d). Example: 2025-02-14

Consolidate transactions based on date and filter. This endpoint consolidates toll gate transactions by grouping them based on the provided filter. If the filter is 1 (1 week) or 2 (1 month), transactions are grouped by day. If the filter is 3 (3 months), 4 (6 months), or 5 (1 year), transactions are grouped by week.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/filtered" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"date\": \"\\\"2024-07-15\\\"\",
    \"filter\": 2
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/filtered"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "date": "\"2024-07-15\"",
    "filter": 2
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "transactions": [
        {
            "id": 1,
            "created_at": "2024-07-15 10:30:00",
            "currency": "USD",
            "amount": 50,
            "toll_gate": {
                "id": 1,
                "name": "Harare South"
            },
            "tolling_station": {
                "id": 2,
                "name": "Main Toll Station"
            }
        }
    ],
    "consolidations": [
        {
            "date_group": "2024-07-15",
            "currency": "USD",
            "total_amount": 500,
            "toll_gate": {
                "id": 1,
                "name": "Harare South"
            },
            "tolling_station": {
                "id": 2,
                "name": "Main Toll Station"
            }
        }
    ]
}
 

Example response (400):


{
    "error": "Invalid date format. Expected Y-m-d."
}
 

Request      

POST admin/filtered

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

date   string   

The reference date for transactions in YYYY-MM-DD format. Example: "2024-07-15"

filter   integer   

The filter period. Acceptable values:

  • 1: One week (Grouped by day)
  • 2: One month (Grouped by day)
  • 3: Three months (Grouped by week)
  • 4: Six months (Grouped by week)
  • 5: One year (Grouped by week) Example: 2

Tollingstation

Store a newly created toll station in the database. This method checks if the admin is authenticated. If the admin is authenticated, the toll station is saved to the database with the provided name from the request. After saving, it returns a JSON response indicating that the data has been saved. If the admin is not authenticated, a JSON response with a 203 status code is returned.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/tollingstation" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/tollingstation"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Request      

POST admin/tollingstation

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Assign an operator to a toll station. This endpoint allows an authenticated admin to assign a toll station to an operator.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/operator/assign/tollingstation" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"operator\": 1,
    \"toll_station\": \"\\\"Harare North\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/operator/assign/tollingstation"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "operator": 1,
    "toll_station": "\"Harare North\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Example response (203):


{
    "message": "unauthenticated"
}
 

Request      

POST admin/operator/assign/tollingstation

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

operator   integer   

The ID of the operator. Example: 1

toll_station   string   

The toll station to assign the operator to. Example: "Harare North"

Transfers

Retrieve vehicle transfer records.

requires authentication

This endpoint returns vehicle transfer details depending on the authenticated user type.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/vehicles/transfers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicles/transfers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Admin retrieving transfers):


{
    "all_transfers": [
        {
            "id": 1,
            "vehicle": {
                "id": 12,
                "plate_number": "ABC123"
            },
            "org_owner": {
                "id": 5,
                "fname": "John",
                "surname": "Doe"
            },
            "temp_owner": {
                "id": 8,
                "fname": "Jane",
                "surname": "Smith"
            },
            "duration": 48,
            "created_at": "2025-09-14T10:30:00Z"
        }
    ]
}
 

Example response (200, Customer retrieving their transfers):


{
    "data": [
        {
            "id": 2,
            "vehicle": {
                "id": 14,
                "plate_number": "XYZ987"
            },
            "org_owner": {
                "id": 5,
                "fname": "John",
                "surname": "Doe"
            },
            "temp_owner": {
                "id": 10,
                "fname": "Alice",
                "surname": "Brown"
            },
            "duration": 72,
            "created_at": "2025-09-13T08:00:00Z"
        }
    ]
}
 

Example response (203, Unauthenticated):


{
    "error": "Unauthenticated."
}
 

Request      

GET vehicles/transfers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Cancel a temporary vehicle transfer.

requires authentication

This endpoint cancels an active temporary transfer.

Cancellation sets the transfer as inactive and triggers email notifications to both the original and temporary owners.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicles/transfers/cancel" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"transfer_id\": 15
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicles/transfers/cancel"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "transfer_id": 15
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Vehicle transfer has been successfully cancelled."
}
 

Example response (203):


{
    "error": "You are not authorized to cancel this transfer."
}
 

Example response (404):


{
    "error": "Transfer not found."
}
 

Example response (409):


{
    "error": "This transfer is already inactive and cannot be cancelled."
}
 

Example response (422):


{
    "transfer_id": [
        "The transfer id field is required."
    ]
}
 

Request      

POST vehicles/transfers/cancel

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

transfer_id   integer   

The ID of the transfer to cancel. Example: 15

Vehicle

Report a vehicle as lost or stolen.

requires authentication

This function allows authenticated users (either an admin or a customer) to update a vehicle's status as lost or stolen.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicle/report" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"\\\"ABC123\\\"\",
    \"vehicle\": 12,
    \"lost\": true,
    \"stolen\": false
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/report"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "\"ABC123\"",
    "vehicle": 12,
    "lost": true,
    "stolen": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "saved"
}
 

Example response (203):


{
    "message": "no authenticated"
}
 

Request      

POST vehicle/report

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

if authenticated as admin The registration number of the vehicle. Example: "ABC123"

vehicle   integer   

if authenticated as customer The vehicle ID. Example: 12

lost   boolean   

Indicates whether the vehicle is reported lost. Example: true

stolen   boolean   

Indicates whether the vehicle is reported stolen. Example: false

Find Vehicle Operator

This endpoint retrieves vehicle details based on the provided registration number or tag number. If a matching vehicle is found, a transaction is initialized, and the vehicle's active wallet is checked.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/operator/vehicle/find" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"\\\"AFC0145\\\"\",
    \"tag_number\": \"\\\"TAG12345\\\"\",
    \"gate\": 1,
    \"img\": \"hda684i2nk4m1h\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/operator/vehicle/find"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "\"AFC0145\"",
    "tag_number": "\"TAG12345\"",
    "gate": 1,
    "img": "hda684i2nk4m1h"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "reg_number": "AFC0145",
    "customer": {
        "id": 5,
        "name": "John Doe"
    },
    "tagassignment": {
        "tag": {
            "tag_number": "TAG12345"
        }
    },
    "vihicleClass": {
        "price": 10
    }
}
 

Example response (403):


"vehicle not found"
 

Example response (403):


"gate not found"
 

Example response (409):


{
   "id": 1,
   "reg_number": "AFC0145",
   "customer": {
       "id": 5,
       "name": "John Doe"
   },
   "tagassignment": {
       "tag": {
           "tag_number": "TAG12345"
       }
   },
   "vihicleClass": {
       "price": 10.00
   }
} The vehicle was found but does not have an active wallet, requiring cash or e-payments.
 

Request      

POST operator/vehicle/find

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle. Example: "AFC0145"

tag_number   string  optional  

The tag number associated with the vehicle. Example: "TAG12345"

gate   integer   

The ID of the gate where the vehicle is being processed. Example: 1

img   string   

The img base64 of the car. Example: hda684i2nk4m1h

Vehicle Allocation

Accept a temporary vehicle allocation.

Allows the temporary owner to accept the allocated vehicle. Once accepted, the allocation becomes active and valid for the specified duration.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/customer/vehicle/temp/accept" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"pbq\": \"\\\"YmFzZTY0ZW5jb2RlZElE\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/customer/vehicle/temp/accept"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "pbq": "\"YmFzZTY0ZW5jb2RlZElE\""
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Temporary allocation accepted successfully"
}
 

Example response (404):


{
    "message": "Temporary allocation not found"
}
 

Request      

GET customer/vehicle/temp/accept

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

pbq   string   

The base64-encoded ID of the temporary allocation. Example: "YmFzZTY0ZW5jb2RlZElE"

Check all temporary vehicle allocations and update their status.

Iterates through all temporary transfers, checks if the duration has expired, and deactivates expired allocations. Expired allocations fall back to the original owner.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/vehicle/temp/validate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/temp/validate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Checked all temporary allocations"
}
 

Request      

GET vehicle/temp/validate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

VehicleClasses

Store a new vehicle class in the database. This method checks if the admin is authenticated. If authenticated, it verifies whether a vehicle class with the same `class` and `name` already exists. If a duplicate entry is found, it returns a 403 status code with an "already exists" message. Otherwise, it creates a new vehicle class entry in the database and returns a success response. If the admin is not authenticated, a response with a 203 status code is returned.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/admin/class" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"class\": 0,
    \"name\": \"\\\"Light motor Vehicle\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/admin/class"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "class": 0,
    "name": "\"Light motor Vehicle\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST admin/class

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

class   integer   

The class of the vehicle. Example: 0

name   string   

The name of the class. Example: "Light motor Vehicle"

Vehicle License Management

Store a new vehicle license. This endpoint allows an authenticated admin to create a new vehicle license.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicle/license" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"ABC123\",
    \"expiry\": \"2025-12-31\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/license"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "ABC123",
    "expiry": "2025-12-31"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "licensed",
    "license": {
        "id": 1,
        "vehicle": 10,
        "expiry": "2025-12-31",
        "expired": 0,
        "created_at": "2024-02-26T10:00:00.000000Z"
    }
}
 

Example response (400):


{
    "message": "Vehicle not found."
}
 

Example response (401):


{
    "message": "Not authenticated."
}
 

Request      

POST vehicle/license

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle. Example: ABC123

expiry   date   

The expiry date of the vehicle license. Example: 2025-12-31

Check the license status of a vehicle. This endpoint allows an authenticated admin to check the license status of a vehicle using its registration number. It retrieves the active (non-expired) license for the vehicle.

requires authentication

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicle/license/check" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"reg_number\": \"\\\"ABC-123\\\"\"
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/license/check"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "reg_number": "\"ABC-123\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "vehicle": 5,
    "license_number": "LIC-20231234",
    "issued_at": "2023-01-10",
    "expires_at": "2024-01-10",
    "expired": 0,
    "created_at": "2023-01-10T10:00:00.000000Z",
    "updated_at": "2023-05-10T10:00:00.000000Z"
}
 

Example response (400):


{
    "message": "Vehicle not found."
}
 

Example response (401):


{
    "message": "Not authenticated."
}
 

Request      

POST vehicle/license/check

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

reg_number   string   

The registration number of the vehicle. Example: "ABC-123"

Vehicle Wallet Management

Store a vehicle wallet.

This function checks if a vehicle already has an active wallet. If so, it prevents the creation of a new active wallet. It allows creation of additional wallets, but only one wallet can be marked as active at a time.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicle/wallet" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"vehicle\": 123,
    \"wallet\": 456,
    \"limit_day\": 100
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/wallet"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "vehicle": 123,
    "wallet": 456,
    "limit_day": 100
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Wallet created successfully."
}
 

Example response (203):


{
    "message": "Not authenticated."
}
 

Example response (404):


{
    "message": "This vehicle already has a wallet."
}
 

Request      

POST vehicle/wallet

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

vehicle   integer   

The ID of the vehicle. Example: 123

wallet   integer   

The wallet ID. Example: 456

limit_day   integer   

The daily limit for the wallet. Example: 100

Deactivate a vehicle wallet.

This endpoint deactivates the wallet associated with a specific vehicle. It checks if the customer and admin are authenticated, and verifies if the vehicle has a wallet. If the wallet exists, it will be deactivated.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicle/wallet/deactivate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"vehicle\": 123,
    \"wallet\": 456
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/wallet/deactivate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "vehicle": 123,
    "wallet": 456
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Wallet deactivated successfully."
}
 

Example response (203):


{
    "message": "Not authenticated."
}
 

Example response (404):


{
    "message": "Wallet not found for this vehicle."
}
 

Request      

POST vehicle/wallet/deactivate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

vehicle   integer   

The ID of the vehicle. Example: 123

wallet   integer   

The wallet ID. Example: 456

Get all wallets associated with a specific vehicle.

This function fetches all the wallets associated with a specific vehicle. It ensures that the request is made by either an authenticated customer or an admin. If neither is authenticated, the request will be denied. The wallets retrieved include the associated currency information.

Example request:
curl --request POST \
    "https://etolling.buseinnovations.com/public/vehicle/wallets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"vehicle\": 1
}"
const url = new URL(
    "https://etolling.buseinnovations.com/public/vehicle/wallets"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "vehicle": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "data": [
        {
            "id": 1,
            "vehicle": 1,
            "wallet": 1,
            "active": 1,
            "limit_day": 100,
            "created_at": "2025-02-14T17:39:23.000000Z",
            "updated_at": "2025-02-14T17:39:23.000000Z",
            "waletObj": {
                "currency": {
                    "id": 1,
                    "name": "USD",
                    "symbol": "$",
                    "created_at": "2025-02-01T10:31:50.000000Z",
                    "updated_at": "2025-02-01T10:31:50.000000Z"
                }
            }
        }
    ]
}
 

Example response (203):


{
    "message": "Not authenticated."
}
 

Request      

POST vehicle/wallets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

vehicle   integer   

The ID of the vehicle for which wallets are to be fetched. Example: 1

Wallet Notifications

Notify wallets with a balance below twice the highest vehicle class price.

This endpoint checks all wallets and sends a notification if the balance is below twice the highest class price of any vehicle in the fleet. The notification is sent via email to the customer associated with the wallet.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/wallets/notify" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/wallets/notify"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Notifications sent successfully"
}
 

Example response (500):


{
    "message": "An error occurred while sending notifications"
}
 

Request      

GET wallets/notify

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Zinara

Get Vehicle Master Info This endpoint retrieves vehicle registration information by calling the Zinara vehicle master API. It requires a `reg_number` query parameter and returns vehicle details such as make, model, chassis, registration number, license status, and more.

Example request:
curl --request GET \
    --get "https://etolling.buseinnovations.com/public/master/vehicle?reg_number=AAA0002" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json"
const url = new URL(
    "https://etolling.buseinnovations.com/public/master/vehicle"
);

const params = {
    "reg_number": "AAA0002",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200, Success):


{
    "responseCode": "200",
    "message": "Success",
    "data": {
        "id": 127053,
        "createdByUser": "test_user",
        "dateCreated": "2025-04-16T06:27:36.475857",
        "modifiedByUser": "",
        "dateModified": "2025-04-16T06:27:36.475865",
        "activeStatus": true,
        "make": "MITSUBISHI",
        "registrationNumber": "AAA0002",
        "model": "L200",
        "chassis": "VF38BLFVE80343736",
        "color": "",
        "ownerNationalID": "",
        "currentLicenceExpiryDate": "31 Jan 13",
        "grossVehicleMass": "",
        "netMass": "1134",
        "arrearAmount": "0",
        "penaltyAmount": "0",
        "vehicleLicenseStatusType": "EXPIREDLICENSE",
        "vehicleLicenseStatusUpdateReason": "",
        "vehicleClassificationType": "LIGHTMOTORVEHICLE",
        "exemptionType": "LICENSED",
        "isExemptionStatus": false,
        "exemptionDescription": "NOTEXEMPTED",
        "cvrStatus": null,
        "natureOfOnwership": "BUSINESS"
    }
}
 

Example response (500, Error response):


{
    "responseCode": "500",
    "message": "cURL Error",
    "error": "Could not resolve host: core-engine.zwzinara.net"
}
 

Request      

GET master/vehicle

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Query Parameters

reg_number   string   

The vehicle registration number to search. Example: AAA0002