nowpayment - A payment gateway client for NowPayments.io
NOWPayments is a noncustodial crypto payment gateway that lets you accept payments in 300+ cryptocurrencies with auto coin conversion supported. The gateway is designed to be simple and fast to integrate, with low fees and no minimum balance required. It also supports instant settlement and has a variety of features, including integrated invoices and a donation page builder.
Requirements
- Python 3.8+
Installation
pip install nowpayment
Supported APIs
- Payments API
- Currency API
- Payout API
- Custody / Billing API (sub-partners)
- Subscriptions API (plans & recurring payments)
- Webhook / IPN verification helpers
Quick start
from nowpayment import NowPayments
np = NowPayments("API_KEY")
# np = NowPayments("SANDBOX_API_KEY", sandbox=True)
invoice = np.payment.create_invoice(
price_amount=1,
price_currency="USD",
)
currencies = np.currency.get_available_currencies()
Pass as_model=True on API methods to get typed response models instead of dict.
from nowpayment import Payment
payment = np.payment.create_payment(
price_amount=10,
price_currency="USD",
pay_currency="TRX",
order_id="order-1",
ipn_callback_url="https://example.com/ipn",
as_model=True,
)
print(payment.payment_status)
Webhooks (IPN)
from nowpayment import extract_ipn_signature, verify_ipn_payload, IPNVerificationError
signature = extract_ipn_signature(request.headers)
event = verify_ipn_payload(request.json, IPN_SECRET, signature)
Error handling
from nowpayment import NowPayments, NowPaymentsAPIError
try:
np.payment.get_payment_status("invalid-id")
except NowPaymentsAPIError as exc:
print(exc.status_code, exc.message)
Development
pip install -e ".[dev]"
pytest
More examples: examples/. Testing guide: docs/TESTING.md.
Metadata
Release files for nowpayment 1.9.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nowpayment-1.9.0.tar.gz | 20.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nowpayment-1.9.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 41.6 kB
Release files / nowpayment-1.9.0.tar.gz
| Download URL | nowpayment-1.9.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
60e835bd9e8eb1aab28d9fae1a810a87f3d9c6c21280f5dd4ebd8306d3db851e
|
|
BLAKE2b-256 checksum How to use checksums |
7df5af2852c6aa77a9c228519dfed6ec120d4b375b3b4a06d5606242378ddb83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Release files / nowpayment-1.9.0-py3-none-any.whl
| Download URL | nowpayment-1.9.0-py3-none-any.whl |
|---|---|
| Size | 21.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7b69b3f06dcd9cc5cb65ee6db11c72e91d109775108e0c1d0fed60493adf960b
|
|
BLAKE2b-256 checksum How to use checksums |
ce3499e2e75030cf45ee4e6730d8d5c4c6428bb9739eeb13e99874f525106a02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|