Pagopar
Client to consume pagopar.com REST API, created based on official documentation.
Asynchronous Python wrapper for the Pagopar API, designed for efficiency and type safety.
Installation
pip install pagopar
Configuration
You can configure the application by passing your credentials directly or by using environment variables.
Environment Variables
Set the following environment variables:
PAGOPAR_PRIVATE_TOKENPAGOPAR_PUBLIC_TOKEN
Manual Initialization
from pagopar import initialize_app
app = initialize_app(
private_token="your_private_token",
public_token="your_public_token"
)
Usage Examples
Initialize Application
import asyncio
from pagopar import initialize_app, close_app
# Initialize with environment variables or pass tokens here
app = initialize_app()
other = initialize_app(
private_token="other_private_token",
public_token="other_public_token",
# When needs multiple instances, set the name as a unique identifier
name="other-app",
)
async def main():
# Your logic here
await close_app()
await close_app(other)
if __name__ == "__main__":
asyncio.run(main())
Create a Transaction
Generate a payment link for a user.
import datetime
from pagopar import checkout, enums
async def create_order():
# Define items
item = checkout.Item(
name="Product Name",
description="Product Description",
price=150000,
quantity=1,
total_price=150000,
product_id=123,
image_url="https://example.com/image.png"
)
# Start transaction
transaction = await checkout.start_transaction(
commerce_order_id="ORDER-001",
items=[item],
amount=150000,
payment_type=enums.PaymentType.PAGO_EXPRESS,
max_payment_date=datetime.datetime.now() + datetime.timedelta(days=1),
buyer_name="John Doe",
buyer_email="john.doe@example.com",
buyer_phone="0981123456",
buyer_document="1234567",
buyer_document_type=enums.DocumentType.CI
)
# Get checkout URL
url = checkout.pagopar_checkout_url(transaction.order_id)
print(f"Checkout URL: {url}")
Check Payment Status
Validate if a payment notification is authentic.
from pagopar import checkout
def validate_pagopar_notification(notification_token: str, order_id: str) -> bool:
return checkout.check_pagopar_payment(notification_token, order_id)
Get Order Details
Retrieve the current status of an order.
async def check_order_status(order_hash: str):
order = await checkout.get_order(order_hash)
print(f"Order Status: {'Paid' if order.paid else 'Pending'}")
Modules
- checkout: Transaction initialization, payment link generation, and order status checking.
- courier: Integration with shipping providers (AEX, Mobi) and freight calculation.
- login: Pagopar Login / Registration linking flow.
- payment: Recurring payments and tokenized card management.
- subs: Subscription notifications parsing.
- sync: Product and inventory synchronization with Pagopar.
Release files for pagopar 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pagopar-1.0.0.tar.gz | 27.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pagopar-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 59.3 kB
Release files / pagopar-1.0.0.tar.gz
| Download URL | pagopar-1.0.0.tar.gz |
|---|---|
| Size | 27.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e428aab438089b902bbfffbb1ed5cb4a07333a1f175f6ea15f78cae5ea405811
|
|
BLAKE2b-256 checksum How to use checksums |
2754b8299a5200309d6e3f5ac52ff7d601ba898de60b9f0e3b81c9dc15cbef92
|
| 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 Sep 27, 2026.
Transparency logRelease files / pagopar-1.0.0-py3-none-any.whl
| Download URL | pagopar-1.0.0-py3-none-any.whl |
|---|---|
| Size | 31.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2f6a3a368022e877ecd9d86e2f1c0b374b78a247fa20bde332e2c96245ac478c
|
|
BLAKE2b-256 checksum How to use checksums |
acd11e68cf062c900746ac672c56f3f8a08372825c28ba65cf813a268893b5b9
|
| 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 Sep 27, 2026.
Transparency log