Skip to main content

A Python SDK designed to wrap around the Partnero API.

Project description

Partnero SDK

The Partnero SDK provides a simple and powerful Python interface to the Partnero API, allowing developers to manage customers, partners, transactions, webhooks, coupons, and promotion codes programmatically. It simplifies interactions by providing a centralized client (PartneroClient) that handles configuration and request management.

Partnero API Documentation

Installation

To install the Partnero SDK, run the following command:

pip install partnero

Configuration

Before using the SDK, configure the PartneroClient with your API token:

from partnero import PartneroClient

# Replace 'your_api_token_here' with your actual API token
client = PartneroClient(api_key='your_api_token_here')

Usage

With PartneroClient, you can easily access different parts of the Partnero API. Here's how you can use it to manage customers, partners, transactions, and webhooks:

Customer Management

List Customers

customers = client.customers.list_customers(limit=10, page=1)
print(customers)

Create a New Customer

new_customer = client.customers.create_customer(
    partner_key='your_partner_key',
    customer_key='unique_customer_key',
    email='customer@example.com',
    name='Customer Name'
)
print(new_customer)

Partner Management

List Partners

partners = client.partners.list_partners(limit=5, page=1)
print(partners)

Register a New Partner

new_partner = client.partners.create_partner(
    email='newpartner@example.com',
    name='New Partner',
    password='securepassword123'
)
print(new_partner)

Transaction Management

List Transactions

transactions = client.transactions.list_transactions(limit=5, page=1)
print(transactions)

Create a Transaction

new_transaction = client.transactions.create_transaction(
    customer_key='customer_key',
    transaction_key='unique_transaction_key',
    amount=39.99,
    product_id='product_id',
    product_type='type',
    action='purchase'
)
print(new_transaction)

Webhook Management

List Webhooks

webhooks = client.webhooks.list_webhooks(limit=5, page=1)
print(webhooks)

Create a Webhook

new_webhook = client.webhooks.create_webhook(
    name='Order Placed',
    url='https://yourdomain.com/webhooks/order_placed',
    events=['order_placed'],
    is_active=True
)
print(new_webhook)

Contributions

Contributions are welcome! For major changes, please open an issue first to discuss what you would like to change.

License

This SDK is released under the MIT License. See the LICENSE file for more details.


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

partnero-0.4.0.tar.gz (6.0 kB view details)

Uploaded Source

Built Distribution

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

partnero-0.4.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file partnero-0.4.0.tar.gz.

File metadata

  • Download URL: partnero-0.4.0.tar.gz
  • Upload date:
  • Size: 6.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for partnero-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8612cffbc58d102879ed22c4ab341ac217ebe95db65cc565d55a2a15e4de1a59
MD5 e6672529da477772152baefcf34d4405
BLAKE2b-256 9bc76d9a091d6e8ecd5c8ada6d141643f4f398f724f7f5dd7bd8eba74ae04e80

See more details on using hashes here.

File details

Details for the file partnero-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: partnero-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for partnero-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5638ea8ceb66bbc55edad4e39eb94773d81e924be1c7c3ef286e7db220bb2993
MD5 4a30f59bc3b087c912548caf838b9b35
BLAKE2b-256 c4e65cf60eb0eba99c022c8b83024d6c8325473f5bca97e7666e0f06977bef18

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