MTI API Documentation

Comprehensive API documentation for the MetaTravel.ai platform. Explore endpoints, test requests, and integrate seamlessly.

Introduction

Welcome to the MetaTravel.ai API documentation. This comprehensive API provides access to the MTI platform's features, including user management, profile management, network/referral systems, investments, and much more.

Base URL Structure

All API requests should be prefixed with:

/api/v1

Laravel automatically adds the /api prefix to routes defined in the api.php file.

Example Usage

To access the login endpoint:

/api/v1/login

The API tester automatically handles URL formatting.

Authentication

Most endpoints require authentication using a Bearer token. Include the token in the Authorization header of your requests:

Authorization: Bearer your_token_here

Response Format

All responses are returned in JSON format with the following structure:

{
  "status": "success|error",
  "message": "A descriptive message",
  "data": {
    // Response data
  },
  "errors": {
    // Validation errors (if any)
  }
}

Authentication Endpoints

POST /v1/register

Register a new user (supports multipart/form-data for profile image)

Request Body (JSON or FormData)

{
  "full_name": "John Doe",
  "email": "[email protected]",
  "phonenumber": "1234567890",
  "address": "123 Main St", // Optional
  "date_of_birth": "1990-01-01",
  "referral_id": "ABC123", // Optional, defaults to "META01"
  "password": "SecurePassword123!",
  "password_confirmation": "SecurePassword123!",
  "profile_image": "[File]" // Optional, multipart upload
}
✓ Features
  • • Profile image upload support
  • • Automatic referral assignment
  • • Password confirmation validation
  • • Email verification system
📝 Notes

Used by mti_web frontend with enhanced validation and captcha verification.

POST /v1/login

Login and get an authentication token

Request Body

{
  "email": "[email protected]",
  "password": "SecurePassword123!"
}
✓ Response

Returns user data and Bearer token for authentication.

POST /v1/verify-otp

Verify OTP for email verification

Request Body

{
  "email": "[email protected]",
  "otp": "123456"
}
⚡ Quick Actions
Check OTP status: GET /v1/otp-status
Resend OTP: POST /v1/resend-otp
POST /v1/logout AUTH REQUIRED

Logout and invalidate the current token

Headers

Authorization: Bearer your_token_here

User & Profile Endpoints

GET /v1/user AUTH REQUIRED

Get the authenticated user's information

Headers

Authorization: Bearer your_token_here
GET /v1/profile AUTH REQUIRED

Get the authenticated user's detailed profile

Headers

Authorization: Bearer your_token_here
PUT /v1/profile AUTH REQUIRED

Update the authenticated user's profile (supports multipart/form-data for avatar)

Request Body

{
  "full_name": "John Smith",
  "phonenumber": "9876543210",
  "address": "456 New St",
  "date_of_birth": "1990-01-01",
  "referral_id": "ABC123", // Optional
  "profile_image": "[File]" // Optional, multipart upload
}
🔧 Available Actions
  • • Update avatar: POST /v1/profile/avatar
  • • Change password: POST /v1/profile/change-password
  • • Update email: POST /v1/profile/update-email
  • • Update wallet: POST /v1/profile/update-wallet
POST /v1/profile/change-password AUTH REQUIRED

Change user password

Request Body

{
  "current_password": "CurrentPassword123!",
  "password": "NewPassword123!",
  "password_confirmation": "NewPassword123!"
}
GET /v1/users/search AUTH REQUIRED

Search users by various criteria

Query Parameters

?q=search_term&field=name|email|phone

Network & Referral Endpoints

Network Features

💫 Network Structure

Multi-level referral system with upline and downline management

💰 Commission Tracking

Real-time commission calculations and payout management

📊 Analytics

Comprehensive network statistics and performance metrics

GET /v1/network AUTH REQUIRED

Get the authenticated user's complete network (upline and downlines)

Query Parameters

levels=5 // Optional, default: 5
✓ Returns

Complete network tree with user details, levels, and relationships.

GET /v1/network/downline AUTH REQUIRED

Get the authenticated user's downline network

Query Parameters

levels=5 // Optional, default: 5
page=1 // Optional, default: 1
per_page=15 // Optional, default: 15
GET /v1/network/stats AUTH REQUIRED

Get comprehensive network statistics and performance metrics

📈 Includes
  • • Total network size and levels
  • • Commission totals and breakdowns
  • • Active vs inactive members
  • • Performance rankings
GET /v1/network/commissions AUTH REQUIRED

Get detailed commission breakdown and earnings history

💰 Commission Types
• Direct referral commissions
• Multi-level bonuses
• Volume-based rewards
• Performance incentives
GET /v1/network/activity AUTH REQUIRED

Get recent network activity and member interactions

POST /v1/activity/log AUTH REQUIRED

Log user activity for tracking and analytics

Request Body

{
  "activity_type": "login|purchase|referral",
  "description": "Activity description",
  "metadata": {} // Optional additional data
}

Investment & VIP Endpoints

VIP Investment Features

💎 VIP Packages

Multiple investment tiers with varying returns and benefits

📈 Profit Distribution

Automated monthly profit sharing and payout management

GET /v1/investments/vip-details AUTH REQUIRED

Get available VIP package details and investment options

POST /v1/investments/create AUTH REQUIRED

Create a new VIP investment

Request Body

{
  "investment_type_id": 1,
  "amount": 1000.00,
  "payment_method": "wallet|external"
}
💡 Prerequisites
  • • Check eligibility first
  • • Ensure sufficient balance
  • • Review investment terms
GET /v1/investments/user AUTH REQUIRED

Get the user's current investments and their status

Payout Endpoints

📊 GET /v1/payouts

Get comprehensive payout history with filtering options

💰 GET /v1/payouts/summary

Get earnings summary and payout statistics

Testing & Development Endpoints

Development & Testing Tools

Comprehensive testing endpoints for development and debugging purposes.

🔍 API Health

Multiple endpoints to verify API connectivity and functionality

🔐 Auth Testing

Validate authentication flows and token management

⚙️ System Status

Check system health and automated processes

Basic API Tests

GET /v1/test
GET /v1/simple-test
GET /v1/direct-test

Authentication Tests

GET /v1/auth-test AUTH
GET /v1/get-test-token

VIP Payout System Tests

Testing endpoints for the automated VIP payout system:

GET /v1/payout-status
POST /v1/trigger-vip-payouts
GET /v1/payout-automation
⚠️ Development Only

These endpoints are for testing the automated payout system and should only be used in development environments.