Skip to content
Fluxer API

Gifts

A gift is a code that grants premium to the account that redeems it. Create gift checkout buys one. The routes on this page work only while the instance premium mode is mirror.

Anyone who has an unredeemed code can look it up and redeem it. Keep the code secret until you give it away.

A gift grants premium for a set duration.

FieldTypeDescription
code1stringThe code to pass to Redeem gift
duration_typestringThe duration unit of duration_quantity
duration_quantity2integerThe number of units the gift grants
redeemedbooleanWhether the code has been redeemed
created_by?3?partial user objectThe account that created the gift

1 32 case-sensitive letters and digits

2 A value of 0 grants lifetime premium

3 For a gift created through the Admin API, created_by is the administrator who created it

{
"code": "aZ3kQ9mR2tX7bN4vC8wL5yH1sD6gF0pJ",
"duration_type": "months",
"duration_quantity": 1,
"redeemed": false,
"created_by": {
"id": "1501314428688998182",
"username": "quill",
"discriminator": "0001",
"global_name": "Quill",
"avatar": null,
"avatar_color": null,
"flags": 0
}
}

Bought gifts use months or years, and only gifts created through the Admin API use days or weeks.

ValueDescription
daysPeriods of 24 hours
weeksPeriods of seven 24-hour days
monthsCalendar months, clamped to the last day of the target month
years12 calendar months
GET/v1/gifts/{code}Unauthenticated

Returns a gift.

StatusBodyCondition
200gift objectThe gift was returned
404error responseUNKNOWN_GIFT_CODE when the code does not exist or was revoked after a refund

The rate limit is 60 requests per 10 seconds, on the gift:get bucket.

POST/v1/gifts/{code}/redeem

Redeems a gift for the current user and sends a User Update Gateway event. You need a claimed account.

A gift adds its duration after any premium the account already has and pushes back the next charge of an active subscription. A lifetime gift (duration_quantity of 0) cancels an active subscription.

FieldTypeDescription
X-Captcha-Token?stringThe solved ALTCHA challenge, see CAPTCHA handling
StatusBodyCondition
204emptyThe gift was redeemed
400error responseGIFT_CODE_ALREADY_REDEEMED when the code was already redeemed
400error responseSTRIPE_GIFT_REDEMPTION_IN_PROGRESS when the same code is being redeemed at the same time
400error responseSTRIPE_ERROR when the payment provider rejects the change to an active subscription. The code stays unredeemed
400error responseCANNOT_REDEEM_PLUTONIUM_WITH_VISIONARY when the account has lifetime premium
403error responseACCOUNT_VERIFICATION_REQUIRED for an unclaimed account
404error responseUNKNOWN_GIFT_CODE when the code does not exist or was revoked

The rate limit is 10 requests per minute, on the gift:redeem bucket.