Skip to main content

DurraPay Platform API client for Python

Project description

durrapay (Python)

Client for the DurraPay Platform API. Python 3.8+.

pip install durrapay
import os
from durrapay import DurraPay

dp = DurraPay(api_key=os.environ["DURRAPAY_KEY"])   # dpk_test_... or dpk_live_...

# Who am I?
print(dp.me())

# Collect in Kenya (M-Pesa STK)
c = dp.collections.stk(
    phone="254712345678",
    amount_minor=150000,        # KES 1,500.00 (minor units)
    currency="KES",
    reference="ORDER-1001",
)
dp.collections.get(c["payment_id"])

# Send cross-border (FX + payout)
q = dp.transfers.quote(from_currency="KES", destination_country="TZ", from_amount_minor=1_000_000)
dp.transfers.create(quote_id=q["quote_id"], dest_type="PHONE", dest_phone="255712345678", dest_name="Jane Doe")

# Customers, recipients, payment links, balances, usage…
dp.customers.create(name="Jane Doe", email="jane@example.com")
dp.balances()

Idempotency keys are auto-generated for POSTs (override with idempotency_key=). Errors raise DurraPayError with .status, .code, and .body.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

durrapay-0.1.1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

durrapay-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file durrapay-0.1.1.tar.gz.

File metadata

  • Download URL: durrapay-0.1.1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for durrapay-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3b12a2f482440a1c7b18dafbfb23aed30819c582fd9064f59a81052a5b56e9b5
MD5 6ca986ed51e47898e7f3b601c90d6612
BLAKE2b-256 811baab08679e128b760a5de08caa5a7bd5a98284bacf0ee44a726c0465614ae

See more details on using hashes here.

File details

Details for the file durrapay-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: durrapay-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for durrapay-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 83072cd9a6b2c8895d2d1902f6a31cf67cff7e601a0abd37e014f85fd5a8cb1d
MD5 0480afe16516d25d21cef744a2463668
BLAKE2b-256 71137da97df2b2f56909b7437919d99e4c04c995e4286a0a9222d5a08dc05568

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page