stars
Redeem Gift
Redeem a gift token and activate Pixley Premium for the authenticated user.
Steps:
- Look up the gift by token — 404 if not found.
- Reject already-redeemed gifts — 400.
- If the gift was addressed to a specific email, verify it matches the authenticated user's email — 403 on mismatch.
- Calculate the RevenueCat promotional-entitlement expiry:
- If the user has no current entitlement (or it has expired), new_expiry = now + duration.
- If the user still has an active entitlement, stack the gift duration on RevenueCat's current expiry.
- Claim the token with a conditional update (redeemed false -> true), so only one caller can proceed, then grant the resulting promotional entitlement in RevenueCat. A failed grant releases the claim. No database expiration is written; RevenueCat remains the source of truth.
Returns: { "message": "Gift redeemed successfully", "premium_until": <ISO timestamp> }
post/api/gifts/redeem
Request
- Base URL: https://api.pixleyai.com (the document declares no server; this is the origin it was published from)
- URL: https://api.pixleyai.com/api/gifts/redeem
- Auth: HTTP bearer
Request body
Response
Successful Response
unknown required
Changes
No recorded changes to this operation across all 1 revision of this API.