A Python SDK to simplify interactions with the AbacatePay API.
This SDK provides tools for billing management, customer handling, and more.
Supports both synchronous and asynchronous usage, in a simple way.
pip install abacatepay
poetry add abacatepay
To use the SDK, import it and initialize the client with your API key:
import abacatepay
client = abacatepay.AbacatePay("<your-api-key>")
from abacatepay.products import Product
products = [
Product(
external_id="123",
name="Test Product",
quantity=1,
price=50_00,
description="Example product"
),
# or as dict
{
'external_id': "321",
'name': "Product as dict",
'quantity': 1,
'price': 10_00,
'description': "Example using dict"
}
]
billing = client.billing.create(
products=products,
return_url="https://yourwebsite.com/return",
completion_url="https://yourwebsite.com/complete"
)
print(billing.data.url)
billings = client.billing.list()
for billing in billings:
print(billing.id, billing.status)
print(len(billings))
from abacatepay.customers import CustomerMetadata
customer = CustomerMetadata( # Its can also be only a dict
email="[email protected]",
name="Customer Name",
cellphone="(12) 3456-7890",
tax_id="123-456-789-10"
)
created_customer = client.customers.create(customer)
print(created_customer.id)
We welcome contributions to the AbacatePay SDK! To get started, please follow the steps in our Contributing Guide.
Check out the tutorials section in the docs: