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
Get your keys at certifieddata.io/dashboard/cdp/api-keys.
export CDAC_API_KEY=cdp_test_xxx
# CDAC_BASE_URL defaults to https://certifieddata.io — omit unless using a local mock
| Environment | Key prefix | Base URL |
|---|---|---|
| Test | cdp_test_ |
https://certifieddata.io |
| Live | cdp_live_ |
https://certifieddata.io |
Both environments route through the same host. The key prefix controls which environment is active.
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
Metadata
Release files for certifieddata-agent-commerce 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| certifieddata_agent_commerce-0.1.1.tar.gz | 7.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| certifieddata_agent_commerce-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.0 kB
Release files / certifieddata_agent_commerce-0.1.1.tar.gz
| Download URL | certifieddata_agent_commerce-0.1.1.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e81d81cae5e4d868bdc0b94d530403cbd87ab059457be10ed8517554b397c2fe
|
|
BLAKE2b-256 checksum How to use checksums |
2a9617cb3fba68668e570d51d97d63ddfb92f3c1dd398ff8278a420f0622922d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / certifieddata_agent_commerce-0.1.1-py3-none-any.whl
| Download URL | certifieddata_agent_commerce-0.1.1-py3-none-any.whl |
|---|---|
| Size | 12.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b047bdc4309025bf5352068a4a5a18a690b75fc24585bc557f8ac6156b5ccfbc
|
|
BLAKE2b-256 checksum How to use checksums |
0c723375e1b8debc9ca8058a8f3880e1cc77a71696eb87cacb078e495d1e52d5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|