generatevouchers.cgi

 

Description

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

 

Function call

https://login:password@payment.architrade.com/cgi-adm/generatevouchers.cgi


Input parameters

The function generatevouchers.cgi accepts the following input parameters:

 

Parameter

Description

merchant

The merchant parameter is the DIBS identification number of the shop. The merchant number is available in the order confirmation email.

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 fixed amount in integer format if the voucher is of type "M". E.g. 10.25EUR is specified as "value=1025". Otherwise it specifies the percentile rebate for vouchers of type "P". E.g. a 10% rebate is specified as "value=10".

currency

The currency for which the vouchers are valid. The currency is specified according to the ISO 4217 specification. Examples of currencies are EUR, DKK, SEK, NOK, etc.

[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".

[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.

[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.

[min]

The minimum purchase amount required for the vouchers to be applicable. The format is decimal, so if "min=100.00" and "currency=NOK", then the vouchers can only be applied, if the purchase amount is greater than or equal to 100NOK. If unspecified, no amount constraints are applied to the purchase.

[maxuses]

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

 

Return parameters

 

Parameter

Type

Description

StatusCode

string

A value of 0 means that the voucher(s) was successfully generated.

statustext

string

A text describing success or failure of the voucher generation.

voucherList

string(s)

Semicolon separated list of voucher codes.


Example

<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="DISCOUNT">
    <input type="hidden" name="value" value="5">
    <input type="hidden" name="currency" value="DKK">
    <input type="hidden" name="min" value="99.99">
</form>