Skip to main content

PawPayments — Python SDK

Official Python SDK for the PawPayments Native V2 API. Ships both a synchronous client (PawPayments, built on requests) and an asynchronous one (AsyncPawPayments, built on httpx).

Install

pip install pawpayments

Requires Python 3.9+.

Quickstart (sync)

from pawpayments import PawPayments

paw = PawPayments(api_key="…")

invoice = paw.invoices.create(
    amount=25,
    fiat_currency="USD",
    billing_type="STATIC",
    asset="usdt_tron",
    description="Pro plan, 1 month",
    notify_url="https://example.com/paw/webhook",
)
print(invoice["payment_url"])

Quickstart (async)

import asyncio
from pawpayments import AsyncPawPayments


async def main():
    async with AsyncPawPayments(api_key="…") as paw:
        invoice = await paw.invoices.create(
            amount=25,
            fiat_currency="USD",
            billing_type="STATIC",
            asset="usdt_tron",
        )
        print(invoice["payment_url"])


asyncio.run(main())

Resources

Group Methods
paw.assets list()
paw.rates get(base=, assets=)
paw.balance get()
paw.invoices create(**), get(id), list(**), notify(id)
paw.payouts create(**, uniq_id=), get(id), list(**), batch(items, uniq_id=)
paw.ledger list(type=, ...)
paw.notifications list(**), test(url=)
paw.permanent create(**), get(id), list(**), deactivate(id)

payouts.create and payouts.batch accept an optional uniq_id for explicit idempotency (UUIDv4). When omitted the SDK generates one with uuid.uuid4(). A repeated uniq_id within 2 hours yields a 409. Payout requests use address. Invoice responses expose address_to and may include address_from.

Each payout (and each batch item) accepts an optional fee_bearer of "merchant" or "client" to choose who covers the network fee — defaults to "merchant":

paw.payouts.create(
    address="T…",
    amount=50,
    fiat_currency="USD",
    asset="usdt_tron",
    fee_bearer="client",
)

Webhook verification

from flask import Flask, request, abort
from pawpayments import Webhook

app = Flask(__name__)


@app.post("/paw/webhook")
def webhook():
    raw = request.get_data()
    sig = request.headers.get("X-Paw-Signature", "")
    if not Webhook.verify_raw_body(raw, sig, API_KEY):
        abort(401)
    payload = Webhook.parse_payload(raw)
    # …handle the invoice update…
    return "", 200

Errors

from pawpayments import PawPaymentsApiError

try:
    paw.invoices.create(...)
except PawPaymentsApiError as exc:
    print(exc.code, exc.http_status, str(exc), exc.details)

Testing

  • pytest tests/test_webhook.py — signature unit tests + PHP-interop parity.
  • PAW_API_KEY=… pytest tests/test_live.py tests/test_negative.py — live happy-path + negative-case suites against https://api.pawpayments.com. Tests skip when PAW_API_KEY is absent.

License

MIT

Release files for pawpayments 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pawpayments 2.0.1
File Size Uploaded
pawpayments-2.0.1.tar.gz 9.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pawpayments 2.0.1
File Interpreter ABI Platform
pawpayments-2.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 20.3 kB

Release files / pawpayments-2.0.1.tar.gz

Download URL pawpayments-2.0.1.tar.gz
Size 9.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f07594affeee781c09510b8112478559ceee7943585f545653cf14fec35dc389
BLAKE2b-256 checksum
How to use checksums
6a1cfb98843b1cbca97b7caea946bf3b63cb403c156241f81d060c3d40ac99d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.

Transparency log

Release files / pawpayments-2.0.1-py3-none-any.whl

Download URL pawpayments-2.0.1-py3-none-any.whl
Size 11.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65f2f34cb83b3d920c516f79a4f855fe64647d10d26275695c0c9dae1b81cb6d
BLAKE2b-256 checksum
How to use checksums
13ff59e2c49a131948d5d578b4fa8bde62b219dab4be214d7064816076e7977b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 2, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.0.1 This release

2 release files

2.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page