Skip to main content

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) -> None
  • flush() -> None

Orders

  • create_order(org_id: str, data: dict) -> Order
  • get_order(org_id: str, order_id: str) -> Order
  • list_orders(org_id: str) -> List[Order]
  • update_order(org_id: str, order_id: str, data: dict) -> Order
  • add_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) -> Product
  • get_product(org_id: str, product_id: str) -> Product
  • list_products(org_id: str) -> List[Product]
  • update_product(org_id: str, product_id: str, data: dict) -> Product
  • delete_product(org_id: str, product_id: str) -> None

Customers

  • create_customer(org_id: str, data: dict) -> Customer
  • get_customer(org_id: str, customer_id: str) -> Customer
  • list_customers(org_id: str) -> List[Customer]
  • update_customer(org_id: str, customer_id: str, data: dict) -> Customer
  • delete_customer(org_id: str, customer_id: str) -> None

Contacts

  • create_contact(org_id: str, data: dict) -> Contact
  • get_contact(org_id: str, contact_id: str) -> Contact
  • list_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)

Uploaded Source

Built Distribution

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

paid_ai_client-0.4.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

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