Skip to main content

Official Casso API v2 SDK for Python

Project description

Casso API v2 SDK for Python

A lightweight Python SDK to integrate with the Casso API v2 bank transaction synchronization platform.

Installation

Install using pip:

pip install casso-pg

Features

  • Double Authentication Method: Supports both API Keys and OAuth 2.0.
  • Transactions Sync: Easily query bank transactions with advanced filters or manually trigger transaction syncs.
  • Webhook Management: Register webhook endpoints programmatically.
  • Webhook Verification: Verify incoming webhook calls using your configured secure token.

Quick Start

1. Initialize Client

Initialize using your API Key:

from casso_pg import CassoClient

casso = CassoClient(
    api_key="YOUR_CASSO_API_KEY",
    secure_token="YOUR_WEBHOOK_SECURE_TOKEN"
)

2. Query Transactions

filters = {
    "sort": "DESC",
    "page": 1,
    "pageSize": 10,
    "fromDate": "2026-07-01"
}

response = casso.get_transactions(filters)
for txn in response.get("data", {}).get("records", []):
    print(f"ID: {txn['id']}, Amount: {txn['amount']}, Description: {txn['description']}")

3. Sync Transactions Manually

sync_res = casso.sync_transactions()
print("Manual sync triggered:", sync_res)

4. Verify Webhook Authenticity

When Casso posts transaction data to your webhook endpoint, check the token sent in the secure-token header:

# Inside your Webhook API handler (Flask / FastAPI / Django):
received_token = request.headers.get("secure-token")

if casso.verify_webhook(received_token):
    # Webhook is verified, safe to parse payload
    payload = request.get_json()
    for item in payload.get("data", []):
        print(f"Transaction detected: {item['amount']} VND, Memo: {item['description']}")
else:
    print("Unauthorized webhook access attempts.")

License

MIT License.

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

casso_pg-1.0.0.tar.gz (4.4 kB view details)

Uploaded Source

Built Distribution

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

casso_pg-1.0.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file casso_pg-1.0.0.tar.gz.

File metadata

  • Download URL: casso_pg-1.0.0.tar.gz
  • Upload date:
  • Size: 4.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for casso_pg-1.0.0.tar.gz
Algorithm Hash digest
SHA256 91031dfc599fa71097b5dd689ab3c363f2e9621d443c4a1de9cc4ed9dd247fdf
MD5 937e96576bea3b5f5d7ff35aa7dc9b83
BLAKE2b-256 27a9de8afabf8ccde3108486d717788e98a30e18b7a37adba2528d1cb1b67f16

See more details on using hashes here.

File details

Details for the file casso_pg-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: casso_pg-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for casso_pg-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e2085bc9a45983601224f78c6e10496f64bf884e22e50660c68bd6a2a7bf7e87
MD5 a0185ce2bd27df16f0a532488b44737d
BLAKE2b-256 760550ebc35cbc65e396f139c99e6d500a83d0e215ee985185a3efc8b8717523

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