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.0.tar.gz (3.2 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.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: durrapay-0.1.0.tar.gz
  • Upload date:
  • Size: 3.2 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.0.tar.gz
Algorithm Hash digest
SHA256 a883d64df267ff6d61ff4b6583f73c934f5654fa0181b887712f5bcaf63000bf
MD5 7ad5bd90ff3ec2385f56f0688b39f5b8
BLAKE2b-256 345b11b7ef0689bb1755aef6b2637d42666fea7243b311dbc009f15414479f63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: durrapay-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5353cb1d9465b989183caf124869beea526de678e7f73c4f30c81e5085c7b2df
MD5 722c5ffc0c9c17bfc288bc521a4a6faa
BLAKE2b-256 2ea28859a8036a74720b84c3df4bc482f44bb473586e0831f6ef9f6e7e2323ee

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