REST Redeem API


In Redeem API, the data is sent directly to the server with initial request.

The initial request must contain all the required information:

  • - authentication credentials
  • - customer information
  • - order information
  • - voucher number

Multiple vouchers can also be Redeemed in a single API call.

In case of Partial Redeem, the new voucher number will be generated from the remaining amount and sent in the response [newVoucher] as define in our
API Specifications.

  In our API Specifications you can find a full list of parameters that can be sent in the initial request.

Workflow


1. Create an Auth Token

Merchant needs to create an auth token before sending any request to

2. Redeeming the voucher

Redeem the voucher with the listed parameters


1. Create an Auth Token

Merchant needs to create an auth token before sending any request to .
The AuthToken needs to be sent with the request in the header. To generate authentication token, please refer Auth token API .


2. Redeeming the voucher

For redeeming the voucher set the AuthToken parameter (received in the response of STEP 1) in the header.
The POST request will be send over HTTPS to the voucherServices/REST/v1/redeemVoucher endpoint. Find sample request and the sample response below :

Sample Request

{
	"customer": {
		"email": "john.doe@test.com"
	},

	"order": {
		"amount": "500.00",
		"currency": "USD",
		"merchantTransactionId": "123456"
	},

	"voucherNumber": "12345000012345678901",

	"authentication": {
		"checksum": "612d9f2e2c94d058c13bae73a41f774f",
		"memberId": "1",
		"transactionPassword": "password"
	},

	"merchant": {
		"customerId": "cust1"
	}

}

Sample Response

{
    "customerId": "1",
    "status": "success",
    "trackingId": "1",
    "result": {
    "code": "00000",
    "description": "Transaction succeeded"
    },
    "timestamp": "2019-08-01 17:10:07",
    "voucherDetails": {
    "redeemVoucher": [
    {
    "voucherNumber": "12345000012345678901",
    "amount": "200.00"
    },
    {
    "voucherNumber": "12345000012345678902",
    "amount": "200.00"
    },
    {
    "voucherNumber": "12345000012345678903",
    "amount": "100.00"
    }
    ],
    "newVoucher": {
    "voucherNumber": "19785000065732074557",
    "amount": "100.00"
    }
    },
    "merchantTransactionId": "123456",
    "order": {
    "currency": "USD",
    "amount": "30.00",
    "voucherAmount": "30.00",
    "voucherCurrency": "USD",
    "redeemAmount": "30.00",
    "redeemCurrency": "USD",
    "merchantAmount": "30.00",
    "merchantCurrency": "USD"
    }
}

Hashing Rule For Request

supports MD5 Cryptographic Hash for the authenticity of payment request sent to the server.


Below are the description of fields used for generating checksum.
  • memberId < Member ID as shared by >
  • voucherNumber < Voucher number sent in the request. For Multiple vouchers, they have to be sent "," separated >
  • merchantTransactionId < Merchant's unique order ID >

How to generate Checksum for request ?

Checksum can be calculated with the following combination and needs to be send along with the authentication parameters in each server-to-server request:
<memberId>|<voucherNumber>|<merchantTransactionId>

Example for generating checksum with multiple vouchers.
<memberId>|<voucherNumber>,<voucherNumber>,<voucherNumber>|<merchantTransactionId>


Sample Code

Copyright © . All Rights Reserved