Developer Documentation

Build with PayJarvis API

Everything you need to integrate AI agent governance into your platform. SDKs, API reference, and code examples.

Get started in 5 minutes

PayJarvis is a governance middleware for AI agents. It sits between your bot and the merchant, enforcing spending limits, requiring human approval, and maintaining an immutable audit trail. Every purchase your bot makes passes through our 4-layer verification system.

1

Install the SDK

Available for Node.js, Python, PHP, Java, and Go.

bash
npm install @payjarvis/agent-sdk
2

Initialize the client

Use your Bot API Key and Bot ID from the dashboard.

typescript
import { PayJarvis } from '@payjarvis/agent-sdk'

const pj = new PayJarvis({
  apiKey: 'pj_bot_xxxxxxxxxxxxxxxx',
  botId:  'bot_xxxxxxxxxxxxxxxx',
})
3

Request a payment decision

Before your bot completes a purchase, ask PayJarvis if it's allowed.

typescript
// Request a payment decision before checkout
const decision = await pj.requestPayment({
  amount: 49.99,
  currency: 'USD',
  category: 'shopping',
  merchantName: 'Amazon',
  description: 'Wireless headphones',
})

if (decision.approved) {
  // Proceed with purchase
  console.log('Transaction approved:', decision.transactionId)
} else if (decision.pending) {
  // Human approval required — poll or use SSE
  const status = await pj.waitForApproval(decision.approvalId)
} else {
  // Blocked by policy
  console.log('Blocked:', decision.reason)
}
4

Check reputation

Monitor your bot's trust score and transaction success rate.

typescript
// Get your bot's trust score and reputation
const rep = await pj.getReputation()
console.log('Trust Score:', rep.trustScore)  // 0-1000
console.log('Success rate:', rep.successRate) // 0-100%

Need help?

Our developer team is ready to help you integrate PayJarvis.