Skip to content

Redemption ​

What it is ​

Redemption is a bulk-issued redeemable code. Admins generate codes, end users redeem them at the public "Redemption Center" to receive quota or activate a plan.

Where to find it ​

  • Admin → Redemption Codes: list, CSV / TXT export
  • Public → Redemption: user enters code
  • Admin → User detail: per-user redemption history

What you set per code ​

FieldWhereEffect
TypeAdmin → Add"Quota" adds to User.quota; "Plan" creates a Subscription.
Quota amountAdmin → AddCredited on redeem (quota type only).
PlanAdmin → AddActivated on redeem (plan type only).
ExpiryAdmin → AddAfter expiry, code is unusable.
Max redemptionsAdmin → AddDefaults to 1.

Operator-relevant fields (per code) ​

FieldMeaningEffect
CodeThe stringChanging it after issuance breaks distribution.
TypeQuota / PlanDrives the redeem action.
Quota amountNumberCredited (quota type only).
Plan FKPlanActivated (plan type only).
Total redemptionsDefault 1Larger numbers mean "multi-redeem code".
RedeemedNumberIncrements automatically; maxed-out codes stop working.
Expire timeUnix seconds / 0 = neverAfter expiry, code is unusable.
StatusUnused / Exhausted / ExpiredDrives whether the code still works.

Crediting on redeem ​

  • Quota type: User.quota += amount immediately, no approval
  • Plan type: create a Subscription with expire_at = now + Plan.duration_days

Code format ​

24-char random string by default. For bulk distribution, export CSV / TXT (one code per line).

  • POST /api/redemption/ — create
  • GET /api/redemption/ — list
  • POST /api/redemption/redeem — user redeem
  • DELETE /api/redemption/:id — delete