Metadata-Version: 2.4
Name: paymos-sdk
Version: 1.0.0
Summary: Official Python SDK for the Paymos Merchant API
Project-URL: Documentation, https://paymos.io/docs/server-sdks
Project-URL: Repository, https://github.com/Paymos-labs/python-sdk
Project-URL: Issues, https://github.com/Paymos-labs/python-sdk/issues
Author-email: Paymos Labs <support@paymos.io>
License-Expression: MIT
License-File: LICENSE
Keywords: payments,paymos,stablecoins,usdc,usdt
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.10
Provides-Extra: dev
Requires-Dist: build==1.5.1; extra == 'dev'
Requires-Dist: mypy==2.2.0; extra == 'dev'
Requires-Dist: ruff==0.15.21; extra == 'dev'
Description-Content-Type: text/markdown

# Paymos Python SDK

Official Python 3.10+ client for the Paymos Merchant API. It includes HMAC request
signing, invoices, withdrawals, balances, bounded cursor iterators, structured
errors, safe retries, and raw-body webhook verification.

```bash
pip install paymos-sdk
```

```python
import os

from paymos import Paymos

paymos = Paymos(
    api_key=os.environ["PAYMOS_API_KEY"],
    api_secret=os.environ["PAYMOS_API_SECRET"],
)
invoice = paymos.invoices.create(
    project_id="prj_...", amount="10.00", currency="USD",
    external_order_id="order_123",
)
```

Use decimal strings for money. `list()` returns one cursor page; `iterate()`
follows cursors lazily and stops after 100 pages by default.

```python
for invoice in paymos.invoices.iterate(status=["paid", "paid_over"], max_pages=10):
    print(invoice["invoice_id"])
```

API failures raise typed subclasses of `ApiError` and preserve the HTTP status,
problem details, field, error code, headers, and `Retry-After` value.

Verify webhooks against the exact raw request body before parsing it:

```python
from paymos import WebhookVerifier

event = WebhookVerifier(os.environ["PAYMOS_WEBHOOK_SECRET"]).construct_event(
    request.headers["X-Webhook-Signature"], request.get_data()
)
```

Never use the API secret in browser or mobile code. Full documentation:
https://paymos.io/docs/server-sdks
