Skip to main content

Python SDK for the Paychainly crypto payment platform

Project description

paychainly

Python SDK for the Paychainly crypto payment platform.

Installation

pip install paychainly

Requires Python 3.10+.

Quick start

from paychainly import Paychainly

client = Paychainly(api_key="pk_live_...")

# Create a payment link
link = client.payment_links.create(
    unique_id="order_123",
    token_symbol="USDT",
    network="BNB",
    amount="49.99",
)
print(link.pay_url)  # https://paychainly.com/pay/pay-abc123

# Generate a deposit address
address = client.addresses.generate(token_symbol="USDT", network="BNB")
print(address.address)  # 0x...

# List recent transactions
result = client.transactions.list(status="confirmed")
for tx in result.data:
    print(tx.tx_hash, tx.amount)

Async usage

import asyncio
from paychainly import AsyncPaychainly

async def main():
    async with AsyncPaychainly(api_key="pk_live_...") as client:
        link = await client.payment_links.create(
            unique_id="order_456",
            token_symbol="USDT",
            network="BNB",
        )
        print(link.pay_url)

asyncio.run(main())

Webhook verification

from paychainly import Webhooks, WebhookSignatureError

# In your Flask / FastAPI / Django webhook handler:
raw_body = request.get_data()          # bytes — must be raw, before JSON parsing
signature = request.headers.get("X-Paychainly-Signature", "")

try:
    event = Webhooks.verify(raw_body, signature, "whsec_...")
    print(event.event, event.amount)   # "deposit_detected", "100.00"
except WebhookSignatureError:
    return "Invalid signature", 400

Configuration

client = Paychainly(
    api_key="pk_live_...",
    base_url="https://api.paychainly.com",  # default
    timeout=30.0,      # request timeout in seconds
    retries=3,         # retry on 5xx/network errors
    retry_delay=0.5,   # base delay in seconds (exponential backoff)
)

Resources

client.<resource> Methods
customers create, get, get_by_identifier, get_by_email, get_by_uid, get_by_deposit_address, list, list_all, update_by_identifier, update_by_email
addresses generate, get, get_by_address, list, list_all, revoke, revoke_by_address
transactions get, get_by_hash, list, list_all, list_by_address
payment_links create, get, get_by_slug, get_by_unique_id, get_by_address, create_for_address, list, list_all
invoices get, get_by_id, get_by_hash
withdrawals create, get, list, list_all, list_by_address, cancel
sandbox credit
system health

License

MIT

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

paychainly-1.0.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

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

paychainly-1.0.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file paychainly-1.0.0.tar.gz.

File metadata

  • Download URL: paychainly-1.0.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for paychainly-1.0.0.tar.gz
Algorithm Hash digest
SHA256 b0e7eb9f82db879062563d0984ec5d8666b35ac38ffe4b4c3ebd99fca41631a9
MD5 d30e065577b38b3cd499346ea299b015
BLAKE2b-256 9bd01718f299a2c517eb1821b07527a448484523114c8585e8bd639fc5f06219

See more details on using hashes here.

File details

Details for the file paychainly-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: paychainly-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for paychainly-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a60cef48851d9d252cd3f06ba9a552535593074df7a1ca63628a17118994c00
MD5 c496634753920658dcc86b1268886617
BLAKE2b-256 7b7f33e7ac1199f2d0d6c12abcba3dfc5bcd72632643de6339106fefb458e190

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