Documentation API
Documentation API

Introduction

    The REST API is based on REST principles. Our resource oriented URLs are only accessible via HTTPS and are available in both our test and live environments.

 We use HTTP Authentication and HTTP verbs for each method:

Verb Description
GET for retrieving resources.
POST for creating resources.

The API uses JSON format for both requests and responses.


Getting your API credentials

    Before you can start integrating with our REST API you need to get your Token Key , you need to do the following:



  1.  Go to IVoucer web login to your business and open API Key page.
  2.  Copy it, And keep key with send the request.
  3. Let use token key for bearer token authentication

Getting Started

    The REST API is available to all clients and returns easy to use JSON on all responses. All requests should be made over HTTPS and to the endpoint {currentURL}.

    If you would like to test the API quickly, we recommend using Postman. To get you started faster


Authentication

    Requests to the API require authentication. We use HTTP Basic authentication or Bearer authentication, yet secure method of enforcing access controls.

    In order to access our protected resources you must authenticate with our API by providing us with your

Basic authenticate :
  • Username : Token Key
  • Password : Required for Basic Authentication
How to basic authenticate :
  1. You need to combine into string username and password as per example: Username:Password
  2. The combined string will have to be encoded using Base64 encoding.
  3. HTTP Basic authentication combined with encoded string will have to be included in the Authorisation header.
Bearer authenticate : (Recommend)
How to Bearer Token :
  1. Using HTTP Bearer authentication, you can get via Simply Manage Voucher portal , Your account key is combine into a string TokenKey.
  2. The string will have to be included in the Authorization header.

Vouchers

     You can get the details of a voucher and all its history using voucher number called "VoucherCode". You can do this 2 ways:

  1. Send request method GET: /api/VoucherSold/VoucherCode/{Your voucher code}
    Example :


    {currentURL}/iVoucherApi/api/VoucherSold
    /202107011704510030202103300926390447

  2. Send request method POST: /api/VoucherSold
    Example :


    {currentURL}/iVoucherApi/api/VoucherSold

The response detail including

Attribute Description
Balance value balance of this voucher
CreateDate date of sold a voucher
IsComplimentaryVoucher true/false for Complimentary Voucher
IsPhysicalPlasticCard true/false for Plastic Card
VoucherAlias Alias text 8 digit for refer to full Voucher Code
Description Description of Voucher, Display on card max 170 character
Message message from purchaser to recipient
PurchaserEmail email of purchaser
PurchaserName name of purchaser
RecipientAddress address of recipient and include.
  • AddressLineOne
  • AddressLineTwo
  • CityName
  • CountryCodeName
  • PhoneNumber
  • PostCode
RecipientEmail email of recipient
RecipientName name of recipient
Redeem the history redeem of this voucher.
  • RedeemCode
    • BusinessCode : business's redeem
    • CreateDate : redeem date
    • Description
    • RedeemAmount
    • CreateBy : person are redeem
Refill the history refill of this voucher.
  • RefillCode
    • Amount
    • RefillType : Type of refill include "OnlinePayment", "Complimentary", "Manually"
    • CreateBy : person are refill
VoucherName name of voucher
Value value of voucher

Voucher Sale Add

    You can add new voucher sale by send the detail including

Attribute Description
VoucherName name of voucher
VoucherValue value of voucher
VoucherAlias Alias text 8 digit for refer to full Voucher Code Optional
Description Description of Voucher, Display on card max 170 character
Message message from purchaser to recipient
PurchaserEmail email of purchaser
PurchaserName name of purchaser
RecipientEmail email of recipient
RecipientName name of recipient
IsComplimentaryVoucher true/false for Complimentary Voucher Optional
IsPhysicalPlasticCard true/fasle for require PhysicalPlasticCard Optional
AddressLineOne address of recipient line one Required field only in case physical plastic card value is true
AddressLineTwo address of recipient line two Optional
CityName phone of recipient Required field only in case physical plastic card value is true
CountryCodeName code of country Optional
CountryName country name of recipient Required field only in case physical plastic card value is true
PhoneNumber phone of recipient Required field only in case physical plastic card value is true
PostCode postcode of recipient Required field only in case physical plastic card value is true
And send request by method POST : /api/VoucherSold/

The response:

  • Message : response message from api
  • IsSuccess : true/false
  • VoucherSoldCode : code of sold
  • VoucherCode : code of voucher

Voucher Redeem

    You can redeem voucher by send the detail including

Attribute Description
VoucherCode a code of voucher Required
Amount value want redeem Required
Description the description for this redeemtion Required
And send request by method POST : /api/Redeem

The response:

  • Message : response message from api
  • IsSuccess : true/false
  • RedeemCode : code of redeem
  • VoucherCode : code of voucher

Voucher Refill

    You can refill a value of voucher by send the detail including

Attribute Description
VoucherCode a code of voucher Required
Amount value want refill Required
Description the description for this refill Required
And send request by method POST : /api/Refill

The response:

  • Message : response message from api
  • IsSuccess : true/false
  • RefillCode : code of refill
  • VoucherCode : code of voucher