npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pulgueta/nequi-node

v1.6.4

Published

Community-driven SDK for Nequi in Node.js

Readme

Nequi Node.js SDK

TypeScript SDK for integrating with Nequi API.

Installation

npm install @pulgueta/nequi-node

Configuration

import { Nequi } from "@pulgueta/nequi-node";

const nequi = new Nequi({
  apiKey: "your-api-key", // Required: API key from Nequi
  clientId: "your-client-id", // Required: Client ID from Nequi
  clientSecret: "your-client-secret", // Required: Client secret from Nequi
  env: "development", // Optional: "development" | "production" (default: "development")
});

Error Handling

All SDK methods return a tuple [error, data] pattern:

const [error, data] = await nequi.qr.createQR({...});

if (error) {
  // Handle error
  console.error(error.message);
  console.error(error.status);
  console.error(error.name);
  return;
}

// Use data
console.log(data);

Services

QR Code Payments

Generate QR codes for payments and check their status.

// Generate QR code
const [error, qrData] = await nequi.qr.createQR({
  code: "NIT_1",
  value: "1000",
  reference1: "Order #123",
  reference2: "optional",
  reference3: "optional",
});

// Get QR payment status
const [error, status] = await nequi.qr.getStatus({
  qrValue: "0002010102125303170540410005802CO...",
});

// Reverse QR transaction
const [error, result] = await nequi.qr.revert({
  qrValue: "0002010102125303170540410005802CO...",
  phoneNumber: "3998764643",
  value: "1000",
  code: "NIT_1",
});

Push Payments

Send payment notifications to customers' Nequi app.

// Create push payment
const [error, payment] = await nequi.pushPayment.createPayment({
  phoneNumber: "3998764643",
  code: "NIT_1",
  value: "1000",
  reference1: "Order #123",
  reference2: "optional",
  reference3: "optional",
});

// Get payment status
const [error, status] = await nequi.pushPayment.getStatus({
  codeQR: "350-913291938-2471-C001",
});

// Cancel payment
const [error, result] = await nequi.pushPayment.cancel({
  code: "1",
  phoneNumber: "3012146840",
  transactionId: "350-3012146840-9232-8944090690",
});

// Revert transaction
const [error, result] = await nequi.pushPayment.revertTransaction({
  phoneNumber: "3998764643",
  value: "1000",
  code: "NIT_1",
  messageId: "9857836163",
  type: "payment",
});

Subscriptions

Create and manage automatic subscription payments.

// Create subscription
const [error, subscription] = await nequi.subscription.createSubscription({
  phoneNumber: "3998764643",
  code: "NIT_1",
  name: "Premium Plan",
});

// Process automatic payment
const [error, payment] = await nequi.subscription.automaticPayment({
  phoneNumber: "3998764643",
  code: "NIT_1",
  value: "1000",
  token: subscription.token, // Token from createSubscription
  reference1: "Monthly payment",
});

// Get subscription details
const [error, details] = await nequi.subscription.getSubscription({
  phoneNumber: "3998764643",
  code: "NIT_1",
  token: subscription.token,
});

// Reverse subscription transaction
const [error, result] = await nequi.subscription.reverseTransaction({
  phoneNumber: "3998764643",
  value: "100",
  code: "NIT_1",
  messageId: "9857836163",
  type: "automaticPayment",
});

Dispersions

Send payments from your business account to Nequi accounts.

// Disperse funds
const [error, result] = await nequi.dispersions.createDispersion({
  code: "NIT_440627004_00",
  trackingID: "DAN123456789",
  phoneNumber: "3998764643",
  value: "1000",
  reference1: "Payroll",
  reference2: "optional",
  reference3: "optional",
});

// Reverse dispersion
const [error, result] = await nequi.dispersions.reverseDispersion({
  code: "NIT_440627004_00",
  trackingID: "DAN123456789",
  phoneNumber: "3998764643",
  value: "1000",
  reference1: "Payroll",
  reference2: "optional",
  reference3: "optional",
});

Reports

Retrieve transaction reports and analytics.

// Get reports
const [error, reports] = await nequi.reports.getReports({
  code: "NIT_901049033",
  startDate: "2018-09-01",
  endDate: "2018-09-09",
  format: "json", // "json" | "csv" | "pdf"
});

Types

The SDK exports TypeScript types for all request and response schemas:

import type {
  GenerateCodeQRRQ,
  GetQRStatusPaymentRQ,
  UnregisteredPaymentRQ,
  AutomaticPaymentRQ,
  DisperseFundsRQ,
  GetReportsRQ,
  // ... and more
} from "@pulgueta/nequi-node";

Error Types

import { NequiError } from "@pulgueta/nequi-node";

// Check if error is NequiError
if (NequiError.isNequiError(error)) {
  console.error(error.name); // Error code name
  console.error(error.message); // Error message
  console.error(error.status); // HTTP status code
}

Advanced Usage

Custom Request Building

import { buildRequestHeader, buildRequestMessage } from "@pulgueta/nequi-node";

const header = buildRequestHeader("PQR03-C001", "client-id", {
  ServiceName: "PaymentsService",
  ServiceOperation: "generateCodeQR",
  ServiceRegion: "C001",
  ServiceVersion: "1.2.0",
});

Validation Utilities

import { safeParse, isSuccessResponse } from "@pulgueta/nequi-node";
import { GenerateCodeQRRQSchema } from "@pulgueta/nequi-node";

const [error, validated] = safeParse(GenerateCodeQRRQSchema, {
  code: "NIT_1",
  value: "1000",
});

// Check response status
if (isSuccessResponse("0")) {
  // Success
}

Support

For issues and questions, please visit the GitHub repository.