validateVoucher()

VoucherValidationResponse validateVoucher(int company, string voucherNumber, string voucherCode)

This method verifies that a voucher is valid, but does not consume the voucher.

To be valid, a voucher must have a valid voucher number and secret code, and not have expired.

Parameters

company
Format: integer
Purpose: Specifies the identification number for the company that issued the voucher.
Default: 1
voucherNumber
Format: string
Purpose: Specifies the voucher number.
voucherCode
Format: string
Purpose: Specifies the voucher's secret code.

Results

This method validates the voucher and returns a VoucherValidationResponse XML document with the validation response.

There are no messages defined by this method.

Example: A returned VoucherValidationResponse XML document

This example shows a returned VoucherValidationResponse XML document. The voucher is not valid because the expiry date has passed.

<VoucherValidationResponse xmlns="http://xml.inomial.com/smile/2.xsd">
  <valid>false</valid>
  <reason>The voucher has expired</reason>
</VoucherValidationResponse>

Faults

PrepaidException

This fault is returned when an error occurs or the caller does not have permission to perform this action.

Java client syntax

java -cp build/smilewsv2-client.jar [options] com.inomial.smile.client.v2.examples.ValidateVoucher company voucherNumber voucherCode
company
Purpose: Specifies the identification number for the company that issued the voucher.
voucherNumber
Purpose: Specifies the voucher number.
voucherCode
Purpose: Specifies the voucher's secret code.
Note: For more information about the Java client and the options it accepts, see Java client syntax.