Every vPOS endpoint
Payments, two-step confirm and cancel, refunds, saved cards, pending transactions and the national ID check — all eleven-plus REST calls.
npm install @ameria/vpos-sdkpnpm add @ameria/vpos-sdkyarn add @ameria/vpos-sdkimport { AmeriaClient } from "@ameria/vpos-sdk";
const ameria = new AmeriaClient({ clientId: process.env.AMERIA_CLIENT_ID!, username: process.env.AMERIA_USERNAME!, password: process.env.AMERIA_PASSWORD!, isTest: true,});
// 1. Register the payment and send the payer to the bank's card page.const { url, PaymentID } = await ameria.initPayment({ orderId: 2350301, amount: 10, currency: "AMD", description: "Order #1042", backUrl: "https://shop.example/payment/back", opaque: "order-1042",});console.log("Redirect the payer to", url);
// 2. The payer comes back to backUrl, but that redirect is not signed: anyone can// open it with a success code and skip paying. So ask the bank, and pass what// you expect — otherwise a real payment for a cheaper order would also pass.const { paid, reason } = await ameria.verifyPayment(PaymentID, { amount: 10, currency: "AMD", orderId: 2350301,});console.log(paid ? "Paid — fulfil the order" : `Not paid: ${reason}`);Every vPOS endpoint
Payments, two-step confirm and cancel, refunds, saved cards, pending transactions and the national ID check — all eleven-plus REST calls.
Typed end to end
Request and response types follow the bank’s live API reference, including the 2025–26 additions: Apple Pay, Amex, 3-D Secure fields and bank info.
Safe defaults
Credentials never show up in logs, requests time out, redirects are refused and amounts are validated before anything reaches the bank.
Modern runtime
ESM, Node.js 22.12+, Bun and Deno, built-in fetch, no runtime
dependencies. CommonJS code can still require() it.