Node.js SDK
Integrate ZSI Pay into your Node.js application with a simple, type-safe SDK for creating payments, retrieving payment sessions, and securely verifying webhooks.
npm install zsi-payBuild with ZSI Pay
The ZSI Pay Node.js SDK provides a convenient interface around the ZSI Pay API, so you can focus on your application instead of handling HTTP requests and authentication manually.
Create payments
Create secure payment sessions and redirect customers to the ZSI Pay checkout.
Retrieve sessions
Retrieve payment information using the unique payment tracking ID.
Verify webhooks
Securely verify webhook signatures before processing payment events.
TypeScript ready
Use the SDK with TypeScript for strong typing and a better development experience.
A simple integration
Initialize the SDK with your API credentials and create a payment session in just a few lines.
import { ZSIPay } from "zsi-pay";
const zsiPay = new ZSIPay({
apiKey: process.env.ZSI_PAY_API_KEY!,
apiSecret: process.env.ZSI_PAY_API_SECRET!,
});
const payment = await zsiPay.pay.init({
customer_email: "customer@example.com",
currency: "USD",
items: [
{
id: "item_123",
name: "Premium Subscription",
quantity: 1,
price: 5000,
},
],
});
console.log(payment.url);How it works
A typical ZSI Pay integration follows a simple payment flow.
Initialize
Initialize the SDK using your API credentials.
Create
Create a payment session from your backend.
Checkout
Redirect your customer to the secure ZSI Pay checkout.
Confirm
Use webhooks or the session API to confirm payment status.
Keep your credentials secure
Your API Secret and Webhook Secret are sensitive credentials. Store them in server-side environment variables and never expose them in browser or client-side code.
ZSI_PAY_API_KEY=your_api_key
ZSI_PAY_API_SECRET=your_api_secret
ZSI_PAY_WEBHOOK_SECRET=your_webhook_secretContinue building
Installation
βInstall the SDK and prepare your Node.js project.
Quickstart
βCreate your first ZSI Pay payment.
Configuration
βConfigure credentials, environments, timeouts, and retries.
Payments
βLearn how to create and manage payment sessions.
Sessions
βRetrieve payment sessions using a track ID.
Webhooks
βVerify and securely process ZSI Pay webhook events.
