Base URL: http://localhost/2ndPay.in/api
Version: 1.0.0
Authentication: JWT Bearer Token
Content-Type: application/json
✅ All endpoints are working correctly. Firebase phone authentication endpoints added and routed successfully.
{
"success": true,
"message": "Success message",
"data": {...},
"timestamp": "2025-09-27 12:00:00"
}
{
"success": false,
"message": "Error message",
"errors": {...},
"timestamp": "2025-09-27 12:00:00"
}
New Firebase-based phone authentication system for React Native app. Supports E.164 format (+919876543210).
Development Mode: In development (APP_ENV='development'), OTPs
are logged to /logs/test_otps.log instead of being sent via SMS.
Send OTP to phone number (Firebase Phone Auth)
Sends a 6-digit OTP to the provided phone number. Returns verificationId for OTP verification.
{
"phoneNumber": "+919876543210"
}
{
"success": true,
"message": "OTP sent successfully",
"data": {
"verificationId": "abc123xyz456",
"expiresIn": 300
}
}
Verify OTP and authenticate (Firebase Phone Auth)
Verifies OTP and returns JWT token. Auto-creates user on first login. Supports both Firebase and legacy formats.
{
"verificationId": "abc123xyz456",
"phoneNumber": "+919876543210",
"otp": "123456"
}
{
"mobile": "9876543210",
"otp": "123456"
}
{
"success": true,
"message": "Login successful",
"data": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"user": {
"id": 123,
"name": "User",
"phoneNumber": "+919876543210",
"email": null,
"role": "customer",
"phoneVerified": true,
"isNewUser": false
},
"expiresIn": 2592000
}
}
Register a new user account (Legacy)
{
"name": "John Doe",
"mobile": "9876543210",
"email": "john@example.com"
}
Login with mobile number - sends OTP (Legacy)
{
"mobile": "9876543210"
}
Agent login with mobile and password
{
"mobile": "9876543210",
"password": "agent123"
}
Bearer <token>
Get list of active mobile brands
Get models for a specific brand
Get detailed model information including parts and variants
Create a new sell request
{
"brand_id": 1,
"model_id": 1,
"imei": "123456789012345",
"pickup_address": "123 Main St, City",
"pickup_date": "2025-09-28",
"pickup_time_slot": "morning",
"special_instructions": "Call before coming"
}
Get orders assigned to the authenticated agent
Get detailed information about a specific order
Update order status
{
"status": "collected",
"remarks": "Device collected successfully"
}
Get available pickup time slots
Get application configuration and settings
Response will appear here...
/api/index.php routing/logs/app_*.log.htaccess CORS headers are enabled
/logs/test_otps.log
filephone_otps
table/auth/send-otp with phone number/logs/test_otps.log for OTP (development mode)/auth/verify-otp with verificationId, phone, and OTP