Skip to main content

Overview

All transactions are recorded in an append-only ledger with cryptographic audit anchors for tamper-proof accounting.

List Ledger Entries

cURL
curl 'https://api.sardis.sh/api/v2/ledger/entries?limit=50' \
  -H "Authorization: Bearer sk_live_your_api_key"
Python
entries = client.ledger.list(limit=50)

for entry in entries:
    print(f"{entry.tx_id}: {entry.amount} {entry.currency}")

Response

{
  "entries": [
    {
      "tx_id": "tx_abc123",
      "mandate_id": "mandate_xyz789",
      "from_wallet": "wallet_abc123",
      "to_wallet": "0xRecipient...",
      "amount": "100.00",
      "currency": "USDC",
      "chain": "base",
      "chain_tx_hash": "0xabc123...",
      "audit_anchor": "0x7b2a3f1e...",
      "created_at": "2025-03-03T10:00:00Z"
    }
  ]
}

Get Ledger Entry

cURL
curl https://api.sardis.sh/api/v2/ledger/entries/tx_abc123 \
  -H "Authorization: Bearer sk_live_your_api_key"

Verify Entry Integrity

Verify cryptographic audit anchor:
cURL
curl https://api.sardis.sh/api/v2/ledger/entries/tx_abc123/verify \
  -H "Authorization: Bearer sk_live_your_api_key"

Response

{
  "valid": true,
  "anchor": "0x7b2a3f1e...",
  "tx_id": "tx_abc123",
  "tx_hash": "0xabc123...",
  "receipt_id": "receipt_xyz789",
  "merkle_root": "0x9c4d2a...",
  "current_root": "0x9c4d2a...",
  "is_current_root": true,
  "checks": {
    "receipt_exists": true,
    "hash_matches": true,
    "merkle_valid": true
  }
}

Filter by Wallet

cURL
curl 'https://api.sardis.sh/api/v2/ledger/entries?wallet_id=wallet_abc123' \
  -H "Authorization: Bearer sk_live_your_api_key"

Recent Transactions

cURL
curl 'https://api.sardis.sh/api/v2/ledger/recent?limit=20' \
  -H "Authorization: Bearer sk_live_your_api_key"

Response

[
  {
    "tx_id": "tx_abc123",
    "from_wallet": "wallet_abc123",
    "to_wallet": "0xRecipient...",
    "amount": "100.00",
    "currency": "USDC",
    "chain": "base",
    "chain_tx_hash": "0xabc123...",
    "audit_anchor": "0x7b2a3f1e...",
    "created_at": "2025-03-03T10:00:00Z",
    "status": "confirmed"
  }
]

Audit Trail Properties

Every ledger entry includes:
  • tx_id: Unique transaction identifier
  • mandate_id: Payment mandate reference
  • chain_tx_hash: On-chain transaction hash
  • audit_anchor: Cryptographic proof (Merkle root)
  • timestamp: ISO 8601 timestamp
  • immutability: Append-only, no modifications

Export Ledger

Export ledger for accounting (CSV format):
curl 'https://api.sardis.sh/api/v2/ledger/export?format=csv&start_date=2025-03-01' \
  -H "Authorization: Bearer sk_live_your_api_key" \
  > ledger_export.csv

Build docs developers (and LLMs) love