Skip to main content
POST
POST /referee-redeem

Redeem Metacode

Validates a metacode and issues a platform-specific promo code to the referee. This is the core of the metacode flow.

Request

string
required
Unique identifier for the referee in your app (must match RevenueCat app_user_id)
string
required
The metacode entered by the user (case-insensitive)
string
required
Platform for the promo code: ios or android

Example Request

Response

string
The platform-specific promo code to redeem in App Store or Google Play
string
Platform the code is for: ios or android
string
Human-readable instructions for redeeming the code
string
Direct URL to the store redemption page
object
Information about the referrer

Example Response

Usage in Mobile App

Error Responses

What Happens Behind the Scenes

1

Validate Metacode

System finds referrer by referrer_slug matching the metacode
2

Anti-Fraud Check

Verifies referee hasn’t already redeemed a code for this campaign
3

Assign Code

Atomically assigns code from referee pool for specified platform
4

Map Attribution

Sets codes.redeemed_by_uid = referee_uid for RevenueCat matching
5

Create Event

Creates referral event with status code_assigned
6

Return Code

Returns platform-specific promo code with redemption instructions

Best Practices

Always use the same referee_uid that you use with RevenueCat (app_user_id)
Convert metacode to lowercase before sending to handle user input variations
Show clear instructions and a “Copy Code” button in your UI
Handle all error codes gracefully with user-friendly messages
Don’t allow users to redeem multiple codes for the same campaign - the API will reject it

Testing

Use the test metacode test123 in development to verify your integration without consuming real codes.