Tez, xavfsiz va ishonchli to'lov tizimi uchun ishlab chiqilgan API hujjatlari.
API dan foydalanish uchun sizga shop_id va shop_key kerak bo‘ladi.
Yangi to'lov buyurtmasini yaratish.
| Parametr | Turi | Tavsif |
|---|---|---|
| method | string | create bo‘lishi shart |
| shop_id | string | Do'kon identifikatori |
| shop_key | string | Do'kon maxfiy kaliti |
| amount | string | To'lov miqdori |
'create',
'amount' => '1000',
'shop_id' => '12345',
'shop_key' => 'test12345'
];
$ch = curl_init('https://url.tezapi.ru/api');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
?>
{
"status": "success",
"order": "owld1002",
"insert_id": 123,
"data": { "amount": 10000 }
}
Buyurtma statusini tekshirish.
https://url.tezapi.ru/check?order=$orderId
{
"status": "success",
"order": "owld1002",
"data": {
"amount": 10000,
"status": "pending",
"date": "2023-05-15"
}
}
To‘lov muvaffaqiyatli bajarilganda siz ko‘rsatgan callback_url ga ma’lumot yuboriladi.
{
"status": "paid",
"order": "owld1002",
"amount": 10000,
"date": "2023-05-15 14:32:00"
}
| Xato | Tavsif |
|---|---|
| Do'kon topilmadi! | shop_id yoki shop_key noto‘g‘ri |
| Do'kon faol emas! | Do‘konni faollashtirmagansiz |
| Oylik to'lov qilinmagan! | Oylik to‘lov amalga oshirilmagan |
| Hisob ulanmagan! | Telefon raqam do‘konga ulangan emas |