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)

This function requires an api user login for identification.

Function call

https://<username>:<password>@payment.architrade.com/cgi-adm/generatevouchers.cgi

Example

Below is an example of a voucher generated using the recommended parameters for generatevouchers.cgi

<form method="post" action="https://login:password@payment.architrade.com/cgi-adm/generatevouchers.cgi">
  <input type="hidden" name="merchant" value="12345678">
  <input type="hidden" name="quantity" value="1000">
  <input type="hidden" name="type" value="M">
  <input type="hidden" name="value" value="5">
  <input type="hidden" name="currency" value="DKK">
</form>

Essential input parameters

Parameter Description
currency *

The smallest unit of an amount in the selected currency, following ISO4217 (see the currency list here).

Example:

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

 ParameterDescription
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

ParameterTypeDescription
StatusCodestring

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

statustextstring

A text describing success or failure of the voucher generation.

voucherListstring(s)

Semicolon separated list of voucher codes.

 

Do you have question or need help?
Follow us
DIBS Payment Services
Stockholm +46 (0)8-527 525 00
Göteborg +46 031-600 800
København +45 7020 3077
Oslo +47 21 55 44 00