curl --request POST \
--url https://api.promostack.app/referee-redeem \
--header 'Content-Type: application/json' \
--data '
{
"referee_uid": "<string>",
"metacode": "<string>",
"platform": "<string>"
}
'{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid platform. Must be 'ios' or 'android'"
}
}
Redeem a metacode and get a platform-specific promo code
curl --request POST \
--url https://api.promostack.app/referee-redeem \
--header 'Content-Type: application/json' \
--data '
{
"referee_uid": "<string>",
"metacode": "<string>",
"platform": "<string>"
}
'{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid platform. Must be 'ios' or 'android'"
}
}
ios or androidcurl -X POST https://api.promostack.app/referee-redeem \
-H "Content-Type: application/json" \
-d '{
"referee_uid": "user_456",
"metacode": "abc123",
"platform": "ios"
}'
ios or androidShow properties
{
"code": "LOGI-IOS-XYZ789",
"platform": "ios",
"instructions": "Copy this code and redeem it in the App Store under your account settings",
"store_url": "https://apps.apple.com/account/redeem",
"referrer_info": {
"message": "Referred by abc123"
}
}
func redeemMetacode(userId: String, metacode: String) async throws -> RedeemResponse {
let url = URL(string: "https://yejzycmzbcwjsapmkwrq.supabase.co/functions/v1/referee-redeem")!
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.setValue(apiKey, forHTTPHeaderField: "x-api-key")
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
let body = [
"referee_uid": userId,
"metacode": metacode.lowercased(),
"platform": "ios"
]
request.httpBody = try JSONEncoder().encode(body)
let (data, _) = try await URLSession.shared.data(for: request)
return try JSONDecoder().decode(RedeemResponse.self, from: data)
}
// Show code with copy button
func showPromoCode(_ response: RedeemResponse) {
let alert = UIAlertController(
title: "Your Promo Code",
message: "\(response.code)\n\n\(response.instructions)",
preferredStyle: .alert
)
alert.addAction(UIAlertAction(title: "Copy Code", style: .default) { _ in
UIPasteboard.general.string = response.code
// Open store URL
UIApplication.shared.open(URL(string: response.store_url)!)
})
present(alert, animated: true)
}
{
"error": {
"code": "VALIDATION_ERROR",
"message": "Invalid platform. Must be 'ios' or 'android'"
}
}
Validate Metacode
referrer_slug matching the metacodeAnti-Fraud Check
Assign Code
Map Attribution
codes.redeemed_by_uid = referee_uid for RevenueCat matchingCreate Event
code_assignedReturn Code
referee_uid that you use with RevenueCat (app_user_id)test123 in development to verify your integration without consuming real codes.