Skip to main content

Official Python SDK for the Fidloy API

Project description

Fidloy Python SDK

Official Python SDK for the Fidloy API.

Install

pip install fidloy-sdk

Quick Start

from fidloy import Fidloy

client = Fidloy(api_key="YOUR_API_KEY")

transactions = client.list_transactions(business_id=2)

for txn in transactions:
    print("ID:", txn.get("id"), "Amount:", txn.get("amount"))

client.close()

base_url is optional and already defaults to the production API.

Simplest 2 Examples

Example 1: Show transactions

from fidloy import Fidloy

client = Fidloy(api_key="YOUR_API_KEY")

for txn in client.list_transactions(business_id=2):
    print(txn.get("id"), txn.get("amount"))

client.close()

Example 2: Show customers

from fidloy import Fidloy

client = Fidloy(api_key="YOUR_API_KEY")

for customer in client.list_customers(business_id=2):
    print(customer.get("id"), customer.get("first_name"), customer.get("phone"))

client.close()

Also Available (Direct Client)

from fidloy_sdk import FidloyClient

client = FidloyClient(api_key="YOUR_API_KEY")
customer = client.create_customer(
    first_name="Alex",
    last_name="Bwana",
    business_id=2,
    phone="+250788000000",
)
print(customer)
client.close()

Main Features

  • API-key authenticated requests
  • Very simple Fidloy facade for beginners
  • Customer-in-business reward history helper methods
  • Customer and transaction creation helpers
  • Points and coupon redemption helpers
  • Receipt and webhook creation helpers
  • Typed, predictable exceptions
  • Configurable timeout and headers

Core Methods

  • get_rewards_history
  • get_customer_rewards_history
  • create_customer
  • create_transaction
  • create_receipt
  • create_webhook
  • redeem_points
  • redeem_coupon

Publish to PyPI

Recommended: Trusted Publishing (GitHub Actions)

Follow PYPI_RELEASE_CHECKLIST.md to configure PyPI Trusted Publisher.

Then publish by creating a GitHub Release for your version tag.

Manual upload (fallback)

python -m pip install --upgrade build twine
python -m build
python -m twine upload dist/*

Use a PyPI token when uploading.

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

fidloy_sdk-0.1.6.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

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

fidloy_sdk-0.1.6-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file fidloy_sdk-0.1.6.tar.gz.

File metadata

  • Download URL: fidloy_sdk-0.1.6.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fidloy_sdk-0.1.6.tar.gz
Algorithm Hash digest
SHA256 78adaaa294a88f65830aeadbf6237c02e09687f363c96eba6d6609b0aae6308f
MD5 cef2ab44ccf1fc03cf0f7a514424a9b8
BLAKE2b-256 8503199e41a94b9d9c83e1f472eb81355b12c8ff88a3427556a39173b4d2c55b

See more details on using hashes here.

Provenance

The following attestation bundles were made for fidloy_sdk-0.1.6.tar.gz:

Publisher: publish-pypi.yml on bwanakweli4ever/fidloy_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fidloy_sdk-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: fidloy_sdk-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for fidloy_sdk-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 8746b703789ff4661b62bfb41745cb7da226341a85a368998e47e7e9319709e7
MD5 768d22fb378daf4e9e6857db956238be
BLAKE2b-256 1646fb8ac1d1080240e2cb515efe16c440af07dbaf689197dbbd27d33d04b5d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for fidloy_sdk-0.1.6-py3-none-any.whl:

Publisher: publish-pypi.yml on bwanakweli4ever/fidloy_sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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