Skip to main content

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",
"code": "number",
"status": "string",
"data": {
"id": "string",
"amount": "number",
"balance": "number",
"generatedCurrency": {
"id": "string",
"image": "string",
"name": "string",
"symbol": "string",
"Abbreviation": "string",
"currencyType": "string",
"isActive": "boolean",
"createdAt": "string"
},
"code": "string",
"wasPaidFor": "boolean",
"isUsed": "boolean",
"createdAt": "string",
"createdForMerchant": "boolean",
"createdForExistingUser": "boolean",
"createdForNonExistingUser": "boolean",
"isLocked": "boolean",
"onchain": "boolean",
"onchainProcessing": "boolean",
"cryptoVoucherDetails": "null",
"transactionHash": "string",
"metaData": "string"
}
}

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

{
"voucherCode": "string",
"amount": 0,
"lockPin": "string",
"walletAddress": "string",
"toCurrencyAbbreviation": "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",
"code": "number",
"status": "string",
"data": {
"charges": {
"swapAmount": "number",
"toAmount": "number",
"processingFee": "number",
"totalGasAndProceesingFeeInFromCurrency": "number",
"totalGasCostAndProcessingFeeInWei": "number",
"exchangeRate": "number",
"percentageCharge": "number",
"isPercentageCharge": "boolean",
"toCurrency": {
"id": "string",
"image": "string",
"name": "string",
"symbol": "string",
"Abbreviation": "string",
"currencyType": "string",
"isActive": "boolean",
"createdAt": "string" // ISO 8601 timestamp
},
"fromCurrency": {
"id": "string",
"image": "string",
"name": "string",
"symbol": "string",
"Abbreviation": "string",
"currencyType": "string",
"isActive": "boolean",
"createdAt": "string" // ISO 8601 timestamp
},
"totalDeductable": "number"
},
"voucher": {
"id": "string",
"amount": "number",
"balance": "number",
"generatedCurrency": {
"id": "string",
"image": "string",
"name": "string",
"symbol": "string",
"Abbreviation": "string",
"currencyType": "string",
"isActive": "boolean",
"createdAt": "string" // ISO 8601 timestamp
},
"code": "string",
"wasPaidFor": "boolean",
"isUsed": "boolean",
"createdAt": "string", // ISO 8601 timestamp
"createdForMerchant": "boolean",
"createdForExistingUser": "boolean",
"createdForNonExistingUser": "boolean",
"isLocked": "boolean",
"onchain": "boolean",
"onchainProcessing": "boolean",
"cryptoVoucherDetails": "null",
"transactionHash": "string",
"metaData": "string"
}
}
}

Redeem Voucher

POST /merchant-integrations/redeem-voucher

Redeem a voucher for a customer.

Request Body

{
"voucherCode": "string",
"amount": 0,
"lockPin": "string",
"walletAddress": "string",
"toCurrencyAbbreviation": "string",
"referenceId": "string",
"metaData": "string"
}

Response

{
"code": 0,
"message": "string",
"status": "string"
}