lexiso
v1.0.0
Published
Official SDK for Lexiso - AP2 authorization for AI agent payments
Maintainers
Readme
Lexiso SDK
Official JavaScript SDK for Lexiso - AP2-compliant authorization for AI agent payments.
Installation
npm install lexisoQuick Start
const { Lexiso } = require('lexiso');
const client = new Lexiso('sk_live_your_api_key');
// Authorize a purchase
const result = await client.authorize('agent_xxx', 25.00, {
merchant: 'Amazon',
category: 'shopping'
});
console.log(result.decision); // 'allow' or 'deny'
console.log(result.signature); // Cryptographic proofAP2 Mandate Flow
// 1. User creates intent
const intent = await client.createIntent('agent_xxx', 'Buy coffee under $10', {
max_amount: 10.00,
categories: ['food', 'beverage']
});
// 2. Agent proposes cart
const cart = await client.createCart('agent_xxx', intent.id, [
{ name: 'Latte', price: 5.50, quantity: 1 }
], 'Starbucks');
console.log(cart.decision); // 'allow' or 'deny'API Reference
Agents
createAgent(name, platform)- Register an AI agentlistAgents()- List all agentsrevokeAgent(agentId)- Revoke an agent
Policies
createPolicy(agentId, name, rules, currency)- Create spending policylistPolicies(agentId)- List policiesupdatePolicy(policyId, updates)- Update a policy
Authorization
authorize(agentId, amount, options)- Authorize a transaction
AP2 Mandates
createIntent(agentId, intent, constraints)- Create user intentcreateCart(agentId, intentId, items, merchant)- Submit cart for approval
License
MIT
