Metadata-Version: 2.5
Name: autlantic-billing
Version: 0.1.0
Summary: Official Autlantic Billing server SDK for Python (hosted API + webhook verify)
Project-URL: Homepage, https://autlantic.com
Project-URL: Documentation, https://docs.autlantic.com/guide/languages
Project-URL: Repository, https://github.com/Autlantic/payments-sdk
Author-email: Autlantic Limited <support@autlantic.com>
License-Expression: MIT
Keywords: autlantic,base,billing,subscriptions,usdc
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Python SDK (server)

Official Autlantic Billing HTTP client for Python backends.

## Install (local)

```bash
cd sdks/python
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"  # or: pip install -e . pytest
pytest
```

## Usage

```python
from autlantic_billing import AutlanticBilling, verify_billing_webhook

billing = AutlanticBilling.from_env()

result = billing.create_payment_link({
    "amountUsdc": 42,
    "merchantRefPrefix": "invoice",
    "successUrl": "myapp://billing/success",
    "cancelUrl": "myapp://billing/cancel",
})
url = result.get("url")
```

Webhook handler:

```python
from autlantic_billing import verify_billing_webhook, parse_billing_webhook_event

def handle(raw_body: str, signature: str | None, secret: str):
    if not verify_billing_webhook(secret, raw_body, signature):
        raise ValueError("bad signature")
    event = parse_billing_webhook_event(raw_body)
    # unlock access on invoice.paid / payment.paid / subscription.activated
```

## Notes

- Hosted API only. Pins `Autlantic-Version: 2026-01-01`.
- Not on PyPI until the first publish (`autlantic-billing`).
- Secrets stay on the server. Mobile apps use Checkout SDKs, not this package.
