Skip to content

Find (e-Vouchers)

Get the transaction status and PIN code.

Endpoint: POST /transaction/find

Request

bash
curl -X POST https://API-ENDPOINT/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-ENDPOINT/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-ENDPOINT/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-ENDPOINT/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": "0123456789XX",
    "serial": "SN123456789",
    "redemption_url": "https://redeem.paynet.one/"
  },
  "receipt": {
    "header": "Salik",
    "subheader": "Recharge Card",
    "info": "Merchant: PAYNET",
    "instruction": "Enter the PIN at salik.ae or Salik app",
    "footer": "Customer Service: 800 12345"
  }
}

Response Fields

FieldTypeDescription
transaction.stateintegerSee Transaction States
transaction.amountnumberVoucher face value
transaction.amount_currencystringVoucher currency
transaction.pricenumberAmount deducted from your wallet
transaction.price_currencystringYour wallet currency
transaction.errorstringError message if state = 2
infoobjectPIN data (see below)
receiptobjectReceipt information to display to customer

PIN Information

The info object contains the voucher details to display to the customer:

FieldTypeDescriptionExample
numberstringPIN code (optional)0123-4567-89XX
serialstringSerial number (optional)SN123456789
redemption_urlstringRedemption page URL (optional)https://redeem.paynet.one/

Display to Customer

All fields are optional, but at least one should exist.

Display the info.number (PIN) and receipt.instruction to guide the customer on how to use the voucher. If redemption_url is present, redirect the customer to that page to redeem the voucher.

Handling Different Voucher Types

Please note that serial and redemption_url are optional fields.

Salik

json
{
  "info": {
    "number": "1234-5678-9012",
    "serial": "SN123456"
  }
}

Steam

json
{
  "info": {
    "number": "XXXXX-XXXXX-XXXXX"
  }
}

MasterCard Prepaid Gift Cards

json
{
  "info": {
    "number": "0123456789XX",
    "redemption_url": "https://balance.mastercardgiftcard.com/"
  }
}

Visa Prepaid Gift Cards

json
{
  "info": {
    "redemption_url": "https://www.visa.com/redeem-card?code=0123456789XX"
  }
}

Some providers (e.g., MasterCard Prepaid Gift Cards) require the customer to visit a redemption page. When redemption_url is present, direct the customer to that URL to activate or redeem the voucher.

Important

The PIN is only available when state is 1 (success). See Transaction States for all possible values. If state is 0 or 6, the info object will be empty or incomplete.

Paynet API Documentation