CertifiedData Agent Commerce Python SDK — provenance-aware payments for AI artifacts
Project description
certifieddata-agent-commerce
Python SDK for CertifiedData Agent Commerce — provenance-aware, policy-governed payments for AI agents and artifacts.
Install
pip install certifieddata-agent-commerce
Note: Install name is
certifieddata-agent-commerce. Import name iscertifieddata_agent_commerce(underscore, as required by Python naming conventions).
Quick start
from certifieddata_agent_commerce import CertifiedDataAgentCommerceClient
# Reads CDAC_API_KEY and CDAC_BASE_URL from environment automatically
client = CertifiedDataAgentCommerceClient()
# Phase 1 — agent declares intent
tx = client.transactions.create(
amount=2500, # cents ($25.00)
currency="usd",
rail="stripe",
)
# Phase 2 — attach provenance (binds AI decision record to payment)
client.transactions.attach_links(
tx["id"],
decision_record_id="dec_abc123",
)
# Phase 3+4 — capture: policy eval → settle → inline signed receipt
capture = client.transactions.capture(tx["id"])
receipt = capture["receipt"]
print(receipt["receipt_id"])
print(receipt["decision_record_id"])
print(receipt["sha256_hash"])
print(receipt["ed25519_sig"])
Configure
export CDAC_API_KEY=cdp_test_xxx
export CDAC_BASE_URL=https://sandbox.certifieddata.io # omit for live
| Environment | Key prefix | Base URL |
|---|---|---|
| Sandbox | cdp_test_ |
https://sandbox.certifieddata.io |
| Live | cdp_live_ |
https://certifieddata.io |
Verify receipts publicly
Verification requires no API key:
curl https://certifieddata.io/api/payments/verify/<receipt_id>
Returns:
{
"valid": true,
"hashValid": true,
"signatureValid": true,
"signingKeyId": "cd_root_2026",
"signatureAlg": "Ed25519"
}
Local development (mock server)
# Start mock server on port 3456
pip install flask
python examples/claude-demo/mock_server.py
# Run demo against mock
CDAC_API_KEY=cdp_test_any CDAC_BASE_URL=http://localhost:3456 \
python examples/claude-demo/demo.py
Receipt shape
Every successful capture returns an inline signed receipt:
{
"receipt_id": "rcpt_...",
"transaction_id": "txn_...",
"policy_id": "pol_...",
"decision_record_id": "dec_...",
"sha256_hash": "sha256:...",
"ed25519_sig": "..."
}
decision_record_id is the canonical provenance field linking the payment to the AI decision that triggered it.
Package names
| Context | Name |
|---|---|
pip install |
certifieddata-agent-commerce |
import |
certifieddata_agent_commerce |
| Main class | CertifiedDataAgentCommerceClient |
Python requires hyphens in distribution names and underscores in import names — these are the same package, different naming conventions.
Resources
License
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 certifieddata_agent_commerce-0.1.0.tar.gz.
File metadata
- Download URL: certifieddata_agent_commerce-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40d8057996563429a7fa46e6c7b1030396bf673c3d7cfee83e3621caf70db9fd
|
|
| MD5 |
27327a7c3634cae571a608cc03c46571
|
|
| BLAKE2b-256 |
6f2954a0cf562d91a9c0890aad0805a9e5fc23d9c02f0987dab847cc1dd1e631
|
Provenance
The following attestation bundles were made for certifieddata_agent_commerce-0.1.0.tar.gz:
Publisher:
publish-python.yml on certifieddata/certifieddata-agent-commerce-public
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
certifieddata_agent_commerce-0.1.0.tar.gz -
Subject digest:
40d8057996563429a7fa46e6c7b1030396bf673c3d7cfee83e3621caf70db9fd - Sigstore transparency entry: 1274971499
- Sigstore integration time:
-
Permalink:
certifieddata/certifieddata-agent-commerce-public@a33ad076fd29c4d3c76fecece94b915b2ef301c2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/certifieddata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a33ad076fd29c4d3c76fecece94b915b2ef301c2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file certifieddata_agent_commerce-0.1.0-py3-none-any.whl.
File metadata
- Download URL: certifieddata_agent_commerce-0.1.0-py3-none-any.whl
- Upload date:
- Size: 12.1 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 |
4441c8296c804a412d866d40f9ace5c27dfd737cd238d4bb06352183c1c8fac4
|
|
| MD5 |
383e79ccc4c01c46dd51dc7269ae690a
|
|
| BLAKE2b-256 |
6ffe83443845b4b42819b16126f44b1bd9ae0a1bc2acc44817385d933e0f7940
|
Provenance
The following attestation bundles were made for certifieddata_agent_commerce-0.1.0-py3-none-any.whl:
Publisher:
publish-python.yml on certifieddata/certifieddata-agent-commerce-public
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
certifieddata_agent_commerce-0.1.0-py3-none-any.whl -
Subject digest:
4441c8296c804a412d866d40f9ace5c27dfd737cd238d4bb06352183c1c8fac4 - Sigstore transparency entry: 1274971552
- Sigstore integration time:
-
Permalink:
certifieddata/certifieddata-agent-commerce-public@a33ad076fd29c4d3c76fecece94b915b2ef301c2 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/certifieddata
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@a33ad076fd29c4d3c76fecece94b915b2ef301c2 -
Trigger Event:
release
-
Statement type: