MyTPEMyTPE Pay
Mytpe Pay

Get Mytpe Pay Global Stats

Retrieves global statistics for all Mytpe Pay instances associated with the authenticated user.

Get Mytpe Pay Global Stats

GET https://dev.mytpe.app/api/v2/mytpe-pay/global-stats

Retrieves global statistics, such as total instances and total active instances, for the authenticated user.

Authentication

Authentication: API Key (X-API-KEY + X-API-SECRET headers)

This endpoint requires authentication using X-API-KEY and X-API-SECRET headers.

X-API-KEY: {your_api_key}
X-API-SECRET: {your_api_secret}

Request Parameters

This endpoint does not require any request parameters.

Example Request

get-global-stats.js
const response = await fetch('https://dev.mytpe.app/api/v2/mytpe-pay/global-stats', {
  method: 'GET',
  headers: {
    'X-API-KEY': '{your_api_key}',
    'X-API-SECRET': '{your_api_secret}',
    'Accept': 'application/json'
  }
});

const data = await response.json();
console.log(data);
get-global-stats.ts
interface GlobalStatsResponse {
  success: boolean;
  message: string;
  data: {
    total_instances: number;
    active_instances: number;
    pending_instances: number;
    inactive_instances: number;
  };
}

const response = await fetch('https://dev.mytpe.app/api/v2/mytpe-pay/global-stats', {
  method: 'GET',
  headers: {
    'X-API-KEY': '{your_api_key}',
    'X-API-SECRET': '{your_api_secret}',
    'Accept': 'application/json'
  }
});

const data: GlobalStatsResponse = await response.json();
console.log(data);
get_global_stats.py
import requests

headers = {
    'X-API-KEY': '{your_api_key}',
    'X-API-SECRET': '{your_api_secret}',
    'Accept': 'application/json'
}

response = requests.get(
    'https://dev.mytpe.app/api/v2/mytpe-pay/global-stats',
    headers=headers
)

data = response.json()
print(data)
GetGlobalStats.php
use Illuminate\Support\Facades\Http;

$response = Http::withHeaders([
    'X-API-KEY' => '{your_api_key}',
    'X-API-SECRET' => '{your_api_secret}',
    'Accept' => 'application/json',
])->get('https://dev.mytpe.app/api/v2/mytpe-pay/global-stats');

$data = $response->json();
dd($data);
get-global-stats.php
$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'https://dev.mytpe.app/api/v2/mytpe-pay/global-stats',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_HTTPHEADER => [
        'X-API-KEY: {your_api_key}',
        'X-API-SECRET: {your_api_secret}',
        'Accept: application/json',
    ],
]);

$response = curl_exec($ch);
curl_close($ch);

$data = json_decode($response, true);
print_r($data);
get-global-stats.cjs
const axios = require('axios');

axios.get('https://dev.mytpe.app/api/v2/mytpe-pay/global-stats', {
  headers: {
    'X-API-KEY': '{your_api_key}',
    'X-API-SECRET': '{your_api_secret}',
    'Accept': 'application/json'
  }
})
.then(response => {
  console.log(response.data);
})
.catch(error => {
  console.error(error.response?.data || error.message);
});

Example Success Response

200 OK

{
    "success": true,
    "message": "Global statistics retrieved successfully",
    "data": {
        "total_instances": 15,
        "active_instances": 12,
        "pending_instances": 2,
        "inactive_instances": 1
    }
}

Error Responses

401 Authentication Failed

{
    "errors": [
        {
            "status": "401",
            "code": "API_KEY_INVALID",
            "title": "Invalid API key",
            "detail": "Authentication failed. Please check your API credentials."
        }
    ]
}

503 Statistics Unavailable

{
    "errors": [
        {
            "status": "503",
            "code": "STATISTICS_UNAVAILABLE",
            "title": "Statistics unavailable",
            "detail": "Unable to retrieve statistics at this time"
        }
    ]
}

On this page