Tenant API Service

Welcome to the Tenant API Service documentation. This guide provides an overview of all available API endpoints and instructions to help you integrate and interact with the Tenant API efficiently.

View Full API Reference →

🔑 Account Setup

To obtain access credentials, please send an email to requesting an API key.

🔐 Configuration & Authentication

Base URL: {{baseUrl}}/api/v1

All endpoints require authentication via the X-Api-Key header:

X-Api-Key: {{api-key}}

Note: IP limited access may apply.

1. Pricing Zone Operations (Optional)

POST Create Pricing Zone

Creates a new pricing zone with geographical boundaries.

curl -X POST "{{baseUrl}}/api/v1/pricing-zones" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "name": "Test Zone",
    "radius": 20,
    "points": [
      {"lat": 35.850035911668925, "lng": 14.494603872299194}
    ]
  }'

GET Get All Pricing Zones

Retrieves all pricing zones in the system.

curl -X GET "{{baseUrl}}/api/v1/pricing-zones" \
  -H "X-Api-Key: {{api-key}}"

GET Get Pricing Zone by ID

Retrieves a specific pricing zone by its ID.

curl -X GET "{{baseUrl}}/api/v1/pricing-zones/123" \
  -H "X-Api-Key: {{api-key}}"

PUT Update Pricing Zone

Updates an existing pricing zone configuration.

curl -X PUT "{{baseUrl}}/api/v1/pricing-zones/123" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "name": "Updated Test Pricing Zone",
    "radius": 1500,
    "points": [
      {"lat": 35.9000, "lng": 14.5150, "address": "Updated Valletta, Malta"},
      {"lat": 35.9050, "lng": 14.5200, "address": "Updated Sliema, Malta"}
    ]
  }'

DELETE Delete Pricing Zone

Removes a pricing zone from the system.

curl -X DELETE "{{baseUrl}}/api/v1/pricing-zones/123" \
  -H "X-Api-Key: {{api-key}}"

2. Pricing Rule Operations (Optional)

POST Create Pricing Rule

Creates a new pricing rule with comprehensive criteria and settings.

curl -X POST "{{baseUrl}}/api/v1/pricing-rules" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "name": "Test Pricing Rule",
    "description": "Example description",
    "status": "DRAFT",
    "type": "GENERAL",
    "quota": {
      "type": "COMMON",
      "value": 40.0,
      "unit": "FIXED"
    },
    "criteria": {
      "booking": {
        "sources": ["WEB"],
        "types": ["ASAP"]
      },
      "payment": {
        "paymentTypes": ["CASH"]
      },
      "vehicle": {
        "types": ["cab"]
      },
      "dateRange": {
        "dateFrom": "2025-11-05",
        "dateTo": "2025-11-06",
        "daysOfWeek": ["FRIDAY"],
        "isExtendedWeekend": false,
        "timeFrom": "00:30",
        "timeTo": "00:40"
      },
      "zonesIds": [1],
      "pointsIds": [2]
    },
    "settings": {
      "waitingTime": {
        "waitTimeGracePeriod": 2
      },
      "pricePerMinute": {
        "isFinalPriceRecalculationEnabled": false
      },
      "surgeMap": {
        "showRule": true,
        "showRuleValue": true
      }
    }
  }'

GET Get All Pricing Rules

Retrieves all pricing rules in the system.

curl -X GET "{{baseUrl}}/api/v1/pricing-rules" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{}'

GET Get Pricing Rule by ID

Retrieves a specific pricing rule by its ID.

curl -X GET "{{baseUrl}}/api/v1/pricing-rules/123" \
  -H "X-Api-Key: {{api-key}}"

PUT Update Pricing Rule

Updates an existing pricing rule configuration.

