Observed since 20 Oct, 22:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
agenticlypay
Python library for processing agentic payments (ACP, AP2, x402) via Stripe with automated Square-managed payouts
A Python library for processing agentic payments (ACP, AP2, x402) via Stripe. Built for agentic developers who need automated payment processing, monthly Square-managed payouts, and tax compliance.
Email Query Parameters Removed: For security reasons, email authentication via query parameters (?email=...) has been removed.
Migration:
AgenticlyPayClient(api_key="agt_...")X-Developer-Email header (deprecated but still supported)Input Validation: The API now validates:
acct_*)pip install agenticlypay
AgenticlyPay supports two authentication methods:
API tokens provide better security and isolation between projects. When using an API token, you don't need to pass the email parameter to methods.
from agenticlypay import AgenticlyPayClient
# Initialize the client with email-based auth
client = AgenticlyPayClient(base_url="https://api.agenticlypay.com") # Optional, defaults to production
# Create a developer account
account = client.create_account(
email="developer@example.com",
country="US"
)
# Process a payment (AUTO protocol)
# IMPORTANT: Include your email for usage tracking
payment = client.process_payment(
email="developer@example.com",
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
)
from agenticlypay import AgenticlyPayClient
# Initialize the client with API token (recommended for production)
# Get your token from https://agenticlypay.com/console
client = AgenticlyPayClient(
base_url="https://api.agenticlypay.com",
api_key="agt_your_token_here"
)
# Create a developer account (no email needed when using API token)
account = client.create_account(
email="developer@example.com", # Still needed for account creation
country="US"
)
# Process a payment (no email parameter needed with API token)
payment = client.process_payment(
protocol="AUTO",
amount=10000, # $100.00 in cents
developer_account_id=account["account"]["account_id"],
currency="usd",
description="Payment for service"
)
Note: When using an API token, the email parameter is optional for most methods. The API token automatically associates requests with your account.
from agenticlypay import PaymentProcessor, ConnectManager
# Initialize components with email-based auth
payment_processor = PaymentProcessor()
connect_manager = ConnectManager()
# Or with API token (recommended)
payment_processor = PaymentProcessor(api_key="agt_your_token_here")
connect_manager = ConnectManager(api_key="agt_your_token_here")
# Create a developer account
account = connect_manager.create_developer_account(
email="developer@example.com",
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"
)
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: Monthly payouts are automatically initiated via Square to the bank account connected to your developer profile. Use an email that corresponds to your Square account.
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"
}
)
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"
)
from agenticlypay import AgenticlyPayClient
client = AgenticlyPayClient()
# 1. Create account
account = client.create_account(
email="developer@example.com",
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"
)
Create and manage API tokens in the Developer Console:
AgenticlyPayClient(api_key="agt_...")Tokens can be revoked at any time from the console. When using an API token, you don't need to pass the email parameter to most methods.
For MCP (Model Context Protocol) server integrations, use these environment variables:
# Required
AGENTICLYPAY_DEVELOPER_ACCOUNT_ID=acct_xxxxx
AGENTICLYPAY_EMAIL=your-email@example.com
AGENTICLYPAY_BASE_URL=https://api.agenticlypay.com
# Optional - use API token instead of email
AGENTICLYPAY_API_KEY=agt_your_token_here
# AP2 service configuration (if using AP2 protocol)
AP2_SERVICE_URL=https://ap2-service.your-domain.com
AP2_SERVICE_API_KEY=super-secret
# Stripe configuration (for AP2 service)
STRIPE_SECRET_KEY=sk_live_...
Note: If AGENTICLYPAY_API_KEY is set, it takes precedence over AGENTICLYPAY_EMAIL for authentication.
Monthly payouts are automatically sent via Square to the bank account associated with your developer account. Square handles the transfer once your balance reaches the payout threshold—no extra work on your end.
The main client class for interacting with the AgenticlyPay API.
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 reportingWhen using email-based authentication, all methods require your email address for usage tracking and payout processing. When using an API token, the email parameter is optional for most methods (except account creation).
The library provides structured error handling with custom exception classes:
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}")
print(f"Response: {e.response}")
All errors include structured error codes and messages for easier handling.
All rights reserved. AgenticlyPay is proprietary software; email dan@danbroz.com for licensing inquiries.
For issues and questions, please visit our GitHub repository or contact dan@danbroz.com
Download counts and popularity will appear here as the collector receives them.
| Package / target | Requirement | Relationship |
|---|---|---|
httpxEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | httpx>=0.25.0 | runtime |
pydanticEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | pydantic>=2.5.0 | runtime |
email-validatorEnvironment{
"extras": "",
"marker": null,
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | email-validator>=2.0.0 | runtime |
pytestEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | pytest>=7.4.0; extra == "dev" | runtime |
pytest-asyncioEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | pytest-asyncio>=0.21.0; extra == "dev" | runtime |
blackEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | black>=23.11.0; extra == "dev" | runtime |
ruffEnvironment{
"extras": "",
"marker": "extra == \"dev\"",
"requires_python": ">=3.11",
"evaluation": "NOT_EVALUATED"
} | ruff>=0.1.6; extra == "dev" | runtime |
bdist_wheel · 53.2 KB · Python py3
sdist · 48.39 KB · Python source
Observed since 20 Oct, 22:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:dbeb755365f14e773ffd2115618cde30aee8fc483020b4d1c4e9c1c28a24612f