Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.pawpayments.com/llms.txt

Use this file to discover all available pages before exploring further.

The pawpayments package is the official Python SDK for the Native V2 API. It exposes resource helpers that mirror the public REST surface (/api/v2/*), ships both a synchronous client (PawPayments, requests) and an asynchronous one (AsyncPawPayments, httpx), and includes helpers for verifying webhook signatures.
PropertyValue
Package namepawpayments
GitHubpawpayments/python-sdk
Minimum Python3.9
Runtime dependenciesrequests, httpx

Installation

pip install pawpayments

Quick start (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"])
Optional constructor arguments match other official clients: base_url defaults to https://api.pawpayments.com, timeout defaults to 30 seconds, and you may inject a shared requests.Session.

Quick start (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

Successful responses unwrap the standard { ok, result } envelope into plain dicts (or typed list wrappers where applicable). API and transport failures raise PawPaymentsApiError with code, http_status, and optional details.
AttributeMethods
paw.assetslist()
paw.ratesget(base=..., assets=...)
paw.balanceget()
paw.invoicescreate(**...), get(order_id), list(**...), notify(order_id)
paw.payoutscreate(..., uniq_id=...), get(id), list(**...), batch(items, uniq_id=...)
paw.ledgerlist(**...)
paw.notificationslist(**...), test(url=...)
paw.permanentcreate(**...), get(id), list(**...), deactivate(id)
For payouts.create and payouts.batch, pass uniq_id (UUIDv4) for explicit idempotency. If omitted, the SDK generates one; repeating the same id within two hours returns HTTP 409.

Webhook verification

Use the raw request body bytes when validating X-Paw-Signature (HMAC-SHA256 with your API key). Re-encoding JSON before hashing breaks verification.
from flask import abort
from pawpayments import 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)
Treat webhooks that include permanent_address_id like the official plugins: acknowledge with 200 OK without treating them as checkout callbacks unless your integration owns permanent-address flows.

Errors

from pawpayments import PawPaymentsApiError

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