Skip to content

Getting Started

Installation

uv add paydunya
# or
pip install paydunya

API Keys

  1. Create a PayDunya Business account
  2. Go to Integration API
  3. Create a new application ("AppDunya")
  4. Choose Test mode and Enable production mode
  5. Retrieve your three API keys from the application details page

You'll receive: - PAYDUNYA-MASTER-KEY — main key - PAYDUNYA-PRIVATE-KEY — private key (test_private_... or live_private_...) - PAYDUNYA-TOKEN — application token

Test Mode

In test mode, use your test keys and create fictitious customer accounts in the dashboard to simulate payments. Payments are deducted from the fictitious customer's balance.

from paydunya import PaydunyaClient

client = PaydunyaClient(
    master_key="your-master-key",
    private_key="test_private_...",
    token="your-token",
    mode="test",
)

Production

When ready:

  1. Update your application configuration in the dashboard: Enable production modeYes
  2. Replace test keys with production keys
  3. Switch to mode="live"
client = PaydunyaClient(
    master_key="your-live-master-key",
    private_key="live_private_...",
    token="your-live-token",
    mode="live",
)