Prerequisites
Before starting, make sure you have:- A Firebase project with Phone Authentication enabled
- The MechZie API base URL
socket_io_clientandrazorpay_flutterpackages in your Flutter project
API Environments
Production
Local Development
Client SDK Dependencies
Authenticate and Make Your First Call
1
Sign in with Firebase Phone OTP
Use the Firebase Auth SDK to verify the user’s phone number. This happens entirely client-side — the MechZie API is not involved yet.
2
Exchange Firebase token for MechZie JWT
Send the Firebase ID token to get your access and refresh tokens:Response:
3
Fetch your profile
Use the access token to make authenticated requests:Response:
If you get your user profile back, you’re authenticated and ready to go!
Create Your First Job
To get valid
service_category_id values, first call GET /api/v1/service-categories. Optionally include vehicle_id (from GET /api/v1/vehicles) and photo_urls (from File Uploads).Next Steps
Authentication
Token refresh, logout, admin invite flow
Real-time Events
Socket.io connection, live tracking, dispatch events
Job Lifecycle
State machine, dispatch tiers, cancellation rules
Payments
Razorpay checkout, webhook, cancellation fees
Error Handling
Error codes, rate limits, pagination
API Reference
All 56 REST endpoints with interactive examples
