Ödeme oluşturmak için API anahtarınızla tek bir istek atın, dönen pay_url'e kullanıcıyı yönlendirin. Sonuç webhook'unuza gelir.
POST /api/create-invoice
curl -X POST https://domhanda.com/api/create-invoice \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"order_id": "ORDER-123",
"amount": 100,
"min_amount": 50,
"return_url": "https://yoursite.com/thanks"
}'<?php
$ch = curl_init("https://domhanda.com/api/create-invoice");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
"Content-Type: application/json"
],
CURLOPT_POSTFIELDS => json_encode([
"order_id" => "ORDER-123",
"amount" => 100,
"min_amount" => 50,
"return_url" => "https://yoursite.com/thanks"
])
]);
$res = json_decode(curl_exec($ch), true);
header("Location: " . $res["pay_url"]); // redirect userimport requests
r = requests.post(
"https://domhanda.com/api/create-invoice",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"order_id": "ORDER-123",
"amount": 100,
"min_amount": 50,
"return_url": "https://yoursite.com/thanks",
},
)
pay_url = r.json()["pay_url"] # redirect the customer hereconst res = await fetch("https://domhanda.com/api/create-invoice", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
order_id: "ORDER-123",
amount: 100,
min_amount: 50,
return_url: "https://yoursite.com/thanks"
})
});
const { pay_url } = await res.json(); // redirect customer to pay_urlYanıt: { "fatura_id": "...", "pay_url": "https://domhanda.com/pay/..." }
Panelde webhook URL'nizi girin. Ödeme sonuçlanınca şu veri POST edilir:
{
"fatura_id": "abc123...",
"order_id": "ORDER-123",
"durum": "tamam", // tamam | aml_red | expired
"agi": "TRON",
"coin": "TRX",
"gelen": 100.0, // received amount
"musteriye": 97.5 // forwarded to your address
}
| Field | Açıklama |
|---|---|
| order_id | Sizin sipariş kimliğiniz |
| amount | Beklenen tutar |
| min_amount | Minimum kabul tutarı |
| return_url | Ödeme sonrası dönüş adresi |