This endpoint retrieves previously generated vouchers using the reference provided during generation.
Request
Method: GET
URL: /merchant-client/v2/vouchers/{reference}
Path Parameters:
- reference (string, required) – Your unique reference used during voucher generation.
Query Parameters: None
Body: None
Responses
200 OK – Successful
Field Descriptions:
- data (object) – Voucher information including codes, PINs, and expiry dates.
- statusCode (string) – Status code (
"00"indicates success). - message (string) – Human-readable message.
401 Unauthorized
Returned when authentication fails.
Unauthorized
404 Not Found
Returned when the voucher reference is not found.
Vouchers not found
Example cURL Request
curl -X GET \
'https://{baseUrl}/merchant-client/v2/vouchers/REF123' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json'| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
The Download Vouchers endpoint allows you to retrieve voucher details that were previously generated using a specific reference. This is typically used when:
- The voucher generation request had a quantity greater than 10 (so results were not returned immediately).
- You want to retrieve vouchers asynchronously after receiving a webhook notification.
Endpoint:
GET /api/v2/vouchers/{reference}
Path Parameter
- reference (string, required) — The unique reference you provided when generating vouchers. This ensures you retrieve the correct set.
Response
If the API endpoint is reached successfully, the HTTP status will be 200. The actual readiness of vouchers is indicated by the status field in the data object.
Fields in the Response:
-
data — Contains the voucher batch details:
-
reference — Your unique request reference.
-
transactionId — Unique request identifier generated by SureGifts.
-
status — Current processing status:
PROCESSING,CANCELED, orCOMPLETED. -
expiryDate — The expiration date of the vouchers.
-
value — The value loaded on each voucher.
-
vouchers — Array of voucher objects (only present when
statusisCOMPLETED). Each object contains:serialNumber— The voucher serial number.code— The voucher code.pin— The voucher PIN (if applicable).
-
-
statusCode — Business status code.
-
message — Human-readable description of the status code.
Example Successful Response
{
"data": {
"reference": "VCH-2025-0001",
"transactionId": "12345",
"status": "COMPLETED",
"expiryDate": "2025-08-20T17:47:10.211Z",
"value": 5000,
"vouchers": [
{
"serialNumber": 300002137,
"code": "ABC123XYZ",
"pin": "7890"
}
]
},
"statusCode": "00",
"message": "Successful"
}Developer Notes
- Always verify
statusisCOMPLETEDbefore assuming vouchers are available. - Handle
PROCESSINGby retrying later or waiting for a webhook notification. - Store voucher codes and PINs securely; never expose them in logs or to unauthorized users.
- The same
referencewill always return the same voucher batch — useful for idempotency and reconciliation.