stars

Redeem Gift

Redeem a gift token and activate Pixley Premium for the authenticated user.

Steps:

  1. Look up the gift by token — 404 if not found.
  2. Reject already-redeemed gifts — 400.
  3. If the gift was addressed to a specific email, verify it matches the authenticated user's email — 403 on mismatch.
  4. 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.
  5. 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

tokenstring required

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.