Voucher API – Pay
Using this API, you will be able to allow customers to pay for products and/or services using WiPay Vouchers. You must have a WiPay Business Verified account to use this API.
(OLD) Your WiPay account level must be at Gold (KYC Level 3) to use this API.
The configuration for the Voucher API calls can be seen below.
|API URL (Live)||https://guyana.wipayfinancial.com/v1/voucher_pay|
|API URL (Sandbox)||https://sandbox.wipayfinancial.com/guyana/voucher_pay|
|API Response-Type||JSON Object|
The Voucher API call can be passed with four (4) parameters.
|Your WiPay account number.||1. Can be found in your Account Dashboard.||Yes|
|An optional description of the transaction.||1. Must be less than 255 characters long.||No|
|The total desired to be subtracted from the voucher value.||1. Must be a value greater than “0”.|
2. Must contain no more than two (2) decimal places.
3. Must be numeric only.
4. Flat transaction fee of $5.00 TTD is always added to
|The 12-character voucher serial.||1. Voucher’s current value must be greater than “5”.||Yes|
You may use these parameters to make a test Voucher API call using the Sandbox API URL.
|Parameter||Valid Test Value(s)|
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. Here, “
value” is 5-greater-than-“
total” less than the original value of the voucher before the form was submitted. Below is an example of a successful transaction using the Voucher API.
"msg": "Voucher payment successful",
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 “
"msg": "Too many attempts"
The possible values of the “
msg” key in an “
error” type response are as follows:
|Error Message||Likely Cause|
|The submitted account_number or |
|The account attached to the submitted account_number or |
|There is no registered WiPay account with an Account Number that matches the submitted account_number or |
|The submitted total in the API call is negative.|
|The submitted total in the API call is either non-numeric, or has too many decimal places.|
|The submitted total in the API call is empty.|
|The submitted voucher in the API call is empty.|
|There is no registered WiPay Voucher with a Voucher Number that matches the submitted voucher in the API call.|
|The current value of the submitted voucher in the API call is too low to make a successful transaction.|
|There were more than five (5) API calls within the last sixty (60) seconds.|