SDK Documentation
Integrate ZenPay's payment processing capabilities into your applications with our official SDKs.
Quick Start
Install ZenPay SDK
npm install @zenpay/js
yarn add @zenpay/js
Initialize ZenPay
import { ZenPay } from '@zenpay/js';
// Initialize with your public API key
const zenpay = new ZenPay('pk_test_ZenPay123456789DEMO');
Available SDKs
ZenPay offers official SDKs for popular programming languages and frameworks to simplify your integration process. Each SDK provides idiomatic access to our APIs and handles common tasks like authentication, error handling, and webhook validation.
JavaScript / TypeScript
For web and Node.js applications
Python
For server-side applications
Core SDK Features
All ZenPay SDKs provide a consistent set of core features designed to simplify integration with our payment APIs.
API Access
Complete access to all ZenPay API endpoints with properly structured requests and response handling. All SDKs handle authentication, error handling, and retry logic automatically.
Webhook Handling
Utilities for verifying and processing ZenPay webhooks, making it easy to respond to payment events in real-time. Includes signature validation and event parsing functionality.
Framework Integrations
Language-specific framework integrations that make it easier to use ZenPay with popular web frameworks like React, Angular, Vue, Rails, Django, Laravel, and more.
Idiomatic Implementation
Each SDK follows the conventions and best practices of its target language or platform, providing a natural and familiar developer experience for users of that ecosystem.
Getting Started
Follow these general steps to get started with any ZenPay SDK:
Install the SDK
Use your language's package manager to install the ZenPay SDK:
# Example for JavaScript npm install @zenpay/js
Initialize with API Keys
Configure the SDK with your API keys. Always use test keys for development.
// JavaScript example const zenpay = new ZenPay('sk_test_your_secret_key');
Create Your First Payment
Use the SDK to create a payment:
// Create a payment const payment = await zenpay.payments.create({ amount: 2000, // $20.00 currency: 'usd', payment_method: 'pm_card_visa', description: 'Example payment' });
Handle Webhooks
Process webhook events to get notified about payment status changes:
// Verify and process webhooks const event = zenpay.webhooks.constructEvent( requestBody, signature, webhookSecret );
Client Libraries vs. Server SDKs
ZenPay offers two categories of integration libraries:
Server-Side SDKs
Our server-side SDKs provide full API access and should be used for operations that require your secret API key, such as creating payments, managing subscriptions, and handling webhooks.
- Secure secret key operations
- Complete API access
- Webhook processing
Available for Node.js, Python, PHP, Ruby, Java, .NET, and more.
Client-Side Libraries
Our client-side libraries are designed for browser environments and work with your publishable API key to safely collect payment information and create payment tokens.
- Secure card collection
- Payment UI components
- Mobile wallet integration
Available for browsers, React, Vue, Angular, iOS, and Android.
Next Steps
Choose a language-specific SDK guide or explore these related resources: