Skip to main content

Premium Redemptions

The Premium Redemptions feature allows stakeholders to authorize premium access for users without requiring a Stripe payment. This is useful for special promotions, partnerships, or internal access grants.

Overview

Unlike standard premium subscriptions that flow through Stripe, redemptions are created manually (via admin UI or CSV import) and then redeemed by users through an API endpoint using their Firebase credentials.

Architecture

Redemption Lifecycle

1. Creation

Redemptions are created with pending status via:

  • Avo Admin UI: Individual record creation at /resources/premium_redemptions
  • CSV Import: Bulk creation via Maintenance Tasks at /maintenance_tasks

2. Redemption Flow

When a user redeems their subscription:

3. Status Transitions (AASM State Machine)

StatusDescriptionAllowed Transitions
pendingCreated but not yet redeemedprocessed, → failed
processedSuccessfully redeemed(terminal state)
failedRedemption attempted but failedprocessed (retry)

Admin Operations

Avo Admin UI

Access the admin panel at /resources/premium_redemptions to:

  • View all redemptions with status, plan, and timestamps (status shown as colored badge)
  • Search by email address
  • Create individual redemption records
  • Edit pending redemptions (change plan)

Note: Status is view-only and cannot be manually edited. Status transitions are controlled by AASM state machine events.

CSV Bulk Import

For bulk imports, use the Maintenance Task at /maintenance_tasks:

  1. Navigate to Premium::BulkImportRedemptionsTask
  2. Upload a CSV file with columns: email,plan
  3. Execute the task

CSV Format:

email,plan
[email protected],essential
[email protected],integral
[email protected],essential

Notes:

  • All records are created with pending status
  • Duplicate emails are skipped if a redemption already exists
  • Invalid rows are logged but don't stop the import
  • Emails are normalized to lowercase