Login Register
API Docs

Create a payment with one API call, redirect the customer to the returned pay_url. The result is sent to your webhook.

1 · Create invoice

POST /api/create-invoice

cURL
PHP
Python
Node.js
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 user
import 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 here
const 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_url

Response: { "fatura_id": "...", "pay_url": "https://domhanda.com/pay/..." }

2 · Webhook

Set your webhook URL in the dashboard. When a payment settles, this is POSTed:

{
  "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
}
Fields
FieldDescription
order_idYour order reference
amountExpected amount
min_amountMinimum accepted amount
return_urlRedirect after payment
Copied!