AviMiles / Docs
Documentation / Developer API
Developer API

Membership and perk API

Check whether a Roblox user holds a card or benefit.

Retrieve membership

GET /api/v1/loyalty/members/123456789
Authorization: Bearer YOUR_API_KEY

Replace the number with the passenger’s Roblox user ID. The older /loyalty/passengers/{roblox_id} path returns the same status.

Response fields

FieldMeaning
is_memberWhether the passenger has an eligible membership
tier_idNumeric tier ID or null
membership_numberAirline ID and Roblox ID combined, or null
perk_idsCustom perk identifiers
miles_multiplierCurrent multiplier, or 1
tierTier details, benefits, artwork and layout when configured
milesCurrent balance
next_tierNext mileage threshold, if any
manual_overrideWhether a manual tier differs from the automatic tier

Always check is_member before using tier data: an eligible tier may be returned even when the passenger has no membership record.

Roblox example

local HttpService = game:GetService("HttpService")
local API_KEY = "YOUR_SERVER_ONLY_KEY"
local function hasPerk(player, perk)
    local ok, response = pcall(function()
        return HttpService:RequestAsync({
            Url = "https://avitech.tech/api/v1/loyalty/members/" .. player.UserId,
            Method = "GET",
            Headers = {Authorization = "Bearer " .. API_KEY}
        })
    end)
    if not ok or not response.Success then return false end
    local parsed, data = pcall(function()
        return HttpService:JSONDecode(response.Body)
    end)
    return parsed and data.is_member == true
        and table.find(data.perk_ids or {}, perk) ~= nil
end
-- Call from your trusted server-side boarding logic:
-- hasPerk(player, "business_boarding")

Manual tier override

PUT /loyalty/passengers/{roblox_id}/tier with the same Roblox ID in the body and a numeric tier ID. Use null to remove the override.

{"roblox_id":"123456789","tier_id":12}

Understand tier benefits

FieldMeaning
tier.perksLegacy display-only text benefits
tier.benefitsCustom perk objects with id, name and description
perk_idsIdentifiers for the current membership
tier.multiplier / tier.bonusBuilt-in flight mileage benefits
tier.layoutText element positions, sizes, colours, weights, alignment and visibility
tier.artworkUploaded card image data, if configured

Use is_member and tier_id to check a particular card. Use perk_ids to check access to a custom benefit. Do not treat legacy text as an access permission. An eligible tier may be returned even when is_member is false.