Redemption Code Recycling

What is a Redemption Code?

A Redemption Code is a unique numeric string generated in the Punchh system when a guest in the mobile app chooses to redeem a reward. This code (or its QR code equivalent) must be entered into the Point-of-Sale (POS) system during the transaction for the guest to redeem the reward.

Once generated, each Redemption Code can be traced back to key information, including:

  • Reward type
  • Date and time of redemption
  • Store/location of redemption
  • Guest ID

All redemption activity, including attempts and successful usage, is available for reference on the Redemption logs page.

Types of Redemption Code Strategies

We currently support two Redemption Code formats:

Code Length Pool Size Use Case
7-digit 10 million For POS systems that support 7-digit codes
8-digit 100 million For POS systems that support 8-digit codes or require a larger pool

Strategy Selection: The selection depends on the brand’s POS compatibility. Brands should confirm support for either 7-digit or 8-digit codes before implementation.

Redemption Code Recycling Approach

Due to the finite pool of 7 and 8-digit codes, we employ a Redemption Code Recycling strategy to maintain code availability and system efficiency.

Recycling Logic

  • Codes that are expired or processed, and are older than 60 days, are eligible for recycling
  • These 7 or 8-digit codes are replaced in the backend with a 36-character UUID, a randomly generated string derived from current date-time inputs
  • Recycled UUIDs are never reused

Affected Platform Sections

Once a code is recycled, the new UUID will appear in:

  • Guest Timeline
  • Account History
  • Redemption Logs

Redemption Code Recycling Improves Response Times

Redemption code recycling enhances system performance by expanding the pool of available codes, allowing the system to fulfill redemption requests more efficiently.

When a redemption request is made, the system searches the pool to locate an available code. However, since there are no separate buckets for "used/expired" and "available" codes, the system iterates through the full set of codes, checking the status of each one before selecting an available entry.

By recycling expired or processed codes and returning them to the available pool, the system has more valid options to choose from. This reduces the average time spent scanning for an available code, leading to faster response times and more efficient handling of redemption requests, especially under high load.

Impacted Tables and Columns

The recycling process will directly update the following database tables and columns:

Table Name Column Name Description
redemptions internal_tracking_code Stores the original 7-digit redemption code
redemption_codes redemption_token Primary token representing a redemption
redemption_logs code Stores historical redemption attempts

Note: These columns will be updated with a 36-digit UUID for codes eligible for recycling. Downstream systems referencing these columns should account for the increased length and format change.

Impact and Considerations

For Brands WITH Data Pipelines

Brands with active data pipelines must perform the following evaluations to prevent disruptions in their downstream systems:

1. Data Type Validation

  • Determine the data type used for the Redemption Code columns (internal_tracking_code, redemption_token, code) in internal databases
    • If the column is defined as a string (VARCHAR/CHAR), the transition to a 36-character UUID will likely have no impact
    • If the column is defined as a numeric (INTEGER/SMALLINT) type, it will fail to store UUIDs, and schema updates will be required

2. Indexing and Reporting Logic

  • Confirm whether any of the impacted columns are being used in indexing, deduplication, or reporting logic.
    • If so, brands must update logic and reindex based on the new UUID format to avoid broken queries, mismatched joins, or failed ETL processes.

3. Use Case & Workflow Impact Assessment

Brands should evaluate how the following tables and columns are being used internally and assess for any downstream impact:

Table Column Potential Impact
redemptions internal_tracking_code Used for order/reward mapping; workflows relying on exact match may break if length/type is not updated
redemption_codes redemption_token May be used as a unique identifier; any logic comparing length or assuming numeric patterns must be updated
redemption_logs code Frequently used in auditing and analytics; dashboards or reports pulling codes from this table must accommodate UUIDs

4. Reporting and Historical Analysis

  • Systems pulling data for guest activity reports, fraud analysis, or promotion performance must account for format differences when joining or filtering by code.
  • Legacy codes (7- or 8-digit) will coexist with UUIDs, so logic must allow for handling both formats during the transition period.

5. Visual & UI Constraints

  • If redemption codes are displayed in any customer service tools, mobile apps, dashboards, or portals outside of Punchh, verify that the interface can properly render and display 36-character UUIDs without truncation or formatting issues.

For Brands WITHOUT Data Pipelines

If a guest refers to a code that is over 60 days old, the original 7-digit code will no longer be visible, and support teams may be unable to locate it.

Key Notes

  • Recycling is an automated backend process with no downtime or guest-facing impact
  • Each eligible code is converted once to a UUID and never reused
  • This approach helps maintain system performance while avoiding pool exhaustion of 7 and 8-digit codes

Frequently Asked Questions

Q1: Will guests see the new 36-digit UUID?
A: Yes, but only for codes older than 60 days that have been recycled. Active and recent codes still display the 7 or 8-digit format

Q2: Will this impact reporting systems?
A: Possibly. If your data pipeline uses redemption codes for indexing, deduplication, or filtering, you should validate compatibility with 36-character strings.

Q3: Can Support look up recycled codes?
A: For brands without internal mapping or logs of historical codes, recycled UUIDs may not be traceable by support teams.