Node.js Integration Integration
Lightweight Node.js client APIs engineered for instant, non-custodial crypto settlements. Secure your transactions and accept direct-to-wallet Binance Pay and token payments with zero middlemen.
About This Integration
Everything you need to know about setting up this payment gateway
Accelerate your backend development with PayerURLβs official, open-source SDK for Node.js . Built under the MIT license, this lightweight package allows JavaScript and TypeScript developers to integrate a completely decentralized, direct-to-wallet checkout experience in under 10 minutes without requiring complex merchant account setups or KYC. The system automatically converts 169+ fiat currencies using real-time market exchange rates and securely signs every API payload using robust HMAC SHA256 signatures to prevent tampering. Once a user scans the personal Binance Pay QR code or transfers on-chain tokens, your applicationβs notify_url instantly receives a secure server-to-server webhook to automate your order workflows smoothly inside Express, NestJS, or Koa applications.
Need a Custom Solution?
For high-volume marketplaces, multi-vendor stores, and large enterprises. Get custom token integrations, dedicated API routing, and 24/7 priority developer support.
Why Developers Choose This Package
β οΈ Important: Server-Side Only
| Layer | What to do |
|---|---|
| Backend (Express, Next API, Nest, Nuxt server) | Create payment + verify webhook with this SDK |
| Frontend (React, Vue, Angular) | Call your API β redirect user to redirectUrl |
No Merchant Account Needed
Payments go directly to your crypto wallet with zero middlemen
169+ Fiat Currencies
USD, EUR, GBP, CAD and more β converted at live market rates
10-Minute Integration
Simple npm install, copy-paste code for any Node framework
Server-Side Secret Key Signing
HMAC signing stays on the backend β never exposed to the browser
Binance QR Code Payments
Customers scan and pay without ever leaving your app
Zero Hidden Fees
No platform surcharges β MIT open source
Express, Next.js, NestJS Ready
Works with any Node.js backend framework
Built-in Webhook Verification
verifyWebhook() handles auth, signature, and status automatically
Installation Guide
Follow these steps to get up and running in 10 Min
1π¦ Installation via npm
npm install @payerurl/crypto-checkout2π Environment Variables
Add to your .env file. Get keys at dash.payerurl.com:
PAYERURL_PUBLIC_KEY=your_public_key
PAYERURL_SECRET_KEY=your_secret_key3π Quick Start
import { Payerurl } from '@payerurl/crypto-checkout';
const payerurl = new Payerurl({
publicKey: process.env.PAYERURL_PUBLIC_KEY,
secretKey: process.env.PAYERURL_SECRET_KEY,
});
const result = await payerurl.payment({
invoiceId: `ORD-${Date.now()}`,
amount: 1000, // in cents / smallest unit
currency: 'usd',
data: {
first_name: 'Alice',
last_name: 'Smith',
email: '[email protected]',
redirect_url: 'https://yourdomain.com/success',
cancel_url: 'https://yourdomain.com/checkout',
notify_url: 'https://yourdomain.com/api/payerurl/notify', // required
},
orderItems: [
{ name: 'Order_item_name', qty: 1, price: '10.00' },
],
});
if (result.status) {
// Redirect customer to hosted checkout
console.log(result.redirectUrl);
} else {
console.error(result.message);
}π‘ Unlike the Laravel package, you must pass notify_url manually β there is no auto-registered route in Node.js.
4π Webhook Verification
const result = payerurl.verifyWebhook({
authorization: req.headers.authorization,
authStr: req.body?.authStr, // fallback if Authorization header is missing
body: req.body,
});
if (result.ok) {
const { order_id, transaction_id } = result.payload;
// β
Mark order as paid in your database
res.json({ status: 2040, message: result.payload });
} else {
res.status(400).json({ status: result.status, message: result.message });
}5π Express Integration
import express from 'express';
import { Payerurl } from '@payerurl/crypto-checkout';
const app = express();
app.use(express.urlencoded({ extended: true }));
app.use(express.json());
const payerurl = new Payerurl({
publicKey: process.env.PAYERURL_PUBLIC_KEY,
secretKey: process.env.PAYERURL_SECRET_KEY,
});
// ββ Create payment ββββββββββββββββββββββββββββββββββββββββββββββββ
app.post('/api/pay', async (req, res) => {
const result = await payerurl.payment({
invoiceId: `ORD-${Date.now()}`,
amount: Number(req.body.amount),
currency: 'usd',
data: {
first_name: req.body.first_name,
last_name: req.body.last_name,
email: req.body.email,
redirect_url: 'https://yourdomain.com/success',
cancel_url: 'https://yourdomain.com/checkout',
notify_url: 'https://yourdomain.com/api/payerurl/notify',
},
});
if (result.status) return res.json({ redirectUrl: result.redirectUrl });
return res.status(400).json({ error: result.message });
});
// ββ Webhook handler βββββββββββββββββββββββββββββββββββββββββββββββ
app.post('/api/payerurl/notify', (req, res) => {
const result = payerurl.verifyWebhook({
authorization: req.headers.authorization,
authStr: req.body?.authStr,
body: req.body,
});
if (!result.ok) {
return res.status(400).json({ status: result.status, message: result.message });
}
// β
Update order: result.payload.order_id
return res.json({ status: result.status, message: result.payload });
});6π Next.js (App Router) Integration
Payment route:
// app/api/pay/route.ts
import { Payerurl } from '@payerurl/crypto-checkout';
import { NextResponse } from 'next/server';
const payerurl = new Payerurl({
publicKey: process.env.PAYERURL_PUBLIC_KEY!,
secretKey: process.env.PAYERURL_SECRET_KEY!,
});
export async function POST(req: Request) {
const body = await req.json();
const result = await payerurl.payment({
invoiceId: body.invoiceId,
amount: body.amount,
currency: body.currency || 'usd',
data: {
...body.customer,
notify_url: `${process.env.NEXT_PUBLIC_APP_URL}/api/payerurl/notify`,
},
});
return NextResponse.json(result);
}Webhook notify route:
// app/api/payerurl/notify/route.ts
import { Payerurl } from '@payerurl/crypto-checkout';
import { NextResponse } from 'next/server';
const payerurl = new Payerurl({
publicKey: process.env.PAYERURL_PUBLIC_KEY!,
secretKey: process.env.PAYERURL_SECRET_KEY!,
});
export async function POST(req: Request) {
const body = await req.json().catch(async () => {
const text = await req.text();
return Object.fromEntries(new URLSearchParams(text));
});
const result = payerurl.verifyWebhook({
authorization: req.headers.get('authorization'),
authStr: body.authStr,
body,
});
if (!result.ok) {
return NextResponse.json(
{ status: result.status, message: result.message },
{ status: 400 }
);
}
// β
Update order from result.payload
return NextResponse.json({ status: result.status, message: result.payload });
}7π NestJS Integration
import { Injectable } from '@nestjs/common';
import { Payerurl } from '@payerurl/crypto-checkout';
@Injectable()
export class PaymentService {
private client = new Payerurl({
publicKey: process.env.PAYERURL_PUBLIC_KEY!,
secretKey: process.env.PAYERURL_SECRET_KEY!,
});
createPayment(input: Parameters<Payerurl['payment']>[0]) {
return this.client.payment(input);
}
handleNotify(authorization: string | undefined, body: Record<string, unknown>) {
return this.client.verifyWebhook({
authorization,
body,
authStr: body.authStr as string,
});
}
}8βοΈ React / Vue / Angular (Frontend)
The frontend never calls PayerURL directly. It calls your backend, then redirects the user:
// React / Vue / Angular service
async function payWithCrypto(order) {
const res = await fetch('/api/pay', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(order),
});
const data = await res.json();
if (data.redirectUrl) {
window.location.href = data.redirectUrl;
}
}Supported Cryptocurrencies & Networks
API Reference
new Payerurl(config)
| Option | Type | Required | Description |
|---|---|---|---|
publicKey | string | β | API public key |
secretKey | string | β | API secret key (server only) |
apiUrl | string | β | Default: https://api-v2.payerurl.com/api/payment |
payment(request)
| Field | Type | Required | Description |
|---|---|---|---|
invoiceId | string | β | Unique order ID |
amount | number | β | Amount in smallest currency unit |
currency | string | β | Default: usd |
data | object | β | Customer info + callback URLs |
data.notify_url | string | β | Webhook URL (server-to-server POST) |
data.redirect_url | string | β | Success redirect URL |
data.cancel_url | string | β | Cancel redirect URL |
orderItems | array | β | Line items β use _ instead of spaces in name |
β
Success: { status: true, redirectUrl: "..." }
β Error: { status: false, message: "..." }
verifyWebhook({ authorization, authStr, body })
β
Success: { ok: true, status: 2040, payload }
β Failure: { ok: false, status, message }
Full Payment Flow
Frontend calls your Node.js backend with order details
Backend calls payerurl.payment() and gets a redirectUrl
Frontend redirects the customer to the hosted checkout page
Customer pays via Binance QR or any supported crypto network
Blockchain confirms β funds land directly in your wallet
PayerURL POSTs a signed webhook to notify_url β verify with verifyWebhook()
Your Node API β PayerURL API β Checkout Page β Customer Pays (Binance/Crypto)
β
Your Wallet β Funds β Blockchain confirmation
β
Your notify_url β Webhook (verify with verifyWebhook())Compared to Other Solutions
| Feature | PayerURL | Stripe / PayPal | Coinbase Commerce |
|---|---|---|---|
| No merchant account | β | β | β |
| Direct to your wallet | β | β | Partial |
| No KYC required | β (Basic) | β | β |
| Binance QR support | β | β | β |
| Node.js / TypeScript SDK | β | β | β |
| Express, Next.js, NestJS | β | β | β |
| 169+ fiat currencies | β | Partial | β |
| Zero platform fees | β | β | β |
| Built-in webhook verification | β | β | β |
Key Features
- 169+ Fiat Currency Support (USD, EUR, GBP, JPY, CAD, etc.)
- Real-Time Exchange Rate Conversion
- Direct Wallet Settlement β no holding period
- No KYC Required (Basic Accounts)
- HMAC-SHA256 Signature Verification via verifyWebhook()
- Express, Next.js, NestJS, and Nuxt examples included
- TypeScript support out of the box
- 100% Free & Open Source (MIT License)
- Binance QR Code support
- 24/7 Telegram Support
Requirements
- Node.js 16+ (LTS recommended)
- npm package: @payerurl/crypto-checkout
- Free PayerURL merchant account
- A crypto wallet address to receive payments
- Publicly accessible HTTPS domain for notify_url
- Server-side framework (Express, Next.js, NestJS, etc.)
π§Ύ MIT License β free for personal and commercial use.