Appearance
Find (e-Vouchers)
Get the transaction status and PIN code.
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": "voucher-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' => 'voucher-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);
if ($result['transaction']['state'] == 1) {
echo "PIN: " . $result['info']['number'] . "\n";
echo "Serial: " . $result['info']['serial'] . "\n";
}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: 'voucher-12345'
})
});
const data = await response.json();
if (data.transaction.state === 1) {
console.log('PIN:', data.info.number);
console.log('Serial:', data.info.serial);
}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': 'voucher-12345'
})
data = response.json()
if data['transaction']['state'] == 1:
print('PIN:', data['info']['number'])
print('Serial:', data['info']['serial'])Response (Success)
json
{
"transaction": {
"id": "abc-123-def-456",
"external_transaction_id": "voucher-12345",
"state": 1,
"time": "2024-01-27 12:00:05",
"service": {
"id": "slk100",
"name": "Salik Recharge Card - AED 100"
},
"account": "[email protected]",
"amount": 100,
"amount_currency": "AED",
"price": 100,
"price_currency": "AED"
},
"info": {
"number": "5678-1234-9012-3456",
"serial": "SN123456789"
},
"receipt": {
"header": "Salik",
"subheader": "Recharge Card",
"info": "Merchant: PAYNET",
"instruction": "Enter the PIN at salik.ae or Salik app",
"footer": "Customer Service: 800 12345"
}
}PIN Information
The info object contains the voucher details to display to the customer:
| Field | Description | Example |
|---|---|---|
number | PIN code | 5678-1234-9012-3456 |
serial | Serial number (optional) | SN123456789 |
Display to Customer
Show the info.number (PIN) and receipt.instruction to guide the customer on how to use the voucher.
Handling Different Voucher Types
Please note that serial is an optional field.
Salik
json
{
"info": {
"number": "1234-5678-9012",
"serial": "SN123456"
}
}Steam
json
{
"info": {
"number": "XXXXX-XXXXX-XXXXX"
}
}Important
The PIN is only available when state: 1. If state: 0 or 6, the info object will be empty or incomplete.