Back

API Documentation

Integrate with Paymatic using our RESTful API.

Contents

Introduction Authentication Prices Mining Plans User Transactions Deposit Withdraw Referral Mining Platform Stats Error Handling

Introduction

The Paymatic API provides programmatic access to platform data including real-time mining statistics, coin prices, and user information. All endpoints return JSON responses.

Base URL: https://api.paymatic.cloud/v1

Authentication

Authenticate by including your API key in the request header:

Authorization: Bearer your-api-key-here

To request an API key, create a support ticket or contact support@paymatic.cloud.

Rate Limit: 60 requests per minute per API key.

Prices

GET /prices
Get real-time USD prices for all supported coins.

Response

{
  "POL": 0.65,
  "WBTC": 67800.00,
  "WETH": 3450.00,
  "USDT": 1.00,
  "USDC": 1.00,
  "DAI": 1.00
}
# Get all prices
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/prices
$ch = curl_init('https://api.paymatic.cloud/v1/prices');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
print_r($data);
GET /prices/{coin}
Get the current price for a specific coin.
ParameterTypeDescription
coinstringCoin symbol (e.g. POL, WBTC, USDT)

Response

{
  "symbol": "POL",
  "price": 0.65,
  "updated_at": "2025-01-15T12:00:00Z"
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/prices/POL
$coin = 'POL';
$ch = curl_init("https://api.paymatic.cloud/v1/prices/{$coin}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "POL price: $" . $data['price'];

Mining Plans

GET /plans
List all available mining plans with pricing and quota.

Response

{
  "plans": [
    {
      "id": 1,
      "name": "StakePool Blue",
      "price": 25.00,
      "daily_return": "0.15%",
      "max_return": "150%",
      "quota": 150000,
      "active": 1
    }
  ]
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/plans
$ch = curl_init('https://api.paymatic.cloud/v1/plans');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
$plans = json_decode($response, true)['plans'];
foreach ($plans as $plan) {
  echo $plan['name'] . " - $" . $plan['price'] . "\n";
}
GET /plans/{id}
Get details for a specific mining plan.
ParameterTypeDescription
idintegerMining plan ID
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/plans/1
$id = 1;
$ch = curl_init("https://api.paymatic.cloud/v1/plans/{$id}");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
print_r(json_decode($response, true));

User

Note: All user endpoints require the Authorization header.
GET /user/profile
Get the authenticated user's profile information.

Response

{
  "username": "johndoe",
  "email": "john@example.com",
  "balance": 1250.50,
  "upp_balance": 340.20,
  "referral_code": "ABC123",
  "total_referrals": 12,
  "wallet_address": "0x...",
  "created_at": "2024-03-10T08:30:00Z"
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/user/profile
$ch = curl_init('https://api.paymatic.cloud/v1/user/profile');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$profile = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "Welcome back, " . $profile['username'] . "!";
POST /user/update-wallet
Update the user's connected wallet address.
ParameterTypeDescription
wallet_addressstringNew wallet address (Polygon)
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"wallet_address":"0x..."}' \
  https://api.paymatic.cloud/v1/user/update-wallet
$data = json_encode([
  'wallet_address' => '0x...'
]);
$ch = curl_init('https://api.paymatic.cloud/v1/user/update-wallet');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY',
  'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;

Transactions

GET /user/transactions
Get paginated transactions for the authenticated user.
ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerResults per page (default: 20, max: 100)
typestringFilter by type (deposit, withdraw, mining, commission, transfer_in, transfer_out, bonus, claim, plan_purchase)

Response

{
  "transactions": [
    {
      "id": 1001,
      "type": "deposit",
      "amount": 100.00,
      "coin": "USDT",
      "tx_hash": "0x...",
      "created_at": "2025-01-15T12:00:00Z"
    }
  ],
  "page": 1,
  "total_pages": 5,
  "total": 95
}
# Get page 2, filtered by mining type
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.paymatic.cloud/v1/user/transactions?page=2&limit=10&type=mining"
$params = http_build_query([
  'page' => 2,
  'limit' => 10,
  'type' => 'mining'
]);
$ch = curl_init("https://api.paymatic.cloud/v1/user/transactions?$params");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
foreach ($result['transactions'] as $tx) {
  echo $tx['type'] . " - $" . $tx['amount'] . "\n";
}

Deposit

GET /deposit/coins
Get list of coins available for deposit with wallet addresses and network info.

Response

{
  "coins": [
    {
      "symbol": "POL",
      "name": "Polygon",
      "wallet_address": "0x...",
      "network": "Polygon",
      "min_deposit": 10.00,
      "active": 1
    }
  ]
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/deposit/coins
$ch = curl_init('https://api.paymatic.cloud/v1/deposit/coins');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$coins = json_decode(curl_exec($ch), true)['coins'];
curl_close($ch);
foreach ($coins as $c) {
  echo $c['symbol'] . ": " . $c['wallet_address'] . "\n";
}
GET /user/deposits
Get the authenticated user's deposit history.
ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerResults per page (default: 20)
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/user/deposits?page=1&limit=10
$ch = curl_init('https://api.paymatic.cloud/v1/user/deposits?page=1&limit=10');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$deposits = json_decode(curl_exec($ch), true);
curl_close($ch);
print_r($deposits);

Withdraw

GET /withdraw/coins
Get list of coins available for withdrawal with contract details.

Response

{
  "coins": [
    {
      "symbol": "TPAY",
      "name": "Paymatic Token",
      "token_address": "0x8DF4c954C51E5ccBa51b8a21cC3fF6347760b31a",
      "decimals": 18,
      "min_withdraw": 10.00,
      "fee_percent": 10
    }
  ]
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/withdraw/coins
$ch = curl_init('https://api.paymatic.cloud/v1/withdraw/coins');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$coins = json_decode(curl_exec($ch), true)['coins'];
curl_close($ch);
foreach ($coins as $c) {
  echo $c['symbol'] . " - " . $c['token_address'] . "\n";
}
POST /withdraw/get-permit
Get an EIP-712 signed permit for on-chain withdrawal. Requires the user to have sufficient UPP balance and the withdrawal amount to be within limits.
ParameterTypeDescription
coinstringCoin symbol (e.g. TPAY)
amountfloatWithdrawal amount in USD
walletstringUser's receiving wallet address
nonceintegerCurrent on-chain nonce for the user
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "coin":"TPAY",
  "amount":50.00,
  "wallet":"0xRecipientAddressHere",
  "nonce":1
}' \
  https://api.paymatic.cloud/v1/withdraw/get-permit
$data = json_encode([
  'coin'   => 'TPAY',
  'amount' => 50.00,
  'wallet' => '0xRecipientAddressHere',
  'nonce'  => 1
]);
$ch = curl_init('https://api.paymatic.cloud/v1/withdraw/get-permit');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY',
  'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$permit = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "Signature: " . $permit['signature'];
POST /withdraw/submit
Record an on-chain withdrawal transaction hash after the user has broadcast the permit to the contract.
ParameterTypeDescription
coinstringCoin symbol
amountfloatWithdrawal amount in USD
tx_hashstringPolygonscan transaction hash
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "coin":"TPAY",
  "amount":50.00,
  "tx_hash":"0x..."
}' \
  https://api.paymatic.cloud/v1/withdraw/submit
$data = json_encode([
  'coin'     => 'TPAY',
  'amount'   => 50.00,
  'tx_hash'  => '0x...'
]);
$ch = curl_init('https://api.paymatic.cloud/v1/withdraw/submit');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY',
  'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
echo $result;

Referral

GET /user/referrals
Get the authenticated user's referral list with earnings breakdown.

Response

{
  "referral_code": "ABC123",
  "referral_link": "https://paymatic.cloud?ref=ABC123",
  "total_referrals": 12,
  "total_earned": 245.80,
  "levels": {
    "level_1": { "count": 8, "earned": 180.00, "percent": 3 },
    "level_2": { "count": 3, "earned": 45.00, "percent": 0.5 },
    "level_3": { "count": 1, "earned": 20.80, "percent": 0.2 }
  },
  "referrals": [
    {
      "username": "janedoe",
      "level": 1,
      "earned_from_them": 45.00,
      "joined_at": "2024-06-01T10:00:00Z"
    }
  ]
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/user/referrals
$ch = curl_init('https://api.paymatic.cloud/v1/user/referrals');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$refs = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "Referral link: " . $refs['referral_link'] . "\n";
echo "Total earned: $" . $refs['total_earned'];

Mining

GET /user/plans
Get the authenticated user's active and past mining plans.

Response

{
  "active_plans": [
    {
      "plan_id": 1,
      "plan_name": "StakePool Blue",
      "invested": 100.00,
      "daily_return": "0.15%",
      "total_earned": 12.50,
      "started_at": "2025-01-01T00:00:00Z"
    }
  ],
  "total_invested": 500.00,
  "total_earned": 67.30
}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://api.paymatic.cloud/v1/user/plans
$ch = curl_init('https://api.paymatic.cloud/v1/user/plans');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$plans = json_decode(curl_exec($ch), true);
curl_close($ch);
echo "Active plans: " . count($plans['active_plans']) . "\n";
echo "Total earned: $" . $plans['total_earned'];
POST /user/purchase-plan
Purchase a mining plan using the user's balance.
ParameterTypeDescription
plan_idintegerID of the mining plan to purchase
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"plan_id":1}' \
  https://api.paymatic.cloud/v1/user/purchase-plan
$data = json_encode(['plan_id' => 1]);
$ch = curl_init('https://api.paymatic.cloud/v1/user/purchase-plan');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY',
  'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = json_decode(curl_exec($ch), true);
curl_close($ch);
if ($result['success']) {
  echo "Plan purchased!";
} else {
  echo "Error: " . $result['message'];
}

Platform Stats

GET /stats
Get global platform statistics (no auth required).

Response

{
  "total_users": 150000,
  "total_paid_out": 4200000.00,
  "active_miners": 45000,
  "total_mined": 8900000.00,
  "plans_active": 62000,
  "uptime": "99.9%"
}
curl https://api.paymatic.cloud/v1/stats
$stats = json_decode(file_get_contents(
  'https://api.paymatic.cloud/v1/stats'
), true);
echo "Total users: " . number_format($stats['total_users']);

Error Handling

The API uses standard HTTP response codes to indicate success or failure:

200 Success
201 Created
400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
422 Validation Error
429 Rate Limited
500 Internal Server Error

Error responses return a JSON object with details:

{
  "error": "invalid_request",
  "message": "The request parameters are invalid.",
  "details": {
    "amount": ["The amount field is required."]
  }
}
# Example: missing required field
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}' \
  https://api.paymatic.cloud/v1/withdraw/get-permit
# Response: 422
# {"error":"validation_error","message":"The coin field is required.","details":{"coin":["The coin field is required."]}}
$ch = curl_init('https://api.paymatic.cloud/v1/withdraw/get-permit');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
  'Authorization: Bearer YOUR_API_KEY',
  'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode >= 400) {
  $error = json_decode($response, true);
  echo "Error [$httpCode]: " . $error['message'];
}