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.
- Python 3.8+
pip install nowpayment- Payments API
- Currency API
- Payout API
- Custody / Billing API (sub-partners)
- Subscriptions API (plans & recurring payments)
- Webhook / IPN verification helpers
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)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)from nowpayment import NowPayments, NowPaymentsAPIError
try:
np.payment.get_payment_status("invalid-id")
except NowPaymentsAPIError as exc:
print(exc.status_code, exc.message)pip install -e ".[dev]"
pytestMore examples: examples/. Testing guide: docs/TESTING.md.