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)
| Status | Description | Allowed Transitions |
|---|---|---|
pending | Created but not yet redeemed | → processed, → failed |
processed | Successfully redeemed | (terminal state) |
failed | Redemption attempted but failed | → processed (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:
- Navigate to Premium::BulkImportRedemptionsTask
- Upload a CSV file with columns:
email,plan - Execute the task
CSV Format:
email,plan
user1@example.com,essential
user2@example.com,integral
user3@example.com,essential
Notes:
- All records are created with
pendingstatus - Duplicate emails are skipped if a redemption already exists
- Invalid rows are logged but don't stop the import
- Emails are normalized to lowercase
Related Documentation
- Premium Overview - Overall premium system architecture
- Firebase Integration - Firebase Auth and Firestore details