Integrate ZenPay's payment processing capabilities into your applications with our official SDKs.
npm install @zenpay/jsyarn add @zenpay/jsimport { ZenPay } from '@zenpay/js';
// Initialize with your public API key
const zenpay = new ZenPay('pk_test_ZenPay123456789DEMO');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.
For web and Node.js applications
npm install @zenpay/jsFor server-side applications
pip install zenpayFor Java applications
Maven or Gradle compatibleAll ZenPay SDKs provide a consistent set of core features designed to simplify integration with our payment APIs.
Complete access to all ZenPay API endpoints with properly structured requests and response handling. All SDKs handle authentication, error handling, and retry logic automatically.
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.
Language-specific framework integrations that make it easier to use ZenPay with popular web frameworks like React, Angular, Vue, Rails, Django, Laravel, and more.
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.
Follow these general steps to get started with any ZenPay SDK:
Use your language's package manager to install the ZenPay SDK:
# Example for JavaScript\nnpm install @zenpay/jsConfigure the SDK with your API keys. Always use test keys for development.
// JavaScript example
const zenpay = new ZenPay('sk_test_your_secret_key');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'
});Process webhook events to get notified about payment status changes:
// Verify and process webhooks
const event = zenpay.webhooks.constructEvent(
requestBody,
signature,
webhookSecret
);ZenPay offers two categories of integration libraries:
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.
Available for Node.js, Python, PHP, Ruby, Java, .NET, and more.
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.
Available for browsers, React, Vue, Angular, iOS, and Android.