Voucher Generation
Generate a Voucher
Generates a single prepaid voucher code that an end user can redeem in the Academia app.
Endpoint: POST /vouchers/generate
Request
bash
curl -X POST https://api.academia.ly/api/v1/reseller/vouchers/generate \
-H "Authorization: Bearer {token}" \
-H "Content-Type: application/json" \
-d '{
"denomination_id": 3
}'| Field | Type | Required | Description |
|---|---|---|---|
denomination_id | integer | Yes | ID of the denomination (from the Denominations endpoint) |
Response
Success (201):
json
{
"data": {
"code": "001110016812345",
"serial_number": "98712345678",
"denomination_value": 100,
"activation_date": "2026-04-09",
"expiry_date": "2027-04-09"
}
}| Field | Type | Description |
|---|---|---|
data.code | string | The voucher code. This is what the end user enters to redeem the voucher. |
data.serial_number | string | Unique serial number for the voucher |
data.denomination_value | number | Value in LYD |
data.activation_date | string | Voucher is valid from this date |
data.expiry_date | string | Voucher expires after this date |
Important
The code and serial_number are sensitive --- treat them like cash. Once generated, the voucher is active and can be redeemed by anyone who has the code.
Errors
| Status | Response | Meaning |
|---|---|---|
| 401 | {"message": "Invalid credentials."} | Invalid or expired token |
| 403 | {"message": "Access denied."} | IP not whitelisted |
| 422 | {"message": "Validation failed.", "errors": {...}} | Invalid denomination_id |
| 422 | See below | Daily limit exceeded |
Daily limit exceeded (422):
json
{
"message": "Daily limit exceeded.",
"daily_max_amount": 5000,
"used_today": 4950,
"remaining": 50,
"requested": 100
}| Field | Description |
|---|---|
daily_max_amount | Your total daily limit in LYD |
used_today | Amount already used today (vouchers + deposits) |
remaining | How much you can still use today |
requested | The denomination value you tried to generate |