Skip to content

Check (Direct Recharge)

Validate the phone number and reserve a transaction.

Endpoint: POST /transaction/check

Request

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

$data = [
    'auth' => [
        'id' => 123,
        'key' => $key,
        'hash' => md5(123 . $token . $key)
    ],
    'product' => 'et-mc',
    'external_transaction_id' => 'order-12345',
    'fields' => [
        'customer' => '971550000000',
        'account' => '971550000000',
        'amount' => 50
    ]
];

$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 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: 'et-mc',
    external_transaction_id: 'order-12345',
    fields: {
      customer: '971550000000',
      account: '971550000000',
      amount: 50
    }
  })
});

const data = await response.json();
console.log(data);
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': 'et-mc',
    'external_transaction_id': 'order-12345',
    'fields': {
        'customer': '971550000000',
        'account': '971550000000',
        'amount': 50
    }
})

print(response.json())

Request Fields

FieldTypeRequiredDescription
productstringYesService ID (e.g., et-mc, du-mt)
external_transaction_idstringRecommendedYour unique transaction ID (max 30 chars)
fields.customerstringNoCustomer phone or email
fields.accountstringYesAccount number (same as customer for mobile)
fields.amountnumberYesRecharge amount
simulationbooleanNoSet true for test transactions

Response

json
{
  "transaction": {
    "id": "abc-123-def-456",
    "external_transaction_id": "voucher-12345",
    "state": -1,
    "time": "2024-01-27 12:00:00",
    "account": "971550000000",
    "amount": 100,
    "amount_currency": "AED",
    "price": 100,
    "price_currency": "AED"
  }
}

Response Fields

FieldTypeDescription
transaction.idstringPaynet transaction ID
transaction.stateinteger-1 = reserved
transaction.amountnumberVoucher face value
transaction.pricenumberYour cost (with commission)

Next Step

After successful check, proceed to Confirm the transaction.

Paynet API Documentation