Appearance
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
| Field | Type | Required | Description |
|---|---|---|---|
product | string | Yes | Service ID (e.g., et-mc, du-mt) |
external_transaction_id | string | Recommended | Your unique transaction ID (max 30 chars) |
fields.customer | string | No | Customer phone or email |
fields.account | string | Yes | Account number (same as customer for mobile) |
fields.amount | number | Yes | Recharge amount |
simulation | boolean | No | Set 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
| Field | Type | Description |
|---|---|---|
transaction.id | string | Paynet transaction ID |
transaction.state | integer | -1 = reserved |
transaction.amount | number | Voucher face value |
transaction.price | number | Your cost (with commission) |
Next Step
After successful check, proceed to Confirm the transaction.