
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
shora-ai-payment-sdk
Advanced tools
The first open-source payment SDK designed specifically for AI agents and chatbots - ACP Compatible
Commerce infrastructure for the AI era.
Install the SDK and start processing payments in under 2 minutes.
npm install shora-ai-payment-sdk
Need help? Check our Developer Documentation
For development and testing, you can use generated API keys:
# Generate test API keys
node -e "
const crypto = require('crypto');
console.log('Sandbox Key:', 'shora_test_' + crypto.randomBytes(32).toString('base64url'));
console.log('Production Key:', 'shora_live_' + crypto.randomBytes(32).toString('base64url'));
"
For production, register a merchant to get official API keys:
curl -X POST https://api.shora.cloud/merchants/register \
-H "Content-Type: application/json" \
-d '{
"business_name": "Your Store",
"business_type": "ecommerce",
"contact_name": "Your Name",
"contact_email": "your@email.com"
}'
import ShoraSDK from 'shora-ai-payment-sdk';
// Use your API key from app.shora.cloud
const sdk = new ShoraSDK({
apiKey: 'your_api_key_from_shora_app', // Get it from app.shora.cloud
environment: 'production' // or 'sandbox' for testing
});
// Create a payment session
const payment = await sdk.createPaymentSession({
amount: 100,
currency: 'TRY',
description: 'Test payment',
customer: { email: 'test@example.com' }
});
console.log('Payment created:', payment.id);
The Shora AI Payment SDK handles payment processing for modern applications. It provides secure payment sessions, automatic retry logic, and enterprise-grade security features. Built for developers who need reliable payment infrastructure without the complexity.
Core features include payment session management, WooCommerce integration, AES-256 encryption for sensitive data, and comprehensive audit logging. The SDK automatically retries failed requests and includes circuit breaker patterns for production reliability.
For development and testing, use generated API keys:
// Generate a test API key
const crypto = require('crypto');
const testKey = 'shora_test_' + crypto.randomBytes(32).toString('base64url');
console.log('Test API Key:', testKey);
For production, register a merchant to get official API keys:
# Register a new merchant
curl -X POST https://api.shora.cloud/merchants/register \
-H "Content-Type: application/json" \
-d '{
"business_name": "Your Store",
"business_type": "ecommerce",
"contact_name": "Your Name",
"contact_email": "your@email.com",
"contact_phone": "+1-555-0123",
"address_line1": "123 Main St",
"city": "Your City",
"state": "Your State",
"postal_code": "12345",
"country": "US"
}'
# Environment variables
export SHORA_API_KEY="shora_test_your_key_here"
export SHORA_ENVIRONMENT="sandbox"
The SDK resolves the API base URL in the following order:
config.baseUrl - Explicit baseUrl in SDK configuration (highest priority)SHORA_API_BASE_URL - Environment variablehttps://api.shora.cloud (only for environment: 'production')Important: For sandbox or staging environments, you must provide an explicit baseUrl or set SHORA_API_BASE_URL. The SDK will throw an error if you attempt to use sandbox/staging without an explicit baseUrl to prevent accidental production calls.
// Production (uses default if no baseUrl provided)
const sdk = new ShoraSDK({
apiKey: 'your-key',
environment: 'production'
});
// Sandbox requires explicit baseUrl
const sandboxSdk = new ShoraSDK({
apiKey: 'your-key',
environment: 'sandbox',
baseUrl: 'https://sandbox.api.shora.cloud' // Required!
});
// Or use environment variable
process.env.SHORA_API_BASE_URL = 'https://sandbox.api.shora.cloud';
const sandboxSdk2 = new ShoraSDK({
apiKey: 'your-key',
environment: 'sandbox'
});
The SDK accepts a simple configuration object:
interface ShoraConfig {
apiKey: string; // Your Shora API key
baseUrl?: string; // Custom API endpoint
environment?: 'sandbox' | 'production';
timeout?: number; // Request timeout in ms
tenantId?: string; // Multi-tenant support
encryptionKey?: string; // AES-256 encryption key
enableAuditLogging?: boolean; // Enable audit logs
auditLogEndpoint?: string; // Custom audit endpoint
}
Create payment sessions and process payments with automatic retry logic:
// Create a payment session
const session = await sdk.createPaymentSession({
amount: 250,
currency: 'TRY',
description: 'Product purchase',
customer: { email: 'customer@example.com' }
});
// Process the payment
const result = await sdk.processPayment(session.paymentId, 'card', 'tok_123');
For e-commerce applications, use the ACP checkout method:
const checkout = await sdk.payWithACP({
woo_product_id: 123,
amount: 99.99,
currency: 'USD',
customer_email: 'customer@store.com',
order_id: 'WC-12345'
});
// Redirect user to checkout.checkout_url
The SDK includes enterprise-grade security features:
// Encrypt sensitive tokens
const encrypted = sdk.encryptToken('sensitive-token');
const decrypted = sdk.decryptToken(encrypted);
// Generate secure payment tokens
const paymentToken = sdk.generateSecurePaymentToken({
amount: 100,
currency: 'TRY',
userId: 'user_123'
});
// Audit logging
sdk.logAudit('payment_created', 'Payment session created', 'session_123');
const logs = sdk.getAuditLogs('2024-01-01', '2024-12-31');
The SDK provides clear error handling with automatic retries:
try {
const payment = await sdk.createPaymentSession(request);
console.log('Success:', payment.paymentId);
} catch (error) {
if (error instanceof ShoraError) {
console.log('Error Code:', error.code);
console.log('Status:', error.status);
console.log('Message:', error.message);
}
}
Import Error? Check your module type in package.json. For CommonJS use require('shora-ai-payment-sdk').default, for ESM use import ShoraSDK from 'shora-ai-payment-sdk'.
Network Issues? The SDK automatically retries failed requests with exponential backoff. Increase the timeout if needed: new ShoraSDK({ timeout: 30000 }).
TypeScript Issues? Install types with npm install @types/node and use proper imports: import ShoraSDK, { PaymentRequest } from 'shora-ai-payment-sdk'.
Run the test suite to verify everything works:
npm test
For load testing with k6:
npm run test:load
Build the SDK from source:
npm install
npm run build
npm run lint
The SDK is optimized for production use with automatic retry logic, circuit breaker patterns, and in-memory caching. It handles 1000+ requests per second and includes comprehensive error recovery mechanisms.
This SDK has been optimized for production use with a clean dist folder, core payment functionality only, and enterprise-ready security features. The bundle size is kept minimal at 144K total.
API Key Errors
// Error: Invalid API key
// Solution: Check your API key format
const sdk = new ShoraSDK({
apiKey: 'shora_test_your_key_here', // Must start with 'shora_test_' or 'shora_live_'
environment: 'sandbox'
});
Connection Errors
// Error: Request failed with status code 404
// Solution: Check your base URL
const sdk = new ShoraSDK({
apiKey: 'your-key',
baseUrl: 'https://api.shora.cloud', // Use correct API endpoint
environment: 'sandbox'
});
Payment Endpoint Errors
// Error: Payment session creation failed
// Solution: Ensure merchant registration is complete
// For development, use generated API keys
// For production, register a merchant first
Enable debug logging to troubleshoot issues:
const sdk = new ShoraSDK({
apiKey: 'your-key',
environment: 'sandbox',
debug: true // Enable debug logging
});
Always check API health before processing payments:
const health = await sdk.healthCheck();
console.log('API Status:', health.status);
console.log('Database:', health.database);
console.log('Redis:', health.redis);
We believe the SDK grows stronger with community input:
The SDK is optimized for production use with automatic retry logic, circuit breaker patterns, and in-memory caching. It handles 1000+ requests per second and includes comprehensive error recovery mechanisms.
This SDK has been optimized for production use with a clean dist folder, core payment functionality only, and enterprise-ready security features. The bundle size is kept minimal at 144K total.
MIT
The SDK is designed for developer productivity with automatic retry logic, clear error messages, and comprehensive TypeScript support. Get started in 2 minutes and scale to production with confidence.
FAQs
The first open-source payment SDK designed specifically for AI agents and chatbots - ACP Compatible
The npm package shora-ai-payment-sdk receives a total of 14 weekly downloads. As such, shora-ai-payment-sdk popularity was classified as not popular.
We found that shora-ai-payment-sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.