Skip to content

Balance

Get the current balance of your account wallets.

Endpoint: POST /balance

Request

bash
curl -X POST https://api.paynet.one/balance \
  -H "Content-Type: application/json" \
  -d '{
    "auth": {
      "id": 123,
      "key": 1706360400000,
      "hash": "a1b2c3d4e5f6..."
    }
  }'
php
<?php
$url = 'https://api.paynet.one/balance';
$data = [
    'auth' => [
        'id' => 123,
        'key' => time() * 1000,
        'hash' => md5(123 . $token . time() * 1000)
    ]
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

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

$result = json_decode($response, true);
print_r($result);
javascript
const response = await fetch('https://api.paynet.one/balance', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    auth: {
      id: 123,
      key: Date.now(),
      hash: md5(`123${token}${Date.now()}`)
    }
  })
});

const data = await response.json();
console.log(data);
python
import requests
import hashlib
import time

url = 'https://api.paynet.one/balance'
key = int(time.time() * 1000)
hash_value = hashlib.md5(f"123{token}{key}".encode()).hexdigest()

response = requests.post(url, json={
    'auth': {
        'id': 123,
        'key': key,
        'hash': hash_value
    }
})

print(response.json())

Response

json
{
  "currency": "AED",
  "wallets": {
    "main": 1250.50
  }
}

Response Fields

FieldTypeDescription
currencystringAccount currency (e.g., "AED")
walletsobjectWallet balances
wallets.mainnumberMain wallet balance

TIP

Check your balance before processing transactions to ensure sufficient funds.

Paynet API Documentation