This endpoint activates a voucher using the provided PIN and voucher code. Activation is required before redemption for some voucher types.
Request
Method: POST
URL: /merchant-client/v2/activate
Body: JSON object with PIN and voucher details.
Field Descriptions:
- pin (string, required) – Voucher PIN.
- code (string, required) – Voucher code.
Query Parameters: None
Responses
200 OK – Successful
Field Descriptions:
- data (object) – Activation transaction details.
- transactionId (string) – Unique transaction ID.
- transactionType (string) –
ACTIVATION. - amount (decimal) – Activation amount.
- timestamp (datetime) – Transaction timestamp.
- reference (string) – Your external reference.
- voucherCode (string) – Masked voucher code.
- serialNumber (string) – Voucher serial number.
- refundStatus (string) –
nullfor activations. - note (string) –
nullfor activations.
- statusCode (string) – Status code (
"00"indicates success). - message (string) – Human-readable message.
401 Unauthorized
Returned when authentication fails.
Unauthorized
400 Bad Request
Returned when the request is invalid (e.g., voucher already activated, invalid PIN).
Voucher already activated
Example cURL Request
curl -X POST \
'https://{baseUrl}/merchant-client/v2/activate' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{"pin":"1234","code":"ABC123"}'| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
The Activate Voucher endpoint is used to activate a voucher with a specific value and a unique transaction reference. This is typically the first step before a voucher can be redeemed.
Endpoint:
POST /api/v2/activate
Request
You must send three key values in the request body:
- serialNumber — The voucher’s serial number to be activated.
- value — The initial value or balance of the voucher. Defaults to 5000 if not specified.
- reference — A unique identifier for this request, used for tracking and to ensure idempotency. It must be at least one character long.
Example Request:
{
"serialNumber": 300002137,
"value": 5000,
"reference": "ACT-2025-0001"
}Response
If the API endpoint is reached successfully, the HTTP status code will be 200. The actual result of the activation is provided in the JSON body:
-
data — Contains the main transaction details, such as:
- Masked voucher code.
- Serial number.
- Transaction ID generated by SureGifts.
- Transaction type (in this case,
ACTIVATION). - Transaction amount.
- Timestamp of when the activation occurred.
- The same
referenceyou sent in the request.
-
statusCode — The business status code indicating success or specific failure conditions.
-
message — A human-readable description of the
statusCode.
Example Successful Response:
{
"data": {
"voucherCode": "112*** ***862",
"serialNumber": "300002137",
"transactionId": "96",
"transactionType": "ACTIVATION",
"amount": 5000.00,
"timestamp": "2025-02-10T03:31:18.6436925Z",
"reference": "ACT-2025-0001"
},
"statusCode": "00",
"message": "Successful"
}Developer Notes
- Always check
statusCodeto determine if the activation was successful. - Use a unique
referencefor every activation attempt to avoid duplicate transaction errors. - The structure of
datacan vary across endpoints — validate only what you expect for this call. - Avoid logging full voucher codes; store only masked values for security.