Skip to main content

NullPay Python SDK

nullpay-python is the Python equivalent of @nullpay/node.

It follows the same backend-first architecture:

  • reads nullpay.json locally for named invoice lookup
  • calls the NullPay backend to create and retrieve checkout sessions
  • uses the NullPay relayer flow for invoice pre-generation when invoice_hash or salt is missing
  • verifies webhook signatures locally with HMAC-SHA256

The smart-contract and Provable SDK work stays on the NullPay backend. This package is a thin Python client for FastAPI, Flask, Django, and plain Python services.

Install

pip install ./packages/nullpay-python

Basic usage

from nullpay import NullPay

client = NullPay({
    "secretKey": "sk_test_...",
    "baseURL": "https://nullpay-backend-ib5q4.ondigitalocean.app/api",
})

session = client.checkout.sessions.create({
    "amount": 10,
    "currency": "USDCX",
    "type": "multipay",
    "success_url": "https://example.com/success",
    "cancel_url": "https://example.com/cancel",
})

print(session["checkout_url"])

API surface

NullPay(config)

Supported config keys:

  • secretKey or secret_key
  • baseURL or base_url
  • projectRoot or project_root
  • configPath or config_path
  • timeout

load_nullpay_config(project_root=None, config_path=None)

Loads nullpay.json from the provided project root or explicit path.

client.invoices

  • get_all()
  • get_by_index(i)
  • get_by_name(name)
  • get_by_type(type_name)

client.checkout.sessions

  • create(params)
  • retrieve(session_id)

create(...) mirrors the Node SDK behavior:

  • accepts nullpay_invoice_name and nullpay_invoice_index
  • auto-generates a salt if invoice_hash or salt is missing
  • calls /dps/relayer/create-invoice
  • polls the Provable salt_to_invoice mapping
  • performs best-effort dashboard sync via /invoices
  • finally creates the hosted checkout session via /checkout/sessions

client.webhooks

  • verify_signature(payload, signature)
  • construct_event(payload, signature)

Framework examples

See examples/ for:

  • FastAPI
  • Flask
  • Django

Tests

Run from this package directory:

python -m unittest discover -s tests

Metadata

Release files for nullpay-python 0.1.0

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

Source distribution (sdist)

Source distribution for nullpay-python 0.1.0
File Size Uploaded Provenance Actions
nullpay_python-0.1.0.tar.gz 7.0 kB Without provenance Details for nullpay_python-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for nullpay-python 0.1.0
File Interpreter ABI Platform Actions
nullpay_python-0.1.0-py3-none-any.whl Python 3 none any Details for nullpay_python-0.1.0-py3-none-any.whl

Total release size: 14.0 kB

Release files / nullpay_python-0.1.0.tar.gz

Download URL nullpay_python-0.1.0.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
22a77961c68369143520f300aae001c5cd7081eb3ebfbc9d3db7510e53bccdc4
BLAKE2b-256 checksum
How to use checksums
c0d55bccb3bf846dd93f5ca516b3e5ab8d56446296e87cbb70d972c6833df5b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / nullpay_python-0.1.0-py3-none-any.whl

Download URL nullpay_python-0.1.0-py3-none-any.whl
Size 7.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
afc8982d154e5abc3e80dd70df736998b92596edaf0bb9d3774a0d5f913144cf
BLAKE2b-256 checksum
How to use checksums
0c08376c1619cef72ff511ce5a40b79267177e0ae7cb512d296fcc0afcc8b8b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Security for nullpay-python 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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