Metadata-Version: 2.5
Name: seenwa
Version: 0.4.0
Summary: Official Python SDK for the Seen WhatsApp Business API.
Project-URL: Homepage, https://seen.com
License: MIT
License-File: LICENSE
Requires-Python: >=3.8
Requires-Dist: requests>=2.32.4
Description-Content-Type: text/markdown

# seenwa

Python SDK for the Seen WhatsApp Business API.

## Install

```bash
pip install seenwa
```

## Usage

```python
from seenwa import SeenClient

client = SeenClient(api_key="YOUR_API_KEY")
```

## Plan errors

When a request is blocked by the account's plan (for example the plan does not include a feature, a limit is
reached, or the subscription is locked) the API answers HTTP 402. `SeenAPIError` carries the details (`status`, `body`, `code`, `is_plan_error`):

```python
from seenwa import SeenAPIError

try:
    client.campaigns.create(...)
except SeenAPIError as err:
    if err.is_plan_error:
        # err.code is one of: feature_not_in_plan, limit_reached, subscription_locked, ai_insufficient_funds
        # err.body also has: feature | limit, current, max (when relevant), upgrade (true if a plan change would help)
        print(err, err.code)
    else:
        raise
```

| `code` | Meaning |
|---|---|
| `feature_not_in_plan` | The account's plan does not include this feature. `body.feature` names it. |
| `limit_reached` | A plan limit is full (numbers, contacts or seats). `body.limit`, `body.current` and `body.max` say which. |
| `subscription_locked` | The last renewal could not be paid. The account owner needs to add funds. |
| `ai_insufficient_funds` | The included AI quota is used up and the wallet balance is too low. |

`str(err)` is the API's own message. For other failures it falls back to `Seen API request failed with status <n>`.
