Pagopar SDK Wiki¶
pagopar-sdk is a typed, lightweight Python library for integrating with
Pagopar — Paraguay's online payment gateway.
It covers both APIs offered by Pagopar:
| API | What it does |
|---|---|
Commerce (client.commerce) |
Initiate transactions, list payment methods, query orders, request reversals |
Recurrent / Preauthorization (client.recurrent) |
Register customers and cards, list/confirm/delete cards, charge saved cards, preauthorize and confirm/cancel amounts |
The implementation follows the official Pagopar Postman collection — every endpoint, token-generation algorithm, and signature scheme was derived directly from the collection provided by the payment gateway.
What you will find here¶
- Installation — pip, uv, environment variables, and source setup
- FastAPI integration — async service-layer pattern with
asyncio.to_thread - Django integration — service class + views + webhook pattern
- Flask integration — app factory + blueprint pattern
- Contributing — how to contribute to the SDK
- PyPI Publishing — how releases are published
- Wiki Generator — how this site is built with MkDocs
Quick start¶
pip install pagopar-sdk
# or
uv add pagopar-sdk
from pagopar_sdk import PagoparClient
with PagoparClient(public_key="YOUR_PUBLIC_KEY", private_key="YOUR_PRIVATE_KEY") as client:
methods = client.commerce.get_payment_methods()
print(methods["resultado"])
See the Installation guide for full setup including environment variables.
SDK at a glance¶
PagoparClient
├── .commerce
│ ├── get_payment_methods()
│ ├── create_transaction(payload)
│ ├── get_order(hash_pedido)
│ └── reverse_order(hash_pedido)
└── .recurrent
├── add_customer(...)
├── add_card(...)
├── list_cards(...)
├── confirm_card(...)
├── delete_card(...)
├── pay(...)
├── preauthorize(...)
├── confirm_preauthorization(...)
└── cancel_preauthorization(...)
Run docs locally¶
uv sync --extra docs
mkdocs serve
Open: http://127.0.0.1:8000