﻿# API Documentation

## Response Format
All endpoints return JSON in this format:
- `success`: boolean
- `message`: string
- `data`: object or array when applicable

## Authentication APIs
- `API/Authentication/register.php` `POST`: register a new user.
- `API/Authentication/login.php` `POST`: authenticate and return JWT plus API token.
- `API/Authentication/logout.php` `POST`: destroy session and revoke API token if supplied.
- `API/Authentication/forgot_password.php` `POST`: request reset token or complete password reset.
- `API/Authentication/change_password.php` `POST`: change password for the authenticated user.

## Subscription APIs
- `API/Subscription/subscription_status.php` `GET|POST`: fetch current user subscription and available plans.
- `API/Subscription/renew_subscription.php` `POST`: renew the authenticated user subscription.

## License APIs
- `API/License/verify_license.php` `POST`: verify license key and optional MT5 account.
- `API/License/validate_license.php` `GET|POST`: validate the authenticated user's license and linked subscription.

## Strategy APIs
- `API/Strategy/get_strategy.php` `GET|POST`: retrieve active strategies by symbol, with auth or license credentials.
- `API/Strategy/update_strategy.php` `POST`: admin-only strategy create/update endpoint.

## Signal APIs
- `API/Signals/get_signals.php` `GET|POST`: retrieve MT5 client signals by license or authenticated user session.
- `API/Signals/close_signal.php` `POST`: admin-only signal close/update endpoint.

## MT5 APIs
- `API/MT5/validate_mt5_account.php` `GET|POST`: validate an MT5 account for the authenticated user.
- `API/MT5/update_mt5_account.php` `POST`: add or update an MT5 account.

## Payment APIs
- `API/Payment/payment_verify.php` `POST`: verify Razorpay or Stripe payment data and renew subscription when paid.
- `API/Payment/payment_history.php` `GET|POST`: list authenticated user payments.

## System APIs
- `API/System/version_check.php` `GET|POST`: return API and runtime version details.
- `API/System/server_status.php` `GET|POST`: return service availability and timestamp.
