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
The first open-source payment SDK designed specifically for AI agents and chatbots - ACP Compatible
Documentation • NPM Package • Discord • X • API Docs
Quick Start
# Install the SDK
npm install shora-ai-payment-sdk
# Or with yarn
yarn add shora-ai-payment-sdkimport ShoraSDK from 'shora-ai-payment-sdk';
// Initialize the SDK
const shora = new ShoraSDK({
apiKey: process.env.SHORA_API_KEY,
environment: 'sandbox'
});
// Create a payment session
const session = await shora.createPaymentSession({
amount: 2999,
currency: 'USD',
description: 'AI Service Subscription',
customer: {
email: 'customer@example.com',
name: 'John Doe'
}
});
console.log('Checkout URL:', session.payment_url);Installation
npm install shora-ai-payment-sdk
# or
yarn add shora-ai-payment-sdkimport ShoraSDK from 'shora-ai-payment-sdk';
const shora = new ShoraSDK({
apiKey: process.env.SHORA_API_KEY,
environment: 'sandbox'
});Demo
Run the included demo to see the SDK in action:
git clone https://github.com/shoraco/shora-ai-payment-sdk
cd shora-ai-payment-sdk
npm install
npm run demoThe demo includes:
- AI chatbot payment integration
- Real payment processing simulation
- Webhook event handling
Why Choose Shora?
Built specifically for the AI era, Shora provides everything you need to integrate payments into AI agents and chatbots.
| Feature | Traditional SDKs | Shora SDK |
|---|---|---|
| AI Agent Ready | No | Yes |
| Mandate Management | No | Yes |
| Token-based Payments | No | Yes |
| Real-time Webhooks | No | Yes |
| Multi-currency | Limited | Full Support |
| Open Source | No | MIT License |
Features
ACP (Agentic Commerce Protocol) Compatible
- Full compliance with OpenAI/Stripe ACP specification
- Direct integration with ChatGPT and other AI agents
- Secure payment token sharing between buyers and businesses
- Merchants maintain customer relationships and product control
AI Agent Features
- Create, activate, and cancel payment mandates for AI agents
- Secure payment tokens with TTL for agent transactions
- Complete shopping cart management for AI agents
- Token-based payments with PSP routing and failover
- Direct integration with AI agents and chatbots
Enterprise Features
- Multi-tenant support with isolated data per organization
- Complete transaction audit trail
- Real-time payment event notifications
- Tier-based API access control
- OAuth2 + API key hybrid authentication
Global Support
- Multi-currency support for USD, EUR, TRY, GBP, and more
- Turkish PSP integration with PayTR, İyzico, Moka United
- Global PSP support including Stripe, PayPal, Adyen
- 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-sdk3. 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 demoDemo Features
- AI Chatbot - Interactive payment flow
- Payment Processing - Real payment simulation
- 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 (80% coverage)
npm test
# Run linting
npm run lint
# Run demo
npm run demoTesting & Quality
# Run all tests (80% coverage)
npm test
# Run unit tests only
npm run test:unit
# Run integration tests
npm run test:integration
# Run with coverage report
npm run test:coverage
# Run linting
npm run lint
# Build for production
npm run buildTest Coverage: 80%+ coverage with Jest framework Code Quality: ESLint + Prettier for consistent code style API Documentation: Swagger docs available at api.shora.cloud/docs
Environment Variables
SHORA_API_KEY=your_api_key_here
SHORA_BASE_URL=https://api.shora.cloud
SHORA_WEBHOOK_SECRET=your_webhook_secretLicense
MIT License - see LICENSE file for details.
Support
- Documentation: https://docs.shora.co
- API Reference: https://api.shora.cloud/docs
- Support Email: dev@shora.co
- GitHub Issues: https://github.com/shora-ai/shora-ai-payment-sdk/issues
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- 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
- Documentation: docs.shora.co
- Discord: discord.gg/shora
- Twitter: @shora_co
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Email: dev@shora.co
- GitHub Issues: Create an issue
- Discord: Join our community
Shora AI Payment SDK - Commerce infrastructure for the AI era