class OtpModel { final String userId; // Keep as String final String otp; OtpModel({required this.userId, required this.otp}); Map toJson() { return { 'user_id': userId, // Send as String 'otp': otp, }; } }