Appearance
Confirm (International)
Execute the international top-up with selected denomination.
Endpoint: POST /transaction/confirm
Request
You must specify the amount from the Check response.
bash
curl -X POST https://api.paynet.one/transaction/confirm \
-H "Content-Type: application/json" \
-d '{
"auth": {
"id": 123,
"key": 1706360400001,
"hash": "b2c3d4e5f6a1..."
},
"external_transaction_id": "intl-12345",
"fields": {
"amount": 500,
"type_id": 1
}
}'php
<?php
$url = 'https://api.paynet.one/transaction/confirm';
$key = time() * 1000;
$data = [
'auth' => [
'id' => 123,
'key' => $key,
'hash' => md5(123 . $token . $key)
],
'external_transaction_id' => 'intl-12345',
'fields' => [
'amount' => 500, // PKR amount from check
'type_id' => 1 // Mobile
]
];
$response = apiRequest('/transaction/confirm', $data);
print_r($response);javascript
const key = Date.now();
const hash = md5(`123${token}${key}`);
const response = await fetch('https://api.paynet.one/transaction/confirm', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
auth: { id: 123, key, hash },
external_transaction_id: 'intl-12345',
fields: {
amount: 500, // PKR amount from check response
type_id: 1 // 1 = Mobile (default)
}
})
});
const data = await response.json();
console.log(data);python
import requests
import hashlib
import time
url = 'https://api.paynet.one/transaction/confirm'
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': 'intl-12345',
'fields': {
'amount': 500, # PKR amount from check
'type_id': 1 # Mobile
}
})
print(response.json())Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
external_transaction_id | string | Yes* | Your transaction ID from check |
transaction_id | string | Yes* | Paynet transaction ID from check |
fields.amount | number | Yes | Amount in local currency from check response |
fields.type_id | integer | No | Denomination type (default: 1 = Mobile) |
*Provide either external_transaction_id or transaction_id
Important
The amount must be one of the values from details.amounts[] in the Check response. It's the local currency amount (e.g., 500 PKR), not the AED price.
Response (Success)
json
{
"transaction": {
"id": "abc-123-def-456",
"external_transaction_id": "intl-12345",
"state": 1,
"time": "2024-01-27 12:00:05",
"service": {
"id": "intl",
"name": "Int-l Top-up"
},
"account": "+923001234567",
"amount": 500,
"amount_currency": "PKR",
"price": 24.75,
"price_currency": "AED"
},
"receipt": {
"header": "Ufone Pakistan",
"subheader": "Mobile Top-up",
"info": "Merchant: PAYNET",
"instruction": "",
"footer": "Customer Service: 800 1234"
}
}Response (Pending)
json
{
"transaction": {
"id": "abc-123-def-456",
"external_transaction_id": "intl-12345",
"state": 0,
"time": "2024-01-27 12:00:05",
"service": {
"id": "intl",
"name": "Int-l Top-up"
}
}
}Pending State
International transactions often take longer to process. If state is 0, call Find periodically until you receive a final state.
Response Fields
| Field | Type | Description |
|---|---|---|
transaction.state | integer | 1 = success, 0 = pending, 2 = failed |
transaction.amount | number | Amount credited to customer |
transaction.amount_currency | string | Customer's currency (e.g., PKR) |
transaction.price | number | Amount deducted from your wallet |
transaction.price_currency | string | Your currency (AED) |
Type ID Reference
| type_id | Type |
|---|---|
| 1 | Mobile (default) |
| 2 | Data / Bundle / Package |
| 3 | DTV |
| 4 | Internet |
| 5 | Gas |
| 6 | Power |
| 7 | Water |
| 8 | Viber |
Next Step
If state is not final, proceed to Find to poll for the result.