Skip to main content

activateVoucher.php

SM JSON Voucher Activation Service

Endpoint:

activateVoucher.php

This service reserves a "blank" voucher, activates it, assigns a point account number, an address, and modifies other values.

Parameters:

  • user: SM user name for authentication
  • password: SM user password for authentication
  • cardnr: the number of the point account
  • addressnr: the AddressNr to assign the voucher to

Return Values of the JSON Structure:

  • success: true or false
  • status: numeric status, see table below for details
  • data:
    • If success is true, returns information about the reserved voucher (see below)
    • If success is false, returns the error message
    • vouchercode: the numeric code of the reserved voucher
    • alphacode: the alphanumeric code of the reserved voucher; this will be the new number which has to be shown to the customer and also what they have to enter to reference it

Status Codes:

  • 0: Execution successful
  • 102: Cannot connect to database
  • 103: Authentication failure
  • 104: No valid parameters given
  • 105: Address not found
  • 106: Address already has a voucher
  • 107: No available blank voucher

Examples:

  • Request: /activateVoucher.php?user=XXXX&password=XXXX&cardnr=443322&addressnr=5193
  • Successful response:
{
"success": true,
"status": 0,
"data": {
"vouchercode": "552487811998970000",
"alphacode": "PDPP4EN"
}
}