A NodeJS library to interact with ovvar API
yarn add ovvar-node
OR
npm install ovvar-node
Generate an API KEY from the Ovvar dashboard
import { Voucher } from 'ovvar-node'
const voucher = new Voucher(process.env.API_KEY);
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
});
Check if voucher is valid
const resp = await voucher.validate(voucherPin);
const resp = await voucher.redeem(voucherPin);