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

Verification always fails (returns False, never raises) for an empty API key or a header that is not exactly 64 hex characters, so an unconfigured integration never accepts a webhook.

Before settling an order on a success / paid_over webhook, check that it pays that order: Webhook.covers_amount(payload, order_currency, order_total) requires the order's currency and an invoice issued (initial_fiat_amount) for at least the order total, give or take a cent. Whether enough arrived is the gateway's call — it sends success only within the underpay tolerance you configured — so a slightly short fiat_amount still settles the order, while a webhook for some other, cheaper invoice whose extra names it never does.

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

Metadata

Release files for pawpayments 2.1.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.1.1
File Size Uploaded Provenance Actions
pawpayments-2.1.1.tar.gz 11.3 kB With provenance Details for pawpayments-2.1.1.tar.gz

Built distribution (wheel)

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

Total release size: 24.0 kB

Release files / pawpayments-2.1.1.tar.gz

Download URL pawpayments-2.1.1.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ba2c90273a5135aa872bb5621679ff0f012c1baf13a98c40ea42f7565568aa00
BLAKE2b-256 checksum
How to use checksums
7c238058ddad8f679b9dd43cd46668af74eaf745ca8dce7ddaa428cb068b6b30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

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

Download URL pawpayments-2.1.1-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
701ca4c736a886f018249e31e4ee0c940b7e83b1db16edd39f0ec2b424391a94
BLAKE2b-256 checksum
How to use checksums
6f3f2903f8d88d36df5b083b3b8bd435ff67962c5bddfac9aed3e9d9144c5b28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 11, 2026.

Transparency log

Security for pawpayments 2.1.1

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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for pawpayments-2.1.1.tar.gz

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 Oct 11, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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