Implementing API for Voucher Redemption.
Implementing our API is pretty simple and straightforward. We use REST API as it provides a great deal of flexibility, scalability, and portability.
As a Merchant, you first need to authenticate yourself in the CBVoucher system. On successful authentication, you will receive an API token which you should be passing to the redeem API with a voucher code. After successful completion of the request, your voucher will be marked as redeemed, otherwise, you will get an error.
Here's how you implement the request:
Sample Request
{ "message": "OK", { "userid": "447", } ] } |
Sample Request
curl https://cbvoucher.com/api/v1/redeem.php \
-X POST \
-H 'Content-Type: application/json' \
-d '{
"api_token":1
"voucher_code":"16193462361547"
}'
You will get response like this
{ "message": "OK", { "id": "32", } ] } |