Skip to content

Check (International)

Validate the phone number and get available denominations.

Endpoint: POST /transaction/check

Request

Use product: "intl" for all international top-ups.

bash
curl -X POST https://api.paynet.one/transaction/check \
  -H "Content-Type: application/json" \
  -d '{
    "auth": {
      "id": 123,
      "key": 1706360400000,
      "hash": "a1b2c3d4e5f6..."
    },
    "product": "intl",
    "external_transaction_id": "intl-12345",
    "fields": {
      "customer": "+923001234567",
      "account": "+923001234567"
    }
  }'
php
<?php
$url = 'https://api.paynet.one/transaction/check';
$key = time() * 1000;

$data = [
    'auth' => [
        'id' => 123,
        'key' => $key,
        'hash' => md5(123 . $token . $key)
    ],
    'product' => 'intl',
    'external_transaction_id' => 'intl-12345',
    'fields' => [
        'customer' => '+923001234567',
        'account' => '+923001234567'
    ]
];

$response = apiRequest('/transaction/check', $data);
print_r($response['details']['amounts']);
javascript
const key = Date.now();
const hash = md5(`123${token}${key}`);

const response = await fetch('https://api.paynet.one/transaction/check', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    auth: { id: 123, key, hash },
    product: 'intl',
    external_transaction_id: 'intl-12345',
    fields: {
      customer: '+923001234567',
      account: '+923001234567'
    }
  })
});

const data = await response.json();
console.log('Available amounts:', data.details.amounts);
python
import requests
import hashlib
import time

url = 'https://api.paynet.one/transaction/check'
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
    },
    'product': 'intl',
    'external_transaction_id': 'intl-12345',
    'fields': {
        'customer': '+923001234567',
        'account': '+923001234567'
    }
})

data = response.json()
print('Available amounts:', data['details']['amounts'])

Request Fields

FieldTypeRequiredDescription
productstringYesAlways "intl" for international
external_transaction_idstringRecommendedYour unique transaction ID
fields.customerstringNoCustomer phone or email
fields.accountstringYesSame as customer
fields.amount_type_idsarrayNoFilter by type: [1, 2]

Optional: Filter by Type

You can filter denominations by passing amount_type_ids:

json
{
  "fields": {
    "customer": "+923001234567",
    "account": "+923001234567",
    "amount_type_ids": [1, 2]
  }
}

Response

json
{
  "transaction": {
    "id": "abc-123-def-456",
    "external_transaction_id": "intl-12345",
    "state": -1,
    "time": "2024-01-27 12:00:00",
    "account": "+923001234567"
  },
  "details": {
    "country": "Pakistan",
    "operator": "Ufone Pakistan",
    "amounts": [
      {
        "type_id": 1,
        "amount": 100.00,
        "currency": "PKR",
        "sale_price": 5.00,
        "sale_currency": "AED",
        "price": 4.95,
        "price_currency": "AED"
      },
      {
        "type_id": 1,
        "amount": 500.00,
        "currency": "PKR",
        "sale_price": 25.00,
        "sale_currency": "AED",
        "price": 24.75,
        "price_currency": "AED"
      },
      {
        "type_id": 2,
        "amount": 1000.00,
        "currency": "PKR",
        "sale_price": 45.00,
        "sale_currency": "AED",
        "price": 44.55,
        "price_currency": "AED"
      }
    ]
  }
}

Response Fields

FieldDescription
details.countryDetected country
details.operatorDetected operator
details.amountsAvailable denominations
details.amounts[].amountValue in local currency
details.amounts[].priceYour cost in AED
details.amounts[].sale_priceSuggested retail price
details.amounts[].type_idDenomination type

Display to Customer

Show the customer the available amounts from details.amounts:

javascript
const amounts = response.details.amounts;

amounts.forEach(a => {
  console.log(`${a.amount} ${a.currency} - ${a.sale_price} ${a.sale_currency}`);
});

// Output:
// 100 PKR - 5 AED
// 500 PKR - 25 AED
// 1000 PKR - 45 AED

Next Step

After customer selects an amount, proceed to Confirm with the chosen denomination.

Paynet API Documentation