A package to interact with the Paid API.
Project description
AgentPaid Python SDK
Official Python SDK for the AgentPaid API.
Installation
pip install Paid.ai-Client
Usage
from paid_client import PaidClient
# Initialize the client
client = PaidClient(
api_key='YOUR_API_KEY',
api_url='YOUR_API_URL' # Optional, defaults to production URL
)
# Example: Record usage
client.record_usage(
'agent_id',
'customer_id',
'event_name',
{'key': 'value'}
)
# Signals are automatically flushed:
# - Every 30 seconds
# - When the buffer reaches 100 events
# To manually flush:
client.flush()
API Documentation
Usage Recording
record_usage(agent_id: str, external_user_id: str, signal_name: str, data: Any) -> Noneflush() -> None
Orders
create_order(org_id: str, data: dict) -> Orderget_order(org_id: str, order_id: str) -> Orderlist_orders(org_id: str) -> List[Order]update_order(org_id: str, order_id: str, data: dict) -> Orderadd_order_lines(org_id: str, order_id: str, lines: List[dict]) -> List[OrderLine]activate_order(org_id: str, order_id: str) -> None
Products
create_product(org_id: str, data: dict) -> Productget_product(org_id: str, product_id: str) -> Productlist_products(org_id: str) -> List[Product]update_product(org_id: str, product_id: str, data: dict) -> Productdelete_product(org_id: str, product_id: str) -> None
Customers
create_customer(org_id: str, data: dict) -> Customerget_customer(org_id: str, customer_id: str) -> Customerlist_customers(org_id: str) -> List[Customer]update_customer(org_id: str, customer_id: str, data: dict) -> Customerdelete_customer(org_id: str, customer_id: str) -> None
Contacts
create_contact(org_id: str, data: dict) -> Contactget_contact(org_id: str, contact_id: str) -> Contactlist_contacts(org_id: str, customer_id: Optional[str] = None) -> List[Contact]
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
paid_ai_client-0.4.3.tar.gz
(8.3 kB
view details)
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 paid_ai_client-0.4.3.tar.gz.
File metadata
- Download URL: paid_ai_client-0.4.3.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fdb6a6cdf741af10b09d2109fbd353f3d32c501792103c2d032fdcf45e9ed27b
|
|
| MD5 |
2c325066886d991fc87f567024d8d009
|
|
| BLAKE2b-256 |
1f35541802f80cf8f4c52483437655f89d989e70b3a46d28e0ef1a06f0ad23b2
|
File details
Details for the file paid_ai_client-0.4.3-py3-none-any.whl.
File metadata
- Download URL: paid_ai_client-0.4.3-py3-none-any.whl
- Upload date:
- Size: 8.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1655161c02a2a3549232ca398610cc594441781d5f3a96c5e87c7f7e6220959
|
|
| MD5 |
d9a9d12cd46e82bdfadac36b18b7f033
|
|
| BLAKE2b-256 |
bec4acbf991fdc32be6ec762485be02f5df82ac0198739d5155fe6ae8c1e0910
|