Merchant SDK for the HonorNet agent-transaction acceptance network
Project description
honornet-sdk
The Python merchant SDK for the HonorNet acceptance network — authorize AI-agent-initiated transactions in real time.
Async-first, with a synchronous wrapper. Pure Python, no native dependencies.
Install
pip install honornet-sdk
Authorize a transaction
from honornet import Client, Money, Transaction
client = Client("https://api.honornet.ai", api_key="sk_live_...")
result = client.authorize(
credential=agent_credential, # presented by the agent
transaction=Transaction(
merchant_id="merchant_123",
amount=Money("USD", 4999), # integer minor units
merchant_category_code="5732",
country="US",
),
)
if result.approved:
fulfil_order(result.authorization_code)
else:
handle_decline(result.decline_reason)
authorize returns an AuthorizeResult for every outcome — approve,
decline, or review. Call result.raise_for_decision() to turn a
non-approval into a typed exception (ScopeDeclinedError,
CredentialDeclinedError, …) instead.
Async
from honornet import AsyncClient
async with AsyncClient("https://api.honornet.ai") as client:
result = await client.authorize(credential=cred, transaction=txn)
Verify a decision
Every decision is recorded in HonorNet's append-only, cryptographically
verifiable log. Confirm one independently — record signature, Merkle inclusion
proof, signed log root, and that the signing key is a genuine published HonorNet
ledger key — with the public honornet-verify library:
from honornet import verify_decision
# Trust-anchored to the published HonorNet key-set by default.
verified = verify_decision(client, result.decision_id)
assert verified.verification.ok and verified.trust_anchored
Pass trusted_keys= to pin to a different key-set (e.g. a sandbox ledger), or
trusted_keys=None for structural-only verification. Verification adds a round
trip, so latency-sensitive paths skip it and verify out of band.
Built in
- Idempotency — every call carries an auto-generated idempotency key, so a
retried request never creates a second decision. Override it with
idempotency_key=.... - Retries — connection errors, timeouts, HTTP 429 and 5xx are retried up to three times with exponential backoff.
- Typed errors — transport failures raise
HonorNet*Error; declines map toDeclinedErrorsubclasses;DeclineReasonenumerates the full taxonomy.
Framework middleware
Drop-in middleware for FastAPI lives at honornet.middleware.fastapi — see
examples/fastapi-middleware.
Licence
Apache-2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file honornet_sdk-0.2.0.tar.gz.
File metadata
- Download URL: honornet_sdk-0.2.0.tar.gz
- Upload date:
- Size: 18.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bc2f0dd8b71e9831780df05ca25485c5fb330277cbd5183e6121c973519b2d5
|
|
| MD5 |
07fbeaaf71fd9c16142ef18033e187d9
|
|
| BLAKE2b-256 |
a7020ac55f2f5773c34bd1fdcbc29e95537de2847155b223eeb8af2e4ada28bb
|
Provenance
The following attestation bundles were made for honornet_sdk-0.2.0.tar.gz:
Publisher:
publish-python.yml on HonorNetAI/HonornetAI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
honornet_sdk-0.2.0.tar.gz -
Subject digest:
7bc2f0dd8b71e9831780df05ca25485c5fb330277cbd5183e6121c973519b2d5 - Sigstore transparency entry: 1806237836
- Sigstore integration time:
-
Permalink:
HonorNetAI/HonornetAI@ea39f9054a030d72bcfaa7e1153da74216251c9c -
Branch / Tag:
refs/tags/honornet-sdk-v0.2.0 - Owner: https://github.com/HonorNetAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@ea39f9054a030d72bcfaa7e1153da74216251c9c -
Trigger Event:
push
-
Statement type:
File details
Details for the file honornet_sdk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: honornet_sdk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
229b46431fcfb014dbd0a19f0296b826eb14c91b1dd846d0ac6b9a053b41426b
|
|
| MD5 |
6f72e5291273dd3a15a934d4936b6687
|
|
| BLAKE2b-256 |
8f0c1604c61c5c52ab8e0ac1d98759b6d0624e13539921b4566d45bfa5cea78e
|
Provenance
The following attestation bundles were made for honornet_sdk-0.2.0-py3-none-any.whl:
Publisher:
publish-python.yml on HonorNetAI/HonornetAI
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
honornet_sdk-0.2.0-py3-none-any.whl -
Subject digest:
229b46431fcfb014dbd0a19f0296b826eb14c91b1dd846d0ac6b9a053b41426b - Sigstore transparency entry: 1806238509
- Sigstore integration time:
-
Permalink:
HonorNetAI/HonornetAI@ea39f9054a030d72bcfaa7e1153da74216251c9c -
Branch / Tag:
refs/tags/honornet-sdk-v0.2.0 - Owner: https://github.com/HonorNetAI
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@ea39f9054a030d72bcfaa7e1153da74216251c9c -
Trigger Event:
push
-
Statement type: