@pulgueta/wompi

Integrate Wompi in your Node.js apps with ease.

pnpm add @pulgueta/wompi zod

Zod is the only peer dependency — install it alongside the SDK.

example.ts TypeScript
import { WompiClient } from "@pulgueta/wompi";

const wompi = new WompiClient({
  publicKey: process.env.WOMPI_PUBLIC_KEY!,
  privateKey: process.env.WOMPI_PRIVATE_KEY,
  sandbox: true,
});

const [error, response] = await wompi.transactions.getTransaction("txn_123");
if (error) {
  // error is typed — branch on error.type or instanceof
  return;
}

response.status; // "APPROVED" | "PENDING" | "DECLINED" | ...

One client, every Wompi flow

Card charges, hosted links, stored payment sources, PSE bank transfers and typed errors all run through the same client. Each tab is a real call against the SDK — copy it, swap in your keys, and run it.

charge-card.ts
import { WompiClient } from "@pulgueta/wompi";
import { getSignatureKey } from "@pulgueta/wompi/server";

const wompi = new WompiClient({
  publicKey: process.env.WOMPI_PUBLIC_KEY!,
  sandbox: true,
});

const [merchantError, merchant] = await wompi.merchants.getMerchant();
if (merchantError) throw merchantError;

const reference = `order-${Date.now()}`;
const signature = await getSignatureKey({
  reference,
  amountInCents: 2_490_000,
  integrityKey: process.env.WOMPI_INTEGRITY_KEY!,
});

const [error, tx] = await wompi.transactions.createTransaction({
  acceptance_token: merchant.presigned_acceptance!.acceptance_token,
  amount_in_cents: 2_490_000,
  currency: "COP",
  signature,
  reference,
  customer_email: "buyer@example.com",
  payment_method: { type: "CARD", token: cardToken, installments: 1 },
});
if (error) throw error;

tx.status; // "PENDING" — poll getTransaction(tx.id)

Start receiving payments in your Node.js applications

Install the package, set your environment variables and use the provided skills to integrate Wompi in your Node.js applications.