curl -X PUT "{{baseUrl}}/api/v1/pricing-rules/123" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "name": "Updated Pricing Rule",
    "description": "Updated test pricing rule",
    "status": "DRAFT",
    "type": "GENERAL",
    "quota": {
      "type": "COMMON",
      "value": 7.5,
      "unit": "PERCENT"
    },
    "criteria": {
      "booking": {
        "sources": ["WEB"],
        "types": ["ASAP"]
      },
      "payment": {
        "paymentTypes": ["CASH"]
      },
      "vehicle": {
        "types": ["cab"]
      },
      "dateRange": {
        "dateFrom": "2025-11-05",
        "dateTo": "2025-11-06",
        "daysOfWeek": ["FRIDAY"],
        "isExtendedWeekend": false,
        "timeFrom": "00:30",
        "timeTo": "00:40"
      },
      "zonesIds": [1, 2],
      "pointsIds": [1, 2]
    }
  }'

DELETE Delete Pricing Rule

Removes a pricing rule from the system.

curl -X DELETE "{{baseUrl}}/api/v1/pricing-rules/123" \
  -H "X-Api-Key: {{api-key}}"

3. Customer Service Operations

POST Create Customer

Creates a new customer with personal information.

curl -X POST "{{baseUrl}}/api/v1/customers" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "firstName": "Bruce",
    "lastName": "Wayne",
    "email": "bruce.wayne@waynenterprice.com",
    "mobilePhone": "+35612345678",
    "locale": "en_US"
  }'

GET Get Customer by ID

Retrieves a specific customer by their ID.

curl -X GET "{{baseUrl}}/api/v1/customers/123e4567-e89b-12d3-a456-426614174000" \
  -H "X-Api-Key: {{api-key}}"

GET Get All Customers

Retrieves all customers with pagination support.

curl -X GET "{{baseUrl}}/api/v1/customers" \
  -H "X-Api-Key: {{api-key}}"

GET Get Customers with Pagination

Retrieves customers with specific page and size parameters.

curl -X GET "{{baseUrl}}/api/v1/customers?page=0&size=10" \
  -H "X-Api-Key: {{api-key}}"

GET Search Customers by Mobile Phone

Searches for customers using their mobile phone number.

curl -X GET "{{baseUrl}}/api/v1/customers?mobilePhone=%2B35612345678" \
  -H "X-Api-Key: {{api-key}}"

4. Vehicle Type Operations

GET Get All Vehicle Types

Retrieves all available vehicle types with their details.

curl -X GET "{{baseUrl}}/api/v1/vehicle-types" \
  -H "X-Api-Key: {{api-key}}"

GET Get Vehicle Types with Pagination

Retrieves vehicle types with pagination parameters.

curl -X GET "{{baseUrl}}/api/v1/vehicle-types?page=0&size=10" \
  -H "X-Api-Key: {{api-key}}"

5. Vehicle Location Operations

GET Get All Vehicle Locations

Retrieves all vehicle locations with filtering by status.

curl -X GET "{{baseUrl}}/api/v1/vehicle-locations?status=IDLE&page=0&size=25" \
  -H "X-Api-Key: {{api-key}}"

GET Get Vehicle Location by Number Plate

Retrieves a specific vehicle location by its number plate.

curl -X GET "{{baseUrl}}/api/v1/vehicle-locations/ABC123" \
  -H "X-Api-Key: {{api-key}}"

6. Waiting Time Operations

GET Get Waiting Times

Retrieves waiting time information for specific coordinates.

curl -X GET "{{baseUrl}}/api/v1/waiting-times?lat=35.8997&lng=14.5146" \
  -H "X-Api-Key: {{api-key}}"

7. Quotation Operations

POST Create Quotation

Creates a new quotation for trip pricing estimation.

curl -X POST "{{baseUrl}}/api/v1/quotations" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "customerId": "123e4567-e89b-12d3-a456-426614174000",
    "bookingChannel": "MOBILE_APP",
    "paymentType": "ON_ACCOUNT",
    "pickUpTime": "2024-01-01T10:00:00Z",
    "tripWaypoints": [
      {
        "lat": 35.8519165,
        "lng": 14.4863253,
        "address": "Malta International Airport, Malta"
      },
      {
        "lat": 35.922935,
        "lng": 14.486780,
        "address": "eCabs, St. Julian, Malta"
      }
    ]
  }'

GET Get Quotation by ID

Retrieves a specific quotation by its ID.

curl -X GET "{{baseUrl}}/api/v1/quotations/123" \
  -H "X-Api-Key: {{api-key}}"

8. Booking Operations

POST Create Booking

Creates a new booking with comprehensive trip details.

curl -X POST "{{baseUrl}}/api/v1/bookings" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "customerId": "123e4567-e89b-12d3-a456-426614174000",
    "b2bAccount": null,
    "pickupTime": "2024-01-01T10:00:00Z",
    "asap": false,
    "quotationId": 123,
    "bookingChannel": "CALL",
    "vehicleType": {
      "code": "van"
    },
    "tripWaypoints": [
      {
        "orderNumber": 1,
        "location": {
          "lat": 35.8997,
          "lng": 14.5146,
          "address": "Valletta, Malta"
        },
        "type": "PICKUP",
        "passengers": null,
        "lastStop": false
      },
      {
        "orderNumber": 2,
        "location": {
          "lat": 35.9042,
          "lng": 14.5189,
          "address": "Sliema, Malta"
        },
        "type": "DROPOFF",
        "passengers": null,
        "lastStop": true
      }
    ],
    "passenger": {
      "firstName": "John",
      "lastName": "Doe",
      "contactNumber": "+35612345678"
    },
    "price": {
      "manualPrice": {
        "amount": {
          "value": 20.00,
          "currency": "EUR"
        },
        "reason": "Special rate"
      },
      "quotationPrice": null,
      "priceRange": null,
      "bookingFee": {
        "value": 1.00,
        "currency": "EUR"
      },
      "waitingTimeFee": null
    },
    "payment": {
      "paymentType": "CASH",
      "channel": "IN_VEHICLE",
      "status": "NOT_SETTLED"
    }
  }'

GET Get Booking by ID

Retrieves a specific booking by its ID.

curl -X GET "{{baseUrl}}/api/v1/bookings/123" \
  -H "X-Api-Key: {{api-key}}"

GET Get All Bookings

Retrieves all bookings with pagination support.

curl -X GET "{{baseUrl}}/api/v1/bookings?statusIn=COMPLETED&pickupTimeFrom=2025-01-01T00:00:00Z& 
pickupTimeTo=2025-01-02T00:00:00Z&shiftId=12&driverIds=3&driverIds=7&page=0&size=25" \
  -H "X-Api-Key: {{api-key}}"

PUT Update Booking Status

Updates the status of an existing booking.

curl -X PUT "{{baseUrl}}/api/v1/bookings/123" \
  -H "Content-Type: application/json" \
  -H "X-Api-Key: {{api-key}}" \
  -d '{
    "status": "CANCELLED"
  }'

HTTP Status Codes & Errors

The API uses standard HTTP status codes:
• **200 OK**: Successful GET requests
• **201 Created**: Successful POST requests (resource creation)
• **204 No Content**: Successful PUT/DELETE requests
• **400 Bad Request**: Invalid request data or validation errors
• **401 Unauthorized**: Missing or invalid API key
• **403 Forbidden**: Insufficient permissions (wrong role)
• **404 Not Found**: Resource not found
• **409 Conflict**: Resource already exists (e.g., duplicate API key)
• **500 Internal Server Error**: Server-side errors
---

Error responses typically follow this structure:

{
  "error": "Error description",
  "message": "Detailed error message",
  "timestamp": "2024-01-01T10:00:00Z"
}

Implementation Notes

- All endpoints require authentication via `X-Api-Key` header - Most endpoints support both ADMIN and USER roles - Pagination parameters: `page` (0-10000), `size` (1-100) - Date formats use ISO 8601 standard - Coordinates use decimal degrees format - UUIDs are used for customer IDs - All monetary amounts include currency specification