Node.js
Node. library is a server-side library that helps you to integrate Xendit easily
Current the Node library supports:
- Credit / Debit Cards (via Payments API)
- E-Wallets (via Payments API)
- Virtual Accounts (via Payments API)
- Retail Outlets (via Payments API)
- QR Code (via Payments API)
- Customers
- Invoices
- Payouts
- Balances
- Transactions
Compatibility
Our Node library is compatible with Node 18.0 and later
Installation
Install with npm
. Typescript is included in this package.
npm install xendit-node@latest --save
Check out our Node source on Github for the complete installation guide and to verify the latest version.
Authorization
The SDK needs to be instantiated using your secret API key obtained from the Xendit Dashboard. You can sign up for a free Dashboard account here.
import { Xendit } from 'xendit-node';
const xenditClient = new Xendit({
secretKey: SECRET_API_KEY,
})
Sample Usage
You can use the APIs below to interface with Xendit's BalanceApi
. To start using the API, you need to configure the secret key and initiate the client instance.
import { Xendit, Balance as BalanceClient } from 'xendit-node';
const xenditClient = new Xendit({secretKey: YOUR_SECRET_KEY})
const { Balance } = xenditClient
const xenditBalanceClient = new BalanceClient({secretKey: YOUR_SECRET_KEY})
const response: Balance = await xenditBalanceClient.getBalance({ )
For sample of other available APIs, please refer to our Node SDK Github Documentation.
Last Updated on 2024-01-09