Blindpay Python SDK
Official Python SDK for Blindpay API - Global payments infrastructure.
Installation
pip install blindpay
Requirements
- Python 3.12 or higher
- httpx
- pydantic
Quick Start
import asyncio
from blindpay import BlindPay
async def main():
# Initialize the client
client = BlindPay(
api_key="your-api-key",
instance_id="your-instance-id"
)
# List available countries
response = await client.available["countries"]()
if response["error"]:
print(f"Error: {response['error']['message']}")
else:
print(f"Countries: {response['data']}")
# Create a receiver
response = await client.receivers["create"](
type="individual",
kyc_type="light",
email="john.doe@example.com",
first_name="John",
last_name="Doe",
# ... other fields
)
# Close the client when done
await client.close()
# Run the async function
asyncio.run(main())
Resources
The SDK provides access to the following resources:
Available
# Get available rails
await client.available["get_rails"]()
# Get bank details
await client.available["get_bank_details"]()
Instances
# Get instance details
await client.instances["get"]()
# Update instance
await client.instances["update"](name="New Name")
# API Keys
await client.instances["api_keys"]["list"]()
await client.instances["api_keys"]["create"](name="API Key Name", permission="full_access")
await client.instances["api_keys"]["get"]("api-key-id")
await client.instances["api_keys"]["delete"]("api-key-id")
# Webhook Endpoints
await client.instances["webhook_endpoints"]["list"]()
await client.instances["webhook_endpoints"]["create"](url="https://example.com/webhook")
await client.instances["webhook_endpoints"]["get"]("webhook-id")
await client.instances["webhook_endpoints"]["update"]("webhook-id", enabled=False)
await client.instances["webhook_endpoints"]["delete"]("webhook-id")
Receivers
# List receivers
await client.receivers["list"]()
# Create a receiver
await client.receivers["create"](
type="individual",
kyc_type="light",
email="john.doe@example.com",
first_name="John",
last_name="Doe",
# ... other fields
)
# Get a receiver
await client.receivers["get"]("receiver-id")
# Update a receiver
await client.receivers["update"]("receiver-id", email="new.email@example.com")
# Delete a receiver
await client.receivers["delete"]("receiver-id")
# Submit KYC
await client.receivers["submit_kyc"]("receiver-id")
# Bank Accounts
await client.receivers["bank_accounts"]["list"]("receiver-id")
await client.receivers["bank_accounts"]["create"]("receiver-id", type="pix", pix_key="key")
await client.receivers["bank_accounts"]["get"]("receiver-id", "bank-account-id")
await client.receivers["bank_accounts"]["update"]("receiver-id", "bank-account-id", name="New Name")
await client.receivers["bank_accounts"]["delete"]("receiver-id", "bank-account-id")
Quotes
# Create a quote
await client.quotes["create"](
bank_account_id="bank-account-id",
currency_type="receiver",
request_amount=1000,
cover_fees=False,
# ... other fields
)
# Get FX rate
await client.quotes["get_fx_rate"](
currency_type="sender",
from_currency="USD",
to="BRL",
request_amount=1000
)
Payins
# List payins
await client.payins["list"]()
# Get a payin
await client.payins["get"]("payin-id")
# Get payin tracking
await client.payins["get_track"]("payin-id")
# Export payins
await client.payins["export"](status="completed")
# Create EVM payin
await client.payins["create_evm"]("payin-quote-id")
# Payin Quotes
await client.payins["quotes"]["create"](
receiver_id="receiver-id",
bank_account_id="bank-account-id",
# ... other fields
)
await client.payins["quotes"]["get"]("quote-id")
Payouts
# List payouts
await client.payouts["list"]()
# Create a payout
await client.payouts["create"](
bank_account_id="bank-account-id",
amount=1000,
# ... other fields
)
# Get a payout
await client.payouts["get"]("payout-id")
# Get payout tracking
await client.payouts["get_track"]("payout-id")
# Export payouts
await client.payouts["export"](status="completed")
Virtual Accounts
# List virtual accounts
await client.virtual_accounts["list"]()
# Create a virtual account
await client.virtual_accounts["create"](
name="Account Name",
# ... other fields
)
# Get a virtual account
await client.virtual_accounts["get"]("virtual-account-id")
# Get balance
await client.virtual_accounts["get_balance"]("virtual-account-id")
# List transactions
await client.virtual_accounts["list_transactions"]("virtual-account-id")
# Update a virtual account
await client.virtual_accounts["update"]("virtual-account-id", name="New Name")
# Delete a virtual account
await client.virtual_accounts["delete"]("virtual-account-id")
Wallets
Blockchain Wallets
# List blockchain wallets
await client.wallets["blockchain"]["list"]("receiver-id")
# Create with address
await client.wallets["blockchain"]["create_with_address"](
receiver_id="receiver-id",
name="Wallet Name",
network="ethereum",
address="0x..."
)
# Create with hash
await client.wallets["blockchain"]["create_with_hash"](
receiver_id="receiver-id",
name="Wallet Name",
network="ethereum",
signature_tx_hash="0x..."
)
# Get wallet message
await client.wallets["blockchain"]["get_wallet_message"]("receiver-id")
# Get a wallet
await client.wallets["blockchain"]["get"]("receiver-id", "wallet-id")
# Delete a wallet
await client.wallets["blockchain"]["delete"]("receiver-id", "wallet-id")
Offramp Wallets
# List offramp wallets
await client.wallets["offramp"]["list"]("receiver-id")
# Create an offramp wallet
await client.wallets["offramp"]["create"](
receiver_id="receiver-id",
name="Wallet Name",
network="ethereum",
address="0x..."
)
# Get an offramp wallet
await client.wallets["offramp"]["get"]("receiver-id", "wallet-id")
# Delete an offramp wallet
await client.wallets["offramp"]["delete"]("receiver-id", "wallet-id")
Partner Fees
# List partner fees
await client.partner_fees["list"]()
# Create a partner fee
await client.partner_fees["create"](
name="Fee Name",
percentage=0.01,
# ... other fields
)
# Get a partner fee
await client.partner_fees["get"]("partner-fee-id")
# Update a partner fee
await client.partner_fees["update"]("partner-fee-id", percentage=0.02)
# Delete a partner fee
await client.partner_fees["delete"]("partner-fee-id")
Webhook Signature Verification
from blindpay import BlindPay
client = BlindPay(
api_key="your-api-key",
instance_id="your-instance-id"
)
# Verify webhook signature
is_valid = client.verify_webhook_signature(
secret="your-webhook-secret",
id="svix-id-header-value",
timestamp="svix-timestamp-header-value",
payload="raw-request-body",
svix_signature="svix-signature-header-value"
)
if is_valid:
print("Webhook signature is valid")
else:
print("Invalid webhook signature")
Error Handling
All API methods return a response dictionary with either data or error:
response = await client.receivers["get"]("receiver-id")
if response["error"]:
print(f"Error: {response['error']['message']}")
else:
receiver = response["data"]
print(f"Receiver: {receiver}")
Types
The SDK includes comprehensive type definitions for all API resources and parameters. These can be imported from the main package:
from blindpay import (
AccountClass,
BankAccountType,
Country,
Currency,
CurrencyType,
Network,
Rail,
StablecoinToken,
TransactionDocumentType,
TransactionStatus,
PaginationParams,
PaginationMetadata,
# ... and more
)
Development
This SDK uses:
uvfor package managementhttpxfor async HTTP requestspydanticfor data validation
License
MIT
Support
For support, please contact gabriel@blindpay.com or visit https://blindpay.com
Metadata
Release files for alves-blindpay 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| alves_blindpay-1.0.1.tar.gz | 20.6 kB | Without provenance | Details for alves_blindpay-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| alves_blindpay-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for alves_blindpay-1.0.1-py3-none-any.whl |
Total release size: 52.8 kB
Release files / alves_blindpay-1.0.1.tar.gz
| Download URL | alves_blindpay-1.0.1.tar.gz |
|---|---|
| Size | 20.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61eedddbaacdf61b01cf7f93df6b0cf97819a180685a3fcb6aabe7f71cf71044
|
|
BLAKE2b-256 checksum How to use checksums |
ed5ec9858a4c5bae41aa32e391c234f9de0f0e024057c79e4c95cbc5907dd13e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.0
|
Release files / alves_blindpay-1.0.1-py3-none-any.whl
| Download URL | alves_blindpay-1.0.1-py3-none-any.whl |
|---|---|
| Size | 32.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2a01a2959e9d803deaddb29984e3f1b8470c361ddff2b2baafe1f4ab9875bde7
|
|
BLAKE2b-256 checksum How to use checksums |
221c92e8dc09dada4b2226723b0ea31642c9d493aeec96aacf8127e85f33bddb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.0
|
Security for alves-blindpay 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.