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 | Shop identification. The Merchant number appears in the e-mail received from DIBS during registration with DIBS or on your contract. Your merchant number can also be retreived by contacting your respective DIBS support department below. Denmark Norway Sweden |
| value | Specifies the fixed amount 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". |
| 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". |
| quantity | The number of vouchers to generate. |
| currency | Currency specification as indicated in ISO4217 where the EUR is no. 978. Either the numeric or alphabetic code is accepted. Also see our list of currencies. |
| [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. |
| [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. |
| [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". |
| [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. |
Return parameters
Parameter | Type | Description |
| voucherList | string(s) | Semicolon separated list of voucher codes. |
| 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. |
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>