Skip to main content

Python SDK to interact with AbacatePay's API

Project description

AbacatePay SDK

PyPI Version PyPI Downloads

A Python SDK to simplify interactions with the AbacatePay API.
This SDK provides tools for billing management, customer handling, and more.

English | Português


Table of Contents


Installation

Using pip

pip install abacatepay

Using Poetry

poetry add abacatepay

Getting Started

To use the SDK, import it and initialize the client with your API key:

import abacatepay

client = abacatepay.AbacatePay("<your-api-key>")

Usage Examples

Create a Billing

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)

List All Billings

billings = client.billing.list()
for billing in billings:
    print(billing.id, billing.status)

print(len(billings))

Customer Management

from abacatepay.customers import CustomerMetadata

customer = CustomerMetadata(  # Its can also be only a dict
    email="customer@example.com",
    name="Customer Name",
    cellphone="(12) 3456-7890",
    tax_id="123-456-789-10"
)

created_customer = client.customers.create(customer)
print(created_customer.id)

Contributing

We welcome contributions to the AbacatePay SDK! To get started, please follow the steps in our Contributing Guide.

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

abacatepay-1.0.8.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

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

abacatepay-1.0.8-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file abacatepay-1.0.8.tar.gz.

File metadata

  • Download URL: abacatepay-1.0.8.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for abacatepay-1.0.8.tar.gz
Algorithm Hash digest
SHA256 8dbebbfb294fad79832cc8499f4a849950aad8131536eefee81be776c0afe4e4
MD5 7acbe25be8156f16718344e56c585eae
BLAKE2b-256 758b6b4b1093363b221e0fcaf76fd4353d58b5d6becc47c573553c716726d741

See more details on using hashes here.

File details

Details for the file abacatepay-1.0.8-py3-none-any.whl.

File metadata

  • Download URL: abacatepay-1.0.8-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for abacatepay-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 d11d5a82480e93f7975f3aed13dafad64a1252ba8d2d23c9f26ee996c55eb862
MD5 d8851b38778044d68c6e62d8c356880c
BLAKE2b-256 a2931f2d7d5070fe9c9b8aee82febe5dfd721a1772f2bf3d39bbe67db2a05aac

See more details on using hashes here.

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