Skip to content

YeboCars Route Map

Complete API endpoint documentation for the YeboCars backend (80+ endpoints).

Route Overview

All routes are mounted from routes/index.ts:

typescript
// Core routes
router.use('/auth', authRoutes);
router.use('/cars', carRoutes);
router.use('/dealers', dealerRoutes);
router.use('/dealer-applications', dealerApplicationRoutes);
router.use('/customers', customerRoutes);

// AI & VIN
router.use('/ai', aiRoutes);
router.use('/vin', vinRoutes);

// Support
router.use('/media', mediaRoutes);
router.use('/countries', countryRoutes);
router.use('/messages', messageRoutes);
router.use('/notifications', notificationRoutes);

// Dashboard & Billing
router.use('/api/dashboard', dashboardRoutes);
router.use('/api/blog', blogRoutes);
router.use('/api/billing', billingRoutes);

Authentication Routes /auth

MethodEndpointDescriptionAuth
POST/signupRegister new user
POST/loginLogin with phone/password
POST/refreshRefresh access token🔒
POST/logoutLogout user🔒
POST/verify-phoneVerify phone with OTP
POST/resend-otpResend verification OTP
POST/forgot-passwordRequest password reset
POST/reset-passwordReset password with OTP
GET/meGet current user profile🔒
PUT/meUpdate current user🔒
DELETE/meDelete account🔒

Car Routes /cars

MethodEndpointDescriptionAuth
POST/Create car listing🔒
GET/List all cars
GET/feedGet car feed
GET/searchSearch cars
GET/featuredGet featured cars
GET/trendingGet trending cars
GET/recentGet recent listings
GET/:carIdGet car by ID
PUT/:carIdUpdate car🔒
DELETE/:carIdDelete car🔒
POST/:carId/favoriteFavorite a car🔒
DELETE/:carId/favoriteUnfavorite a car🔒
POST/:carId/shareShare a car🔒
GET/:carId/similarGet similar cars
GET/:carId/analyticsGet car analytics🔒
POST/:carId/inquirySend inquiry🔒
POST/:carId/test-driveRequest test drive🔒
POST/:carId/reportReport listing🔒

Filter Options

typescript
// Query parameters for GET /cars
{
  make?: string;           // Filter by make (Toyota, Honda, etc.)
  model?: string;          // Filter by model
  minPrice?: number;       // Minimum price
  maxPrice?: number;       // Maximum price
  minYear?: number;        // Minimum year
  maxYear?: number;        // Maximum year
  fuelType?: string;       // Petrol, Diesel, Electric, Hybrid
  transmission?: string;   // Automatic, Manual
  bodyType?: string;       // Sedan, SUV, Hatchback, etc.
  maxMileage?: number;     // Maximum mileage
  sellerType?: string;     // dealer, private
  countryId?: string;      // Country filter
  condition?: string;      // new, used, certified
  page?: number;           // Page number
  limit?: number;          // Results per page
  sort?: string;           // price, year, mileage, createdAt
  order?: string;          // asc, desc
}

Reference Data

MethodEndpointDescription
GET/makesGet all car makes
GET/makes/:make/modelsGet models for a make
GET/body-typesGet all body types
GET/featuresGet common features
GET/templateGet listing template

Dealer Routes /dealers

MethodEndpointDescriptionAuth
GET/List all dealers
GET/:dealerIdGet dealer by ID
GET/:dealerId/carsGet dealer's cars
GET/:dealerId/reviewsGet dealer reviews
GET/:dealerId/statsGet dealer statistics🔒
PUT/:dealerIdUpdate dealer profile🔒
GET/meGet current dealer🔒 Dealer
GET/me/leadsGet my leads🔒 Dealer
GET/me/analyticsGet my analytics🔒 Dealer
GET/me/inventoryGet my inventory🔒 Dealer
PUT/me/settingsUpdate settings🔒 Dealer

Dealer Application Routes /dealer-applications

MethodEndpointDescriptionAuth
POST/Submit application🔒
GET/List all applications🔒 Admin
GET/myGet my application🔒
GET/:applicationIdGet application details🔒
PUT/:applicationId/approveApprove application🔒 Admin
PUT/:applicationId/rejectReject application🔒 Admin
PUT/:applicationId/documentsUpload documents🔒

Customer Routes /customers

MethodEndpointDescriptionAuth
GET/me/favoritesGet my favorites🔒
GET/me/saved-searchesGet saved searches🔒
POST/me/saved-searchesCreate saved search🔒
DELETE/me/saved-searches/:idDelete saved search🔒
GET/me/inquiriesGet my inquiries🔒
GET/me/test-drivesGet my test drives🔒
GET/me/notificationsGet notifications🔒
PUT/me/preferencesUpdate preferences🔒

AI Routes /ai

MethodEndpointDescriptionAuth
POST/searchNatural language search
POST/generate-listingGenerate listing from data🔒
POST/enhance-descriptionEnhance description🔒
POST/recommendationsGet lifestyle recommendations
GET/pricing-insights/:carIdGet pricing insights
http
POST /ai/search
Content-Type: application/json

{
  "query": "reliable family SUV under $30,000 good for long trips"
}

Response:
{
  "availableCars": [
    {
      "car": { "make": "Toyota", "model": "RAV4", "price": 28000 },
      "matchScore": 0.92,
      "reasons": ["Perfect body type: SUV", "Within budget"],
      "lifestyleMatch": "Great for family use with spacious interior"
    }
  ],
  "searchIntent": {
    "query": "reliable family SUV under $30,000",
    "extractedCriteria": {
      "bodyType": "suv",
      "priceRange": { "max": 30000 },
      "targetDemographic": "families"
    },
    "confidence": 0.85
  }
}

Lifestyle Recommendations

http
POST /ai/recommendations
Content-Type: application/json

{
  "familySize": "large-family",
  "commutingDistance": "long",
  "budget": { "min": 20000, "max": 50000 },
  "usage": "adventure",
  "fuelPreference": "Hybrid"
}

Response:
{
  "recommendations": [...],
  "explanation": "Based on your lifestyle...",
  "score": 0.85,
  "lifestyleSummary": {
    "primaryNeed": "Space for large family",
    "secondaryConsiderations": ["Fuel efficiency", "Durability"],
    "budgetCategory": "Mid-range"
  }
}

VIN Routes /vin

MethodEndpointDescriptionAuth
GET/lookup/:vinLookup VIN
POST/decodeDecode VIN
POST/validateValidate VIN format

VIN Lookup

http
GET /vin/lookup/1HGBH41JXMN109186

Response:
{
  "success": true,
  "data": {
    "make": "Honda",
    "model": "Civic",
    "year": 2021,
    "bodyType": "Sedan",
    "fuelType": "Petrol",
    "transmission": "Automatic",
    "engine": "2.0L 4-Cylinder",
    "trim": "LX",
    "features": ["Air Conditioning", "Power Steering", "ABS", "Airbags"]
  }
}

Media Routes /media

MethodEndpointDescriptionAuth
POST/uploadUpload media file🔒
POST/upload-multipleUpload multiple files🔒
DELETE/:mediaIdDelete media🔒
GET/signed-urlGet signed upload URL🔒

Country Routes /countries

MethodEndpointDescriptionAuth
GET/List all countries
GET/supportedList supported countries
GET/:countryIdGet country by ID
GET/code/:codeGet country by code
GET/:countryId/currencyGet country currency

Message Routes /messages

MethodEndpointDescriptionAuth
GET/Get all conversations🔒
GET/:conversationIdGet conversation🔒
POST/Send message🔒
PUT/:messageId/readMark as read🔒
DELETE/:messageIdDelete message🔒

Notification Routes /notifications

MethodEndpointDescriptionAuth
GET/Get notifications🔒
GET/unread-countGet unread count🔒
PUT/:id/readMark as read🔒
PUT/read-allMark all as read🔒
DELETE/:idDelete notification🔒
PUT/settingsUpdate notification settings🔒

Billing Routes /api/billing

MethodEndpointDescriptionAuth
GET/plansGet subscription plans
POST/checkoutCreate checkout session🔒 Dealer
POST/webhookStripe webhookStripe
GET/subscriptionGet current subscription🔒 Dealer
POST/cancelCancel subscription🔒 Dealer
GET/invoicesGet invoices🔒 Dealer
GET/usageGet usage stats🔒 Dealer

Get Plans

http
GET /api/billing/plans?countryCode=ZA

Response:
{
  "plans": [
    {
      "id": "BASIC",
      "name": "Basic",
      "priceUsdCents": 1000,
      "displayCurrency": "ZAR",
      "displayAmount": 18500,
      "displayFormatted": "R185.00",
      "features": ["10 car listings", "Basic analytics"],
      "listingLimit": 10
    },
    {
      "id": "DEALER",
      "name": "Dealer",
      "priceUsdCents": 2500,
      "displayCurrency": "ZAR",
      "displayAmount": 46250,
      "displayFormatted": "R462.50",
      "features": ["50 car listings", "Lead management", "Featured slots"],
      "listingLimit": 50
    },
    {
      "id": "PRO",
      "name": "Pro",
      "priceUsdCents": 6000,
      "displayCurrency": "ZAR",
      "displayAmount": 111000,
      "displayFormatted": "R1,110.00",
      "features": ["Unlimited listings", "Priority placement", "Account manager"],
      "listingLimit": -1
    }
  ]
}

Dashboard Routes /api/dashboard

MethodEndpointDescriptionAuth
GET/metricsGet platform metricsAPI Key
GET/analyticsGet analytics dataAPI Key
GET/usersGet user statsAPI Key
GET/carsGet car statsAPI Key
GET/revenueGet revenue dataAPI Key

Blog Routes /api/blog

MethodEndpointDescriptionAuth
GET/postsGet blog posts
GET/posts/:slugGet post by slug
POST/postsCreate postAPI Key
PUT/posts/:idUpdate postAPI Key
DELETE/posts/:idDelete postAPI Key
GET/categoriesGet categories

Admin Routes

MethodEndpointDescriptionAuth
GET/admin/usersList all users🔒 Admin
GET/admin/dealersList all dealers🔒 Admin
GET/admin/carsList all cars🔒 Admin
GET/admin/reportsList reports🔒 Admin
PUT/admin/cars/:id/approveApprove car🔒 Admin
PUT/admin/cars/:id/rejectReject car🔒 Admin
PUT/admin/users/:id/banBan user🔒 Admin

Health Check

http
GET /health

Response:
{
  "success": true,
  "message": "Bamzu Car Marketplace API is running",
  "version": "1.0.0",
  "timestamp": "2024-03-15T10:30:00Z",
  "endpoints": {
    "auth": "/auth",
    "cars": "/cars",
    "dealers": "/dealers",
    "ai": "/ai",
    "vin": "/vin",
    "billing": "/api/billing"
  }
}

One chat. Everything done.