You authenticate to the E-GUMA API by providing an API key in the request. Store that key in your system.
Use the Balance Endpoint to verify the entered voucher. The Balance Endpoint returns the voucher code. It’s very important to use the returned voucher code for further actions. The reason for that is the voucher2mobile ShortCode, which is only temporarly available.If the field is_redeemable is set to false, show an appropriate message. Don't use the returned message field.
If the voucher is fine, you can determine the amount which has to be redeemed. The user doesn't have to enter the amount. The amount can be calculated like that: min(remaining_amount_to_pay, voucher_balance). In order to redeem the voucher, call the Redeem Endpoint with the calculated amount. Save the voucher code in your database.
If the order has to be cancelled, then you also need to cancel the redemption. Use the Cancel Request with the redeemed code and amount for that case.
If you redeem a voucher don't reduce the VAT. Vouchers are not discount- / promo-codes.