Metadata-Version: 2.4
Name: achekverify
Version: 1.0.1
Summary: Official Python SDK for Achek — WhatsApp OTP, AI chatbots & business messaging for Nigeria
Project-URL: Homepage, https://achek.com.ng
Project-URL: Documentation, https://docs.achek.com.ng
Project-URL: Repository, https://github.com/CalebDevX/AchekVerify
Project-URL: Issues, https://github.com/CalebDevX/AchekVerify/issues
Author-email: Achek <dev@achek.com.ng>
License: MIT
Keywords: 2fa,achek,chatbot,nigeria,otp,verification,whatsapp
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Communications
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.8
Requires-Dist: requests>=2.28.0
Description-Content-Type: text/markdown

# achekverify — Python SDK

Official Python SDK for [Achek](https://achek.com.ng) — WhatsApp OTP verification, automated alerts, transaction notifications, and ticket tracking.

## Install

```bash
pip install achekverify
```

## Quick Start

```python
from achekverify import Achek

client = Achek(api_key="watp_live_xxxxxxxxxxxx")

# Send OTP
result = client.otp.send("+2348012345678")
request_id = result["requestId"]

# Verify OTP
verification = client.otp.verify(request_id, user_code)
if verification["valid"]:
    login_user()  # ✅
```

## OTP Verification

```python
# Simple send
result = client.otp.send("+2348012345678")

# With custom template (Growth+ plans)
result = client.otp.send(
    "+2348012345678",
    template="Hi {{name}}, your {{company}} code is {{code}}. Valid 10 mins.",
    recipient_name="Emeka",
    company_name="MyApp",
)

# Verify
result = client.otp.verify(request_id, "847293")
# {"valid": True, "message": "OTP verified successfully"}

# View logs
logs = client.otp.logs(limit=20, status="verified")
```

## Transaction Alerts

```python
client.alerts.transaction(
    "+2348012345678",
    type="debit",
    amount=15000,
    reference="TXN-20240519-001",
    account_name="Emeka Okafor",
    balance=240000,
    description="Transfer to Kuda",
)
# Sends WhatsApp message:
# 💸 Debit Alert
# Amount: ₦15,000.00
# Account: Emeka Okafor
# Ref: `TXN-20240519-001`
# Narration: Transfer to Kuda
# Balance: ₦240,000.00
```

## Custom Alerts

```python
client.alerts.send(
    "+2348012345678",
    "*Your account has been credited with ₦5,000* 🎉",
    category="notification",
)
```

## Ticket Tracking

```python
# Create ticket
ticket = client.tickets.create(
    "+2348012345678",
    "Payment not reflecting",
    description="Paid ₦5,000 but order not updated",
    priority="high",
    notify_customer=True,
)
ticket_id = ticket["ticketId"]

# Update
client.tickets.update(ticket_id, status="in_progress", notify_customer=True,
    notification_message="We're investigating — expect resolution in 2 hours.")

# Resolve
client.tickets.resolve(ticket_id, "Your issue has been fixed! Check your account.")
```

## Broadcasts

```python
client.broadcasts.send(
    name="Black Friday Promo",
    message="🔥 *50% OFF* today only! Code: *FRIDAY50*",
    recipients=["+2348012345678", "+2348087654321"],
)
```

## Error Handling

```python
from achekverify import Achek, AchekError

try:
    client.otp.send("+2348012345678")
except AchekError as e:
    print(e)            # "No active subscription..."
    print(e.status_code)  # 402
    print(e.code)        # "PHONE_NOT_VERIFIED" etc.
```
