Appearance
Find (Direct Recharge)
Get the current status of a transaction.
Endpoint: POST /transaction/find
Request
bash
curl -X POST https://api.paynet.one/transaction/find \
-H "Content-Type: application/json" \
-d '{
"auth": {
"id": 123,
"key": 1706360400002,
"hash": "c3d4e5f6a1b2..."
},
"external_transaction_id": "order-12345"
}'php
<?php
$url = 'https://api.paynet.one/transaction/find';
$key = time() * 1000;
$data = [
'auth' => [
'id' => 123,
'key' => $key,
'hash' => md5(123 . $token . $key)
],
'external_transaction_id' => 'order-12345'
];
$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/find', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
auth: { id: 123, key, hash },
external_transaction_id: 'order-12345'
})
});
const data = await response.json();
console.log(data);python
import requests
import hashlib
import time
url = 'https://api.paynet.one/transaction/find'
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
},
'external_transaction_id': 'order-12345'
})
print(response.json())Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
external_transaction_id | string | Yes* | Your transaction ID |
transaction_id | string | Yes* | Paynet transaction ID |
*Provide either external_transaction_id or transaction_id
Response
json
{
"transaction": {
"id": "abc-123-def-456",
"external_transaction_id": "order-12345",
"state": 1,
"time": "2024-01-27 12:00:05",
"service": {
"id": "et-mc",
"name": "Etisalat Wasel Prepaid"
},
"account": "971550000000",
"amount": 50,
"amount_currency": "AED",
"price": 50,
"price_currency": "AED"
},
"receipt": {
"header": "Etisalat",
"subheader": "Wasel Prepaid",
"info": "Merchant: PAYNET, Terminal ID: 123",
"instruction": "",
"promo": "",
"footer": "Customer Service: 800 1234"
}
}Transaction States
| State | Final | Description | Action |
|---|---|---|---|
-1 | No | Reserved | Call Confirm |
0 | No | Pending | Keep polling Find |
1 | Yes | Success | Complete |
2 | Yes | Failed | Check error field |
3 | Yes | Cancelled | Complete |
4 | Yes | Replaced | Complete |
6 | No | Paused | Keep polling Find |
Best Practice
- Start with 5-second intervals
- Increase to 60-second intervals for long-pending transactions
- Log all responses for troubleshooting