generatevouchers.cgi

Through this function you can easily create many vouchers in just one go. To avoid misuse, generatevouchers.cgi must be called using login information. The login and password are identical to those used for accessing the DIBS administration interface (create an API user)

Essential input parameters

Smallest unit for EUR is "cent" thus setting 'amount="150"' leads to the amount being 1,50 EUR
Smallest unit for JPY is "yen" thus setting 'amount="150"' leads to the amount being 150 JPY

merchant *

Shop identification. The Merchant number appears in the e-mail received from DIBS during registration with DIBS or on your contract.

quantity *

The number of vouchers to generate.

type *

The voucher type can be either "M" or "P". "M" ("money") means that the voucher has a certain fixed amount in a certain currency. "P" ("percentage") means that the voucher calculates a percentage rebate given by the "value" parameter. Please refer to parameters "value" and "currency".

value *

Specifies the amount for the voucher.

If the voucher is of type "M" (fixed amount), this value should be given in the smallest unit of the selected currency, i.e.

Smallest unit for EUR is "cent" thus setting 'value="150"' leads to the amount being 1,50 EUR
Smallest unit for JPY is "yen" thus setting 'value="150"' leads to the amount being 150 JPY

If the voucher is of type "P" (percentage), this field specifies the percentile, i.e.

'value=10' leads to the rebate being 10%.

*: Mandatory parameters

Optional input parameters

Parameter

Description

expire

The end date on which the vouchers will expire and no longer be valid. Voucher will be valid throughout this date. The format of the date is DDMMYYYY. If unspecified, the vouchers will never expire.

group

The group identifier of the vouchers to be created. The value is 1-4 alphanumeric characters. If the group identifier does not exist, it will be created. If not specified it will default to "V".

maxuses

Specifies the number of times the generated voucher(s) can be used.

min

The minimum purchase amount required for the vouchers to be applicable. The format is decimal with the seperator being '.'.

Example:

'min="99.95"' and 'currency="572"' leads to the minimum amount of the payment before the voucher is available being 99,95 NOK.

start

The start date on which the vouchers will be valid. The format of the date is DDMMYYYY. If unspecified, the vouchers will be active immediately.

Return parameters

Parameter

Type

Description

StatusCode

string

A value describing the result. 0 means that the vouchers were successfully created.