vouchers
This endpoint allows you to redeem vouchers for your customers
Verify Voucher
POST /merchant-integrations/verify-voucher
Verify the validity of a voucher before redemption.
It is optional and useful in cases where you need to show your users the status of a voucher before it is redeemed
Request Body
{
"voucherCode": "string"
}
Response
{
"message": "string",
"status": "string",
"code": 0,
"data": {
"amount": 0,
"balance": 0,
"code": "string",
"createdAt": "string",
"createdForExistingUser": true,
"createdForMerchant": true,
"createdForNonExistingUser": true,
"cryptoVoucherDetails": {
"balance": "string",
"codeHash": "string",
"creator": "string",
"isRedeemed": true,
"transactionHash": "string",
"value": "string"
},
"generatedCurrency": {
"abbrev": "string",
"currencyType": "string",
"id": "string",
"image": "string",
"isActive": true,
"name": "string",
"symbol": "string"
},
"id": "string",
"isLocked": true,
"isUsed": true,
"metaData": "string",
"onchain": true,
"onchainProcessing": true,
"redeemedVouchers": [
{
"amount": 0,
"createdAt": "string",
"id": "string",
"isMerchant": true,
"redeemedUserID": "string",
"redeemerWalletAddress": "string",
"user": {
"avatar": "string",
"email": "string",
"emailVerified": true,
"externalID": "string",
"id": "string",
"isActive": true,
"isPinSet": true,
"otherNames": "string",
"phone": "string",
"regChannel": "string",
"role": "ADMIN",
"surname": "string",
"username": "string"
},
"voucherID": "string"
}
],
"transactionHash": "string",
"wasPaidFor": true
}
}
redeemedVouchers
basicaaly entails the list of all users who have redeemed that particular vooucher
cryptoVoucherDetails
shows you the onchain details of a voucher, and its metadata returns the explorer Url and transaction has of the voucher which can be verified onchain
Fetch Voucher Redemption Charges
POST /merchant-integrations/fetch-voucher-redemption-charges
Get the charges associated with redeeming a voucher.
Request Body
{
"amount": 0,
"lockPin": "string",
"voucherCode": "string"
}
lockPin
is optional and needed in cases where a user decides to add extra security to his voucher by locking it with a 4 digit pin.
Every voucher can be redeemed in bids, hence the required field for amount
Response
{
"message": "string",
"status": "string",
"code": 0,
"data": {
"charges": {
"amount": 0,
"amountInWei": 0,
"balanceAfterCharges": 0,
"balanceAfterChargesInWei": 0,
"gasLimitInWei": 0,
"gasPriceInWei": 0,
"processingFee": 0,
"processingFeeInWei": 0,
"totalGasCost": 0,
"totalGasCostAndProcessingFee": 0,
"totalGasCostAndProcessingFeeInWei": 0,
"totalGasCostInWei": 0
},
"voucher": {
"amount": 0,
"balance": 0,
"code": "string",
"createdAt": "string",
"createdForExistingUser": true,
"createdForMerchant": true,
"createdForNonExistingUser": true,
"cryptoVoucherDetails": {
"balance": "string",
"codeHash": "string",
"creator": "string",
"isRedeemed": true,
"transactionHash": "string",
"value": "string"
},
"generatedCurrency": {
"abbrev": "string",
"currencyType": "string",
"id": "string",
"image": "string",
"isActive": true,
"name": "string",
"symbol": "string"
},
"id": "string",
"isLocked": true,
"isUsed": true,
"metaData": "string",
"onchain": true,
"onchainProcessing": true,
"redeemedVouchers": [
{
"amount": 0,
"createdAt": "string",
"id": "string",
"isMerchant": true,
"redeemedUserID": "string",
"redeemerWalletAddress": "string",
"user": {
"avatar": "string",
"email": "string",
"emailVerified": true,
"externalID": "string",
"id": "string",
"isActive": true,
"isPinSet": true,
"otherNames": "string",
"phone": "string",
"regChannel": "string",
"role": "ADMIN",
"surname": "string",
"username": "string"
},
"voucherID": "string"
}
],
"transactionHash": "string",
"wasPaidFor": true
}
}
}
Redeem Voucher
POST /merchant-integrations/redeem-voucher
Redeem a voucher for a customer.
Request Body
{
"amount": 0,
"lockPin": "string",
"voucherCode": "string"
}
Response
{
"code": 0,
"message": "string",
"status": "string"
}