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:
trueorfalse - status: numeric status, see table below for details
- data:
- If
successistrue, returns information about the reserved voucher (see below) - If
successisfalse, 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
- If
Status Codes:
0: Execution successful102: Cannot connect to database103: Authentication failure104: No valid parameters given105: Address not found106: Address already has a voucher107: 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"
}
}