Issue a dedicated developer API key
Create one scoped key per pilot integration from the console. Store it in the agent platform's server-side secret manager; never use an owner key in an agent runtime.
Developer quickstart
LedgerLens sits beside your agent and payment provider. Send the six artifacts before or after execution; receive a signed packet, completeness score, and rail-specific recourse route.
01 · Enforce
Create a policy in guided setup, then call the preflight endpoint before Stripe, Mastercard, Visa, a bank API, procurement system, or x402. LedgerLens checks the merchant allowlist, payment cap, daily budget, approval threshold, and hourly velocity. It fails closed when no active policy exists.
npm install https://ledgerlens.dev/sdk/ledgerlens-sdk-0.1.0.tgz
const decision = await ledgerLens.preflight({
agent_id: "agent_finops_07",
merchant: "Northstar Compute",
amount_minor: 384000,
currency: "USD"
});
// Execute only after allow; then commit the reservation.
// review waits for approval; deny must stop execution.An allow reserves budget for 15 minutes. Commit after provider success, or release after failure. The SDK's protectPayment helper performs this lifecycle.
02 · Capture
Authenticate with a scoped LedgerLens key. The payload remains identical whether execution came from a Mastercard or Visa API, Stripe, ACH, a procurement system, or x402.
curl https://api.ledgerlens.dev/api/v1/evidence \\
-H "Authorization: Bearer <ledgerlens_api_key>" \\
-H "Content-Type: application/json" \\
--data @evidence.json{
"capture_mode": "inline",
"agent": { "id": "agent_finops_07", "name": "Cloud FinOps Agent", "provider": "your-platform" },
"authority_chain": [
{ "actor_type": "principal", "id": "cfo_17", "name": "Finance approver" },
{ "actor_type": "agent", "id": "agent_finops_07", "name": "Cloud FinOps Agent" }
],
"mandate": { "principal_id": "cfo_17", "scope": "Cloud infrastructure under $5,000", "max_amount_minor": 500000 },
"intent": { "merchant": "Northstar Compute", "description": "Reserved GPU capacity", "amount_minor": 384000, "currency": "USD" },
"offer": { "merchant": "Northstar Compute", "amount_minor": 384000, "currency": "USD", "quote_id": "quote_2026_184" },
"policy": { "policy_id": "finops-prod", "version": 12, "decision": "allow", "approvals": ["budget", "vendor"] },
"execution": { "rail": "Mastercard Agent Pay", "external_ref": "mc_agentpay_184", "payment_intent_id": "mcpi_184", "authorization_status": "approved", "amount_minor": 384000, "merchant": "Northstar Compute" },
"receipt": { "status": "settled", "network_reference": "mc_auth_902184" }
}03 · Rail mapping
Mastercard Agent PayCanonical liveVisa TAP / AP2Canonical liveStripe cardNative adapterACH bank APICanonical liveprocurementCanonical livex402Native adapter“Canonical live” means the Universal Evidence API accepts and scores the rail today. “Native adapter” means LedgerLens also ships a dedicated provider/protocol transformer.
04 · Verify
Create an expiring verification link from any transaction drawer. The public result includes content hashes, packet root, Ed25519 signature, and public key—without mandate payloads or payment credentials.
POST /api/v1/transactions/{transaction_id}/share\nGET /api/v1/verify/{verification_token}05 · Operate
Configure endpoints in the console. LedgerLens signs deliveries, retains outcomes, retries transient failures with bounded backoff, and sends terminal failures to a dead-letter queue.
x-ledgerlens-signature: <hmac_sha256>\ntransaction.captured\ndispute.opened\nintegration.test
evidence.exported06 · Production pilot
LedgerLens is ready for evidence-capture pilots today. This checklist separates the working product, customer integration work, and partner-dependent infrastructure.
Create one scoped key per pilot integration from the console. Store it in the agent platform's server-side secret manager; never use an owner key in an agent runtime.
Send the agent's mandate, intent, offer, policy result, execution event, and receipt to the Universal Evidence API for every protected transaction.
These rails work through canonical capture today. Official native connectors require network access, certification, credentials, and a design partner.
Runtime preflight now returns allow, review, or deny before execution and reserves budget against daily and velocity limits. The SDK commits or releases the reservation around the payment-provider call.
Cases, attribution, exports, and verification work today. Submitting disputes into issuer or network systems requires a participating issuer, acquirer, or network integration.
First-party health checks, queue observability, and bounded retries are live. A customer SLA also requires independent probes, on-call alerts, escalation policy, and reporting.
Start with one developer key and one real card, bank, or x402 agent. Expand into certified provider and dispute workflows with the relevant design partner.