๐๏ธ Battle of Builders API
Outbid. Outbuild. Outlast.
โ
API is running and ready! Awaiting game client connections...
๐งช Test Credentials
Email: test@example.com
Password: password123
Starting Balance: $500,000
๐ก Available Endpoints
POST
/auth/login
Login with email and password to get JWT token
POST
/auth/register
Register new player account
GET
/player
Get player profile (requires JWT)
GET
/builds
List building types including min_duration_hours (floor on contract runtime from contract start) (requires JWT)
GET
/npcs
List NPCs and suppliers (requires JWT)
GET
/clients
List clients with requested build (build_id and build details; no separate budget โ costs come from builds) (requires JWT)
POST
/contracts/start
Start a contract: JSON { "client_id": number }. End time is max(nominal duration, min_duration_hours from build) so fast vehicles cannot shrink below the cap (requires JWT)
GET
/contracts/active
Get active construction contracts (requires JWT)
GET
/vehicles
All vehicle types merged with your garage: camelCase fields (vehicleID, vehicleName, unlocked, unlockLevel, unlockedCost, currentState, contractID, speed/efficiency levels and catalog multipliers). vehicleTypeId identifies the asset row for POST /vehicles/unlock (requires JWT)
GET
/player/vehicles
Same payload as GET /vehicles (legacy path) (requires JWT)
POST
/vehicles/unlock
JSON { "vehicle_type_id": number }. Pays unlock cost (unlock_cost or price), creates garage row (requires JWT)
POST
/vehicles/upgrade
JSON { "vehicle_id": number, "track": "speed" | "efficiency" }. Costs scale with base*costMultiplier^currentLevel; not allowed while busy (requires JWT)
POST
/vehicles/dispatch
JSON { "vehicle_id": number, "contract_id": number }. Marks vehicle busy and ties to contract; recalculates contract end time (requires JWT)
POST
/vehicles/return
JSON { "vehicle_id": number }. Clears busy state and contract assignment (requires JWT)
POST
/vehicles/buy
Legacy purchase (one row per vehicle type); same economy as unlock with optional starting engine/tool levels mapped to speed/efficiency tiers (requires JWT)
PUT
/contracts/{id}/assign-vehicle
JSON { "vehicle_id": number }. Same behaviour as POST /vehicles/dispatch; end time respects min_duration_hours (requires JWT)
GET
/leaderboard
Get global player rankings (requires JWT)
Dev / QA (JWT + DEV_ENDPOINTS_ENABLED or APP_DEBUG)
GET /DevVehicleEconomy โ formulas + catalog for Unity
POST /DevAccountRefresh โ reset starter state
POST /DevAccountDelete โ delete account + data
POST /DevAccountAddBalance โ JSON amount
POST /DevAccountSetLevel โ JSON level
POST /DevAccountSetXP โ JSON experience or xp
POST /DevCompleteContract โ JSON contract_id; skips end_time check
Grid persistence (JWT)
GET /player/grid โ all placed roads/zones/buildings
POST /player/grid/place โ save grid object
PUT /player/grid/{id} โ update state or placement
DELETE /player/grid/{id} โ remove object
Project BoB - Battle of Builders API