Python library for processing agentic payments (ACP, AP2, x402) via Stripe with automated Zelle payouts
Project description
AgenticlyPay
A Python library for processing agentic payments (ACP, AP2, x402) via Stripe. Built for agentic developers who need automated payment processing, monthly Zelle payouts, and tax compliance.
Features
- Multi-Protocol Support: Process payments using ACP (Agentic Commerce Protocol), AP2 (Agent Payments Protocol), or x402 protocols
- Stripe Connect Integration: Seamless onboarding and account management for developers
- Automated Zelle Payouts: Monthly automated payouts via Zelle to your email address
- Tax Compliance: Automatic 1099 form generation and filing
- Transparent Pricing: 6.5% + $0.30 per transaction
- Email-Only Configuration: No API keys needed - just use your email address
Important: Email Requirements
Your email address must be Zelle-compatible (US bank account required). Monthly payouts are automatically sent via Zelle to the email address you use when creating your developer account.
Installation
pip install agenticlypay
Quick Start
Basic Usage
from agenticlypay import AgenticlyPayClient
# Initialize the client (no API keys needed!)
client = AgenticlyPayClient(base_url="https://api.agenticlypay.com") # Optional, defaults to production
# Create a developer account
# IMPORTANT: Use a Zelle-compatible email address (US bank account required)
account = client.create_account(
email="developer@example.com", # Must be Zelle-compatible
country="US"
)
# Process a payment (AUTO protocol)
# IMPORTANT: Include your Zelle-compatible email for usage tracking
payment = client.process_payment(
email="developer@example.com", # Must be Zelle-compatible
protocol="AUTO",
amount=10000, # $100.00 in cents
developer_account_id=account["account"]["account_id"],
currency="usd",
description="Payment for service"
# Include `mandate` for AP2 or `resource_url` for x402
)
Using Convenience Wrappers
from agenticlypay import PaymentProcessor, ConnectManager
# Initialize components (no API keys needed!)
payment_processor = PaymentProcessor()
connect_manager = ConnectManager()
# Create a developer account
account = connect_manager.create_developer_account(
email="developer@example.com", # Must be Zelle-compatible
country="US"
)
# Process a payment
result = payment_processor.process_payment(
email="developer@example.com", # Required
protocol="AUTO",
amount=10000, # $100.00 in cents
developer_account_id=account["account_id"],
currency="usd"
)
ACP Payment Example
from agenticlypay import AgenticlyPayClient
client = AgenticlyPayClient()
result = client.process_payment(
email="developer@example.com", # Required
protocol="ACP",
amount=10000, # $100.00 in cents
currency="usd",
developer_account_id="acct_xxxxx",
description="Payment for service"
)
Note: When creating your developer account, use a Zelle-compatible email address. Monthly payouts will be automatically sent to this email via Zelle.
AP2 Payment Example
result = client.process_payment(
email="developer@example.com", # Required
protocol="AP2",
amount=10000,
currency="usd",
developer_account_id="acct_xxxxx",
mandate={
"agent_id": "agent_123",
"user_id": "user_456",
"permissions": ["create_payment", "complete_purchase"],
"expires_at": 1735689600,
"mandate_id": "mandate_789"
}
)
x402 Payment Example
result = client.process_payment(
email="developer@example.com", # Required
protocol="x402",
amount=10000,
currency="usd",
developer_account_id="acct_xxxxx",
resource_url="/api/data/endpoint"
)
Complete Account Setup Example
from agenticlypay import AgenticlyPayClient
client = AgenticlyPayClient()
# 1. Create account
account = client.create_account(
email="developer@example.com", # Must be Zelle-compatible
country="US"
)
# 2. Create onboarding link
onboarding = client.create_onboarding_link(
account_id=account["account"]["account_id"],
refresh_url="https://yourapp.com/reauth",
return_url="https://yourapp.com/success",
email="developer@example.com" # Required
)
# 3. Redirect user to onboarding.url
print(f"Onboarding URL: {onboarding['onboarding_link']['url']}")
# 4. Process payments
payment = client.process_payment(
email="developer@example.com", # Required
protocol="AUTO",
amount=10000,
developer_account_id=account["account"]["account_id"],
currency="usd"
)
Monthly Zelle Payouts
Monthly payouts are automatically sent via Zelle to the email address associated with your developer account. No additional configuration needed - just ensure your email is Zelle-compatible (linked to a US bank account).
API Reference
AgenticlyPayClient
The main client class for interacting with the AgenticlyPay API.
Methods
create_account(email, country="US", metadata=None)- Create a developer accountget_account(account_id, email)- Get account statuscreate_onboarding_link(account_id, refresh_url, return_url, email)- Create onboarding linkconfigure_payout_schedule(account_id, interval, email, monthly_anchor=None, weekly_anchor=None)- Configure payout scheduleprocess_payment(email, protocol, amount, developer_account_id, currency="usd", ...)- Process a paymentconfirm_payment(email, protocol, payment_id, payment_method=None)- Confirm a paymentget_payment_status(email, protocol, payment_id)- Get payment statusget_fee(email, amount)- Calculate feeget_monthly_earnings(email, account_id, year, month)- Get monthly earningscreate_transfer(email, developer_account_id, amount, currency="usd", reference=None)- Create manual transferget_annual_earnings(email, account_id, year)- Get annual earnings for tax reporting
All methods require your email address (must be Zelle-compatible) for usage tracking and payout processing.
Error Handling
from agenticlypay import AgenticlyPayClient, AgenticlyPayError
client = AgenticlyPayClient()
try:
account = client.create_account(email="developer@example.com", country="US")
except AgenticlyPayError as e:
print(f"Error: {e}")
print(f"Status Code: {e.status_code}")
License
MIT License
Support
For issues and questions, please visit our GitHub repository or contact support@agenticlypay.com
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agenticlypay-0.3.0.tar.gz.
File metadata
- Download URL: agenticlypay-0.3.0.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
564410d082906eaf8dea43b71be5a55ccdbca7b0b80b48fb7b84c4ad5c924542
|
|
| MD5 |
892a67bf0f03fdfcb309ab83336ca456
|
|
| BLAKE2b-256 |
638d8ad4d51d9b8b42b9bcabb04cef07379a0d76418b17d8ae2c3b8dedd6a97f
|
File details
Details for the file agenticlypay-0.3.0-py3-none-any.whl.
File metadata
- Download URL: agenticlypay-0.3.0-py3-none-any.whl
- Upload date:
- Size: 40.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f579a2be7960070c88f6d0dfce68f6beeb0e1029250e22325429e7a33c0bc122
|
|
| MD5 |
c7921afacaddcb896dc7455f0053ff2c
|
|
| BLAKE2b-256 |
39deb2629b065985bf59e548106589e51c8315375cafb62bc4dc42441d860b40
|