Developer quickstart

One evidence envelope.
Every payment rail.

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

Block or reserve spend before the provider call

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

POST /api/v1/evidence

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
Canonical request body
{
  "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

Provider APIs map into the same evidence model

Provider or railexecution.railCapture status
Mastercard Agent PayMastercard Agent PayCanonical live
Visa TAP / AP2Visa TAP / AP2Canonical live
Stripe PaymentIntentsStripe cardNative adapter
ACH / bank APIACH bank APICanonical live
SAP / Coupa / POprocurementCanonical live
x402 v2x402Native 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

Share proof without sharing private evidence

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

Signed, queued webhooks

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.exported

06 · Production pilot

What is ready—and what a serious pilot still requires

LedgerLens is ready for evidence-capture pilots today. This checklist separates the working product, customer integration work, and partner-dependent infrastructure.

Available now

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.

Pilot setup

Connect one real agent platform

Send the agent's mandate, intent, offer, policy result, execution event, and receipt to the Universal Evidence API for every protected transaction.

Partner dependent

Native Mastercard Agent Pay and Visa TAP / AP2 connectors

These rails work through canonical capture today. Official native connectors require network access, certification, credentials, and a design partner.

Available now

Pre-authorization enforcement

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.

Partner dependent

Issuer chargeback and arbitration submission

Cases, attribution, exports, and verification work today. Submitting disputes into issuer or network systems requires a participating issuer, acquirer, or network integration.

Before SLA

Independent uptime monitoring and alerting

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.