Fluent builder for creating a new voucher type, or updating an existing one, on the current tenant organisation. Looks up an existing voucher type by name and updates it, or creates a new one if none is found. Obtained from VoucherManager.newVoucherTypeBuilder() and completed with build().

Group: Builders


Methods

name(String name) · title(String title) · template(String template) · notes(String notes) · validForDays(Integer validForDays) · cashValue(BigDecimal cashValue) · staticExpiryDate(Date staticExpiryDate) · redeemingOrg(Organisation redeemingOrg) · voucherIdTemplate(String voucherIdTemplate) · content(String content) · productSku(ProductSku productSku) · extraFields(List<ExtraField> extraFields) · autoCreateVoucher(boolean autoCreateVoucher) · build()

name(String name)

Returns: VoucherTypeBuilder

Sets the name used for the voucher type. If a voucher type with the given name exists, it will be updated Otherwise, a new one will be created.

ParameterDescription
namethe name

title(String title)

Returns: VoucherTypeBuilder

Sets the title of the voucher type.

ParameterDescription
titlethe title

template(String template)

Returns: VoucherTypeBuilder

Sets the template used for the voucher type.

ParameterDescription
templatethe template name

notes(String notes)

Returns: VoucherTypeBuilder

Sets the notes for the voucher type.

ParameterDescription
notesthe notes

validForDays(Integer validForDays)

Returns: VoucherTypeBuilder

Sets the number of days the voucher is valid for.

ParameterDescription
validForDaysthe validity period in days

cashValue(BigDecimal cashValue)

Returns: VoucherTypeBuilder

Sets the cash value of the voucher type.

ParameterDescription
cashValuethe value

staticExpiryDate(Date staticExpiryDate)

Returns: VoucherTypeBuilder

Sets the static expiry date for the voucher type.

ParameterDescription
staticExpiryDatethe expiry date

redeemingOrg(Organisation redeemingOrg)

Returns: VoucherTypeBuilder

Sets the organisation that will be able to redeem the voucher type.

ParameterDescription
redeemingOrgthe redeeming organisation

voucherIdTemplate(String voucherIdTemplate)

Returns: VoucherTypeBuilder

Sets the template ID for the voucher type.

ParameterDescription
voucherIdTemplatethe template ID

content(String content)

Returns: VoucherTypeBuilder

Sets the content for the voucher type.

ParameterDescription
contentthe content

productSku(ProductSku productSku)

Returns: VoucherTypeBuilder

Sets the product SKU for the voucher type.

ParameterDescription
productSkuthe product SKU

extraFields(List<ExtraField> extraFields)

Returns: VoucherTypeBuilder

Sets the extra fields to be added to the voucher type.

ParameterDescription
extraFieldsthe extra fields to add to the voucher type's fieldset

autoCreateVoucher(boolean autoCreateVoucher)

Returns: VoucherTypeBuilder

Sets whether the voucher type is allowed to automatically create and allocate vouchers.

ParameterDescription
autoCreateVouchertrue to create and allocate a voucher automatically on each allocation request

build()

Returns: VoucherType

Creates the voucher type, or updates the existing one with the same name on the current tenant organisation, applying every value set on the builder and saving it.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.