Skip to content

theolujay/paystack-api-wrapper

Repository files navigation

Paystack API Wrapper

PyPI Version Python Versions Build Coverage License

A clean, modern, and test-driven Python client for the Paystack API.

Built to eliminate boilerplate, this library provides a high-level, type-safe interface for integrating payments into your Python applications with confidence.

Features

  • Full API Coverage: Supports all Paystack endpoints from transactions to terminals.
  • Predictable Responses: Every call returns a structured (data, meta) tuple.
  • Robust Error Handling: Specific exceptions for validation, authentication, and network errors.
  • Type-Safe: Fully typed with type hints for a better developer experience.
  • Secure Webhooks: Built-in utilities for signature verification and IP whitelisting.

Installation

pip install paystack-api-wrapper

Quick Start

import os
from paystack import PaystackClient, APIError

# Initialize client
client = PaystackClient(secret_key=os.getenv("PAYSTACK_SECRET_KEY"))

try:
    # Initialize a transaction
    data, meta = client.transactions.initialize(
        email="customer@example.com",
        amount=50000,  # in kobo
    )
    print(f"Checkout URL: {data['authorization_url']}")

except APIError as e:
    print(f"Paystack error: {e.message}")

Documentation


Supported APIs

The client exposes all Paystack resources as intuitive properties:

apple_pay, bulk_charges, charge, customers, dedicated_virtual_accounts, direct_debit, disputes, integration, miscellaneous, payment_pages, payment_requests, plans, products, refunds, settlements, subaccounts, subscriptions, terminal, transactions, transaction_splits, transfers, transfers_control, transfer_recipients, verification, virtual_terminal.


Contributing

Contributions are welcome! Please see the Contributing Guide to get started.


License

MIT © Joseph Ezekiel – see LICENSE for details.

About

The intuitive, type-safe Python client for integrating Paystack API services with confidence.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Contributors