Voucher API

Voucher API – Check

Using this API, you will be able to check a voucher’s current value.

Configuration

The configuration for the Voucher API calls can be seen below.

NOTE: When testing, please use the SANDBOX API URL.

API URL (Live)https://wipayfinancial.com/v1/voucher_check
API URL (Sandbox)https://sandbox.wipayfinancial.com/v1/voucher_check
HTTP MethodPOST
Body Content-Typeapplication/x-www-form-urlencoded
API Response-TypeJSON Object

Parameters

ParameterDescription Notes Required
voucherThe 12-character voucher serial.Yes

Test Parameters

You may use these parameters to make a test Voucher API call using the Sandbox API URL.

ParameterValid Test Value(s)
voucheruyr8vmap230t
jxaqe48tfvbs
zmq8x0y29usv
xq62mu0s81jv
b4zytr8e37si
6v75kwyg3t0i

Responses

All Voucher API calls return a JSON object. There are two main types of responses; “success” and “error“. These response types can be found in the value of the “statuskey in the JSON response object.


Success

If all submitted data is valid, you will receive a JSON response object indicating a “successvalue for the “statuskey. Below is an example of a successful transaction using the Voucher API.

{

    "status": "success",
    "msg": "Voucher check successful",
    "value": "0.00"

}


Error

error” responses may be received for various reasons. Check the value of the “msgkey in the JSON response object to diagnose what your specific error may be caused by. The following is an example of  an “error” response.

{
    "status": "error",
    "msg": "Invalid Voucher"
}

The possible values of the “msgkey in an “error” type response are as follows:

Error MessageLikely Cause
Parameter: voucher is missingThe submitted voucher in the API call is empty.
Parameter: voucher not foundThere is no registered WiPay Voucher with a Voucher Number that matches the submitted voucher in the API call.
Too many attemptsThere were more than five (5) API calls within the last sixty (60) seconds.