Integrate with @vexpay/node
Official TypeScript/Node SDK with typed resources, safe retries, and webhook verification.
Install
npm install @vexpay/nodeimport VexPay from '@vexpay/node';
const vexpay = new VexPay(process.env.VEXPAY_API_KEY, {
// baseUrl: 'http://localhost:3010', // local gateway
});C2P payment
const intent = await vexpay.payments.c2p.request({
usdAmount: 12.5,
debtorId: 'V12345678',
debtorCellPhone: '584121234567',
debtorBankCode: 102,
externalRef: 'order_1042',
});
const receipt = await vexpay.payments.c2p.execute({
intentId: intent.intentId,
usdAmount: 12.5,
debtorId: 'V12345678',
debtorCellPhone: '584121234567',
debtorBankCode: 102,
token: customerToken,
externalRef: 'order_1042',
});Checkout session
const session = await vexpay.checkout.sessions.create({
amountUsd: 25,
reference: 'order-1042',
allowedOrigins: ['https://shop.example'],
});
// Give session.clientSecret to @vexpay/js in the browser.
// Confirm fulfillment with GET or payment.* webhooks — never from browser events alone.Verify webhooks
See Webhooks for the full signature contract. Use `vexpay.webhooks.constructEvent(rawBody, header, secret)`.