ovvar-node
v1.0.3
Published
A NodeJS library to interact with ovvar API
Downloads
11
Readme
Ovvar
A NodeJS library to interact with ovvar API
Installation
yarn add ovvar-node
OR
npm install ovvar-node
Usage
Authentication
Generate an API KEY from the Ovvar dashboard
Setup
import { Voucher } from 'ovvar-node'
const voucher = new Voucher(process.env.API_KEY);
Generate a new voucher
Simply supply the needed parameters
currency: USD | NGN
value: amount value
channel: email | sms
quantity: number of vouchers to generated
recipient_phone: phone number to receive voucher pin
recipient email: email to receive voucher pin
const resp = await voucher.generate({
currency: 'USD',
value: 1500,
channel: 'phone',
recipient_phone: '2349063079039',
quantity: 10
});
Validate a voucher
Check if voucher is valid
const resp = await voucher.validate(voucherPin);
Redeem a voucher
const resp = await voucher.redeem(voucherPin);