Oddiy GET so'rovlar bilan ishlaydigan to'lov API.
Faqat shop_id va shop_key bilan ishlang!
Quyidagi test kalitlari bilan API ni sinab ko'ring:
shop_id: 101
shop_key: test_key_123
shop_id: 102
shop_key: test_key_456
Do'kon ma'lumotlarining haqiqiyligini tekshiradi.
GET /api/check_shop?shop_id=YOUR_SHOP_ID&shop_key=YOUR_SHOP_KEY
// Javob:
{
"success": true,
"valid": true,
"shop_id": "123"
}
// YOKI
{
"success": false,
"valid": false,
"error": "Invalid shop key"
}
import requests
# Do'konni tekshirish
response = requests.get(
"https://sizning-domeningiz.uz/api/check_shop",
params={
"shop_id": "YOUR_SHOP_ID",
"shop_key": "YOUR_SHOP_KEY"
}
)
if response.status_code == 200:
data = response.json()
if data.get('success') and data.get('valid'):
print("✅ Do'kon mavjud va aktiv")
else:
print(f"❌ Xatolik: {data.get('error')}")
else:
print(f"❌ Server xatosi: {response.status_code}")
Do'kon balansini UZS da qaytaradi.
GET /api/get_balance?shop_id=YOUR_SHOP_ID&shop_key=YOUR_SHOP_KEY
// Javob:
{
"success": true,
"shop_id": "123",
"balance": 50000.00,
"balance_formatted": "50000.00 UZS"
}
Yangi to'lov yaratadi va order_id qaytaradi.
GET /api/create_payment?shop_id=YOUR_SHOP_ID&shop_key=YOUR_SHOP_KEY&amount=1000.00
// Javob:
{
"success": true,
"payment_id": "PAY_1701234567_abc123",
"order_id": "ORD_1701234567_xyz789",
"shop_id": "123",
"amount": 10000.00,
"amount_formatted": "10000.00 UZS",
"created_at": "2024-01-01 12:00:00",
"status": "pending"
}
check_payment endpointidan foydalaning.
Buyurtma holatini tekshiradi.
GET /api/check_payment?order_id=ORDER_ID
// Javob:
{
"success": true,
"order_id": "ORD_1701234567_xyz789",
"shop_id": "123",
"shop_name": "My Shop",
"amount": 10000.00,
"status": "paid",
"status_description": "To'lov muvaffaqiyatli",
"created_at": "2024-01-01 12:00:00"
}
Do'konning so'nggi to'lovlarini olish.
GET /api/get_payments?shop_id=YOUR_SHOP_ID&shop_key=YOUR_SHOP_KEY&limit=10&offset=0