Using this API, you will be able to check a voucher’s current value.
The configuration for the Voucher API calls can be seen below.
NOTE: When testing, please use the SANDBOX API URL.
The configuration for the Voucher API calls can be seen below.
API URL (Live) | https://wipayfinancial.com/v1/voucher_check |
---|---|
API URL (Sandbox) | https://sandbox.wipayfinancial.com/v1/voucher_check |
HTTP Method | POST |
Body Content-Type | application/x-www-form-urlencoded |
API Response-Type | JSON Object |
Parameter | Description | Notes | Required |
---|---|---|---|
voucher | The 12-character voucher serial. | - | Yes |
You may use these parameters to make a test Voucher API call using the Sandbox API URL.
Parameter | Valid Test Value(s) |
---|---|
voucher | uyr8vmap230t jxaqe48tfvbs zmq8x0y29usv xq62mu0s81jv b4zytr8e37si 6v75kwyg3t0i |
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 “status” key in the JSON response object
If all submitted data is valid, you will receive a JSON response object indicating a “success” value for the “status” key. Below is an example of a successful transaction using the Voucher API.
{
"status": "success",
"msg": "Voucher check successful",
"value": "0.00"
}
“error” responses may be received for various reasons. Check the value of the “msg” key 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 “msg” key in an “error” type response are as follows:
Error Message | Likely Cause |
---|---|
Parameter: voucher is missing | The submitted voucher in the API call is empty. |
Parameter: voucher not found | There is no registered WiPay Voucher with a Voucher Number that matches the submitted voucher in the API call. |
Too many attempts | There were more than five (5) API calls within the last sixty (60) seconds. |