JSPM

  • Created
  • Published
  • Downloads 44
  • Score
    100M100P100Q96048F
  • License MIT

The first open-source payment SDK designed specifically for AI agents and chatbots

Package Exports

  • shora-ai-payment-sdk
  • shora-ai-payment-sdk/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (shora-ai-payment-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Shora AI Payment SDK

Commerce infrastructure for the AI era

npm version npm downloads GitHub stars License: MIT TypeScript CI

The first open-source payment SDK designed specifically for AI agents and chatbots - ACP Compatible

DocumentationNPM PackageDiscordTwitter

Quickstart (30 seconds)

# Install the SDK
npm install shora-ai-payment-sdk

# Or with yarn
yarn add shora-ai-payment-sdk
import ShoraSDK from 'shora-ai-payment-sdk';

// Initialize with your API key
const shora = new ShoraSDK({
  apiKey: 'your_api_key_here',
  environment: 'sandbox' // or 'production'
});

// Create a payment session for your AI agent
const session = await shora.createPaymentSession({
  amount: 2999, // $29.99 in cents
  currency: 'USD',
  description: 'AI Agent Subscription',
  customer: {
    email: 'user@example.com',
    name: 'John Doe'
  }
});

console.log('Payment URL:', session.payment_url);

NPM Package

Install: npm install shora-ai-payment-sdk
Import: import ShoraSDK from 'shora-ai-payment-sdk'
TypeScript: Full TypeScript support included

Basic Usage

import ShoraSDK from 'shora-ai-payment-sdk';

const shora = new ShoraSDK({
  apiKey: process.env.SHORA_API_KEY,
  environment: 'sandbox'
});

// Your AI agent is ready to process payments!

Demo

Local Demo:

# Clone and run the demo
git clone https://github.com/shoraco/shora-ai-payment-sdk
cd shora-ai-payment-sdk
npm install
npm run demo
  • AI Chatbot Integration - Interactive payment flow
  • Payment Processing - Real payment simulation
  • Webhook Handling - Real-time notifications

Why Shora?

Feature Traditional SDKs Shora SDK
AI Agent Ready Built for AI
Mandate Management Agent Authorization
Token-based Payments Secure Tokens
Real-time Webhooks Instant Notifications
Multi-currency Limited Global Support
Open Source MIT License

Features

ACP (Agentic Commerce Protocol) Compatible

  • ACP Checkout: Full compliance with OpenAI/Stripe ACP specification
  • Agent Integration: Direct integration with ChatGPT and other AI agents
  • Secure Tokens: Payment token sharing between buyers and businesses
  • Business Control: Merchants maintain customer relationships and product control

AI Agent Features

  • Mandate Management: Create, activate, and cancel payment mandates for AI agents
  • Token Generation: Secure payment tokens with TTL for agent transactions
  • Checkout Sessions: Complete shopping cart management for AI agents
  • Payment Processing: Token-based payments with PSP routing and failover
  • Agent Integration: Direct integration with AI agents and chatbots

Enterprise Features

  • Multi-tenant Support: Isolated data per organization
  • Audit Logs: Complete transaction audit trail
  • Custom Webhooks: Real-time payment event notifications
  • Rate Limiting: Tier-based API access control
  • OAuth2 + API Key: Hybrid authentication system

Global Support

  • Multi-currency: USD, EUR, TRY, GBP, and more
  • Turkish PSPs: PayTR, İyzico, Moka United integration
  • Global PSPs: Stripe, PayPal, Adyen support
  • Real-time: Instant payment confirmations

Use Cases

ACP Integration

// ACP-compatible checkout for AI agents
const checkout = await shora.createACPCheckout({
  amount: 150.00,
  currency: 'USD',
  description: 'AI Service Subscription',
  agent_id: 'chatgpt-user-123',
  business_id: 'merchant-456',
  product_id: 'service-premium',
  quantity: 1,
  customer: {
    email: 'user@example.com',
    name: 'John Doe'
  }
});

AI Chatbots & Agents

// AI agent processes payment
const payment = await shora.agents.pay({
  token: agentToken,
  amount: 150.00,
  currency: 'USD',
  description: 'AI Service Subscription'
});

E-commerce Integration

// E-commerce checkout
const session = await shora.createPaymentSession({
  amount: 9999, // $99.99
  currency: 'USD',
  customer: { email: 'customer@example.com' },
  items: [
    { name: 'Premium Plan', price: 9999, quantity: 1 }
  ]
});

Subscription Management

// Recurring payments
const mandate = await shora.agents.createMandate({
  agent_id: 'subscription-bot',
  max_amount: 5000.00,
  currency: 'USD',
  expires_at: '2025-12-31T23:59:59Z'
});

Getting Started

1. Get Your API Key

Free Tier: Get started for free

  • 100 transactions/month
  • Sandbox environment
  • Basic support

Pro Tier: Upgrade to Pro

  • 10,000 transactions/month
  • Production environment
  • Priority support

2. Install the SDK

npm install shora-ai-payment-sdk

3. Initialize and Start Building

import ShoraSDK from 'shora-ai-payment-sdk';

const shora = new ShoraSDK({
  apiKey: process.env.SHORA_API_KEY,
  environment: 'sandbox'
});

// Your AI agent is ready to process payments!

API Reference

Agent Payment Endpoints

Endpoint Method Description
/v2/agents/mandates POST Create payment mandate
/v2/agents/tokens POST Generate payment token
/v2/agents/checkout-sessions POST Create checkout session
/v2/agents/pay POST Process payment
/v2/agents/mandates/{id} GET Get mandate details
/v2/agents/payments/{id} GET Get payment details

Payment Endpoints

Endpoint Method Description
/v2/payments/sessions POST Create payment session
/v2/payments/process POST Process payment
/v2/payments/refund POST Refund payment
/v2/transactions/{id} GET Get transaction details
/v2/transactions GET List transactions

Webhook Endpoints

Endpoint Method Description
/v2/webhooks POST Create webhook
/v2/webhooks/{id}/test POST Test webhook
/v2/webhooks/events GET List webhook events

Example Usage

Basic Payment Flow

// 1. Create payment session
const session = await shora.createPaymentSession({
  amount: 2999, // $29.99
  currency: 'USD',
  description: 'AI Service Subscription',
  customer: {
    email: 'user@example.com',
    name: 'John Doe'
  }
});

// 2. Process payment
const payment = await shora.processPayment({
  sessionId: session.id,
  paymentMethod: 'card',
  cardToken: 'tok_1234567890'
});

// 3. Handle webhook
app.post('/webhook', (req, res) => {
  const event = req.body;
  if (event.type === 'payment.completed') {
    console.log('Payment completed:', event.data);
  }
});

AI Agent Integration

// AI agent creates mandate
const mandate = await shora.agents.createMandate({
  agent_id: 'chatbot-123',
  max_amount: 1000.00,
  currency: 'USD',
  expires_at: '2025-12-31T23:59:59Z'
});

// Generate secure token
const token = await shora.agents.generateToken({
  mandate_id: mandate.id,
  amount: 150.00,
  currency: 'USD'
});

// Process payment with token
const payment = await shora.agents.pay({
  token: token.value,
  amount: 150.00,
  currency: 'USD'
});

Demo & Examples

Live Demo

Try it now: demo.shora.co

Local Demo

# Clone the repository
git clone https://github.com/shoraco/shora-ai-payment-sdk
cd shora-ai-payment-sdk

# Install dependencies
npm install

# Run the demo
npm run demo

Demo Features

  1. AI Chatbot - Interactive payment flow
  2. Payment Processing - Real payment simulation
  3. Webhook Handling - Real-time notifications

Enterprise Features

Advanced Security

  • OAuth2 + API Key: Hybrid authentication system
  • Multi-tenant: Isolated data per organization
  • Audit Logs: Complete transaction audit trail
  • Rate Limiting: Tier-based API access control

Analytics & Monitoring

  • Real-time Dashboard: app.shora.cloud
  • Transaction Analytics: Revenue tracking and insights
  • Webhook Management: Custom event notifications

Global Infrastructure

  • Multi-currency: USD, EUR, TRY, GBP, and more
  • Turkish PSPs: PayTR, İyzico, Moka United integration
  • Global PSPs: Stripe, PayPal, Adyen support
  • Cloudflare CDN: Worldwide low-latency access

Pricing

Plan Price Transactions Features
Free $0/month 100/month Sandbox, Basic Support
Pro $99/month 10,000/month Production, Priority Support, Analytics
Enterprise $499/month 100,000/month Custom Integration, SLA, Dedicated Support

Get started: app.shora.cloud/signup

Architecture

┌─────────────────┐    ┌─────────────────┐    ┌─────────────────┐
│   AI Agent      │───▶│  Shora SDK     │───▶│  Shora Core    │
│   (Chatbot)     │    │                 │    │  (Payment      │
│                 │    │  Mandate        │    │   Processing)   │
│                 │    │  Management     │    │                 │
└─────────────────┘    └─────────────────┘    └─────────────────┘
                                │
                                ▼
                       ┌─────────────────┐
                       │   Turkish PSPs  │
                       │   (PayTR,       │
                       │    İyzico,      │
                       │    Moka)      │
                       └─────────────────┘

Security

  • Token-based Authentication: Secure payment tokens with TTL
  • Mandate Validation: AI agent authorization verification
  • PCI Compliance: No PCI data exposure
  • Rate Limiting: Built-in request rate limiting
  • Webhook Security: HMAC signature verification

Development

Prerequisites

  • Node.js 18+
  • npm or yarn
  • Shora Core API access

Local Development

# Install dependencies
npm install

# Copy environment file
cp env.example .env

# Start development server
npm run dev

# Run tests
npm test

# Run demo
npm run demo

Enterprise Development

# Run all tests
npm run test

# Run load tests
npm run test:load

# Run security tests
npm run test:security

# Run linting
npm run lint

# Build for production
npm run build

Environment Variables

SHORA_API_KEY=your_api_key_here
SHORA_BASE_URL=https://api.shora.cloud
SHORA_WEBHOOK_SECRET=your_webhook_secret

License

MIT License - see LICENSE file for details.

Support

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

Roadmap

  • Webhook handling for payment events
  • Multi-currency support
  • Advanced fraud detection
  • Real-time payment status updates
  • Integration with popular AI frameworks

Community & Support

Resources

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support


Star this repository if you find it helpful!

GitHub stars GitHub forks

Made with love by the Shora Team


Shora AI Payment SDK - Commerce infrastructure for the AI era