Base URL: http://localhost:5067
- Method:
POST - URL:
{{baseUrl}}/api/Database/initialize - Headers:
Content-Type: application/json - Body:
{} - Description: Creates indexes and sample data
- Method:
GET - URL:
{{baseUrl}}/api/Database/schema - Description: Returns database schema information
- Method:
GET - URL:
{{baseUrl}}/api/Database/schema/json - Description: Returns structured schema in JSON format
- Method:
GET - URL:
{{baseUrl}}/api/EVOwner - Query Params:
includeInactive(optional):false
- Method:
GET - URL:
{{baseUrl}}/api/EVOwner/199512345678
- Method:
POST - URL:
{{baseUrl}}/api/EVOwner - Headers:
Content-Type: application/json - Body:
{
"nic": "199712345678",
"firstName": "Alice",
"lastName": "Cooper",
"email": "alice.cooper@example.com",
"phoneNumber": "+94777888999",
"address": "456 Electric Avenue, Colombo 03",
"dateOfBirth": "1997-06-20T00:00:00Z",
"licenseNumber": "DL19970620",
"vehicleDetails": [
{
"vehicleNumber": "EV-2023",
"vehicleModel": "Tesla Model Y",
"vehicleBrand": "Tesla",
"batteryCapacity": 82.0,
"chargingType": "Both",
"isActive": true
}
]
}- Method:
PUT - URL:
{{baseUrl}}/api/EVOwner/199712345678 - Headers:
Content-Type: application/json - Body:
{
"firstName": "Alice Updated",
"lastName": "Cooper Updated",
"email": "alice.updated@example.com",
"phoneNumber": "+94777999888",
"address": "789 Updated Street, Colombo 05",
"dateOfBirth": "1997-06-20T00:00:00Z",
"licenseNumber": "DL19970621",
"vehicleDetails": [
{
"vehicleNumber": "EV-2024",
"vehicleModel": "Tesla Model S",
"vehicleBrand": "Tesla",
"batteryCapacity": 100.0,
"chargingType": "Both",
"isActive": true
}
]
}- Method:
PATCH - URL:
{{baseUrl}}/api/EVOwner/199712345678/deactivate
- Method:
PATCH - URL:
{{baseUrl}}/api/EVOwner/199712345678/activate
- Method:
DELETE - URL:
{{baseUrl}}/api/EVOwner/199712345678
- Method:
GET - URL:
{{baseUrl}}/api/EVOwner/email/alice.cooper@example.com
- Method:
GET - URL:
{{baseUrl}}/api/ChargingStations
- Method:
GET - URL:
{{baseUrl}}/api/ChargingStations/{{stationId}}
- Method:
POST - URL:
{{baseUrl}}/api/ChargingStations - Headers:
Content-Type: application/json - Body:
{
"name": "Postman Test Station",
"location": "Postman City",
"type": "DC",
"availableSlots": 10,
"isActive": true
}- Method:
PUT - URL:
{{baseUrl}}/api/ChargingStations/{{stationId}} - Headers:
Content-Type: application/json - Body:
{
"id": "{{stationId}}",
"name": "Updated Test Station",
"location": "Updated Location",
"type": "AC",
"availableSlots": 15,
"isActive": true
}- Method:
PATCH - URL:
{{baseUrl}}/api/ChargingStations/{{stationId}}/deactivate
- Method:
POST - URL:
{{baseUrl}}/api/Booking - Headers:
Content-Type: application/json - Body:
{
"userId": "507f1f77bcf86cd799439011",
"stationId": "507f1f77bcf86cd799439012",
"reservationDateTime": "2025-09-27T14:30:00Z"
}- Method:
GET - URL:
{{baseUrl}}/api/Booking/{{bookingId}}
- Method:
GET - URL:
{{baseUrl}}/api/Booking/user/507f1f77bcf86cd799439011
- Method:
PUT - URL:
{{baseUrl}}/api/Booking/{{bookingId}} - Headers:
Content-Type: application/json - Body:
{
"reservationDateTime": "2025-09-28T15:30:00Z"
}- Method:
PATCH - URL:
{{baseUrl}}/api/Booking/{{bookingId}}/confirm
- Method:
PATCH - URL:
{{baseUrl}}/api/Booking/{{bookingId}}/cancel
- Method:
POST - URL:
{{baseUrl}}/api/UserAccount/register - Headers:
Content-Type: application/json - Body:
{
"name": "Test User",
"email": "testuser@example.com",
"password": "TestPassword123!",
"role": "StationOperator"
}- Method:
POST - URL:
{{baseUrl}}/api/UserAccount/login - Headers:
Content-Type: application/json - Body:
{
"email": "testuser@example.com",
"password": "TestPassword123!"
}- Method:
GET - URL:
{{baseUrl}}/api/UserAccount - Headers:
Authorization: Bearer {{token}}
Create a new environment in Postman with these variables:
| Variable Name | Value |
|---|---|
baseUrl |
http://localhost:5067 |
token |
{{jwt_token_from_login}} |
evOwnerNIC |
199712345678 |
stationId |
{{station_id_from_create}} |
bookingId |
{{booking_id_from_create}} |
- Initialize Database - Run POST
/api/Database/initialize - Verify Schema - Run GET
/api/Database/schema
- Create EV Owner - Run POST
/api/EVOwner - Get All Owners - Run GET
/api/EVOwner - Get Owner by NIC - Run GET
/api/EVOwner/{nic} - Update Owner - Run PUT
/api/EVOwner/{nic} - Test Activation - Run PATCH
/api/EVOwner/{nic}/deactivatethen/activate
- Create Station - Run POST
/api/ChargingStations - Get All Stations - Run GET
/api/ChargingStations - Update Station - Run PUT
/api/ChargingStations/{id}
- Create User - Run POST
/api/UserAccount/register - Create Booking - Run POST
/api/Booking - Test Booking Flow - Confirm, Update, Cancel bookings
- ✅ Create EV Owner with valid data
- ✅ Update existing EV Owner
- ✅ Activate/Deactivate accounts
- ✅ Create bookings with future dates
- ✅ Confirm and cancel bookings
- ❌ Create EV Owner with duplicate NIC
- ❌ Create EV Owner with invalid email
- ❌ Create booking with past date
- ❌ Update booking less than 12 hours before
- ❌ Create booking more than 7 days in future
- 🔍 Create EV Owner with no vehicle details
- 🔍 Update EV Owner with same email as another owner
- 🔍 Create booking exactly 12 hours before reservation
- 🔍 Test NIC validation with old/new formats
For all requests, include:
Content-Type: application/json
Accept: application/json
For authenticated requests, add:
Authorization: Bearer YOUR_JWT_TOKEN
- All endpoints return appropriate HTTP status codes
- Response bodies contain expected data structures
- Error messages are descriptive and helpful
- Business rules are properly enforced
- Database constraints work correctly
- 404 Not Found - Check URL spelling and method
- 400 Bad Request - Verify JSON body format
- 409 Conflict - Check for duplicate NIC/email
- 500 Internal Error - Check server logs
Ensure your application is running on http://localhost:5067
dotnet runHappy Testing! 🚀