Skip to content
Fluxer API

Gift codes

Admin gift code generation issues premium codes in bulk, each one redeemable once and each granting a fixed span of entitlement. Gifts defines the public record of a code and its single redemption.

This resource has that one operation. No Admin operation lists, revokes, or redeems a code, or reports who redeemed one.

The unit and the quantity together define the span a redeemed code grants. Fluxer adds the span to the redeemer’s entitlement anchor at redemption time. Lifetime gifts are not supported.

ValueDescription
daysThe quantity counts days added to the entitlement anchor
weeksThe quantity counts weeks added to the entitlement anchor
months1The quantity counts calendar months added to the entitlement anchor
years1The quantity counts calendar years, applied as twelve calendar months each

1 A calendar month is added in UTC and clamped to the last day of the target month, so an anchor of 31 January extended by one month lands on 28 or 29 February

POST/v1/admin/gift-codes

Generates the requested number of unredeemed gift codes. Requires gift_codes:generate. Returns the complete redemption links on success.

FieldTypeDescription
countintegerThe number of codes to generate (1-100)
duration_typestringThe gift duration unit the quantity is counted in
duration_quantityintegerThe quantity of the selected unit (1-3650)
FieldTypeDescription
codes1array[string]The complete redemption links, one for each generated code, in generation order

1 Each entry is the instance’s configured gift endpoint, with one trailing slash removed if present, followed by / and the code

{
"codes": [
"https://example.com/gift/aB3dEfGhIjKlMnOpQrStUvWxYz012345",
"https://example.com/gift/Zy9XwVuTsRqPoNmLkJiHgFeDcBa543210"
]
}
StatusBodyCondition
200response bodyThe codes were generated
4031error responseThe account does not hold admin:authenticate, does not hold gift_codes:generate, or the instance is self-hosted

1 Returned as MISSING_PERMISSIONS without admin:authenticate, as MISSING_ACL with that but without gift_codes:generate, and as FEATURE_NOT_AVAILABLE_SELF_HOSTED on a self-hosted instance

Each code is 32 characters drawn from the uppercase letters, the lowercase letters, and the digits. Each code is created unredeemed and records the system account with ID 0 as its creator, which is the creator the gift object reports to the redeemer.

Fluxer writes the codes one at a time. A failure part way through leaves the codes already written redeemable while the response reports the failure. Those codes appear in no response.

The operation records no Admin audit entry and emits no Gateway Dispatch.

30 requests per minute for each authenticated user, on the admin:code:generation bucket.