Get your API Key from Dashboard → Brands. Send the X-API-KEY header with every request. Keep the key only on the server.
POST https://payment.ukland.top/api/create.php
{
"amount": 500,
"customer_name": "Rahim",
"customer_contact": "01700000000",
"success_url": "https://shop.com/success",
"cancel_url": "https://shop.com/cancel",
"webhook_url": "https://shop.com/webhook",
"metadata": {"order_id": "A100"}
}Response:
{"success":true,"payment_id":"…","payment_url":"https://payment.ukland.top/pay.php?id=…"}Send the customer to the payment_url.
GET https://payment.ukland.top/api/verify.php?payment_id=ID
{"success":true,"payment_id":"…","amount":"500.00","status":"completed","trx_id":"…","sender_number":"…","metadata":{"order_id":"A100"}}Status: created, pending, completed, rejected. Before fulfilling an order, always check that status = completed and the amount matches.
$ch = curl_init('https://payment.ukland.top/api/create.php');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['X-API-KEY: YOUR_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode(['amount' => 500, 'success_url' => 'https://shop.com/success']),
]);
$res = json_decode(curl_exec($ch), true);
header('Location: ' . $res['payment_url']);When the status changes, a JSON POST is sent with X-Signature = HMAC-SHA256(body, Secret Key). It is sent only once, so also use the verify API.
$body = file_get_contents('php://input');
if (!hash_equals(hash_hmac('sha256', $body, $secret), $_SERVER['HTTP_X_SIGNATURE'] ?? '')) { http_response_code(401); exit; }