Drop Rate Compliance
Disclose drop rates and rarity for randomized rewards with info buttons, tooltips, and the offer details popup.
For loot boxes and randomized rewards, the API supports drop rate disclosure required for legal compliance in many jurisdictions.
Info buttons
An info button shows an "i", and tapping it opens its tooltip or a page. It can sit in two places:
| Field | Where the "i" appears |
|---|---|
contents[].infoButton | On one reward, when that reward has a rarity or a drop rate to explain. |
attributes.infoButton on a product, a pack or a free item | On the whole offer, for example when what the player buys as a whole is drawn at random. On a pack it shows with every price point. |
Both are the same Button shape, with the same fields and rules whether the button sits on a reward or on a whole offer:
| Field | Meaning |
|---|---|
informationType | Optional. What the button explains: INFORMATION_TYPE_RARITY for a reward's rarity, such as a guaranteed minimum rarity, or INFORMATION_TYPE_DROP_RATES for drop rates (the odds disclosure). The shop can style each kind differently. When unset, the button is a general info button. |
tooltip.text | Optional. The tooltip text, a LocalizableText that can use formatted text. With INFORMATION_TYPE_DROP_RATES, it can contain links. |
linkUrl | Optional. The URL of a page with more information, such as your full drop rates, starting with https://, opened when the player taps a button that has no tooltip. With a tooltip, link the page from the tooltip text instead. A URL that is not https is ignored. |
iconImageUrl | Optional. The button's icon. A generic info icon shows when absent. |
text | Optional on an info button, which can show its icon alone. |
Tapping an info button opens its tooltip when it has one, and otherwise opens linkUrl. A tooltip whose text cannot be shown, and a linkUrl that is not https, count as not sent, and an info button with neither is not shown. Leave the offer's info button out when there is nothing to explain, for example on coins only.
A reward with a guaranteed minimum rarity, like the card pack in the formatted text example, can set "informationType": "INFORMATION_TYPE_RARITY" on its infoButton. A reward whose own contents are drawn at random can set "informationType": "INFORMATION_TYPE_DROP_RATES" with a linkUrl to its drop rates page, or a tooltip with links. A pack whose rewards are drawn at random can explain its drop rates once for the whole offer:
{
"pack": {
"id": "sticker-pack-offer",
"attributes": {
"infoButton": {
"informationType": "INFORMATION_TYPE_DROP_RATES",
"tooltip": {
"text": {
"defaultText": "For the odds, see [here](https://example.com/odds)",
"localizationKey": "TOOLTIP.DROP_RATES"
}
}
}
},
"items": [
{
"productId": "sticker-pack-small",
"price": { "priceId": "price-small" },
"contents": [{ "name": { "defaultText": "Sticker pack" }, "quantity": "1" }]
}
]
}
}Links in drop rates tooltips
The tooltip text of an info button with INFORMATION_TYPE_DROP_RATES, on a reward or on a whole offer, can contain links written as [label](url), for example For the odds, see [here](https://example.com/odds).
- Link form. A link is
[, the label up to the first], then immediately(, and the URL up to the first), with no spaces in the URL. Write a)inside a URL as%29. - Only links are read. Every other character shows as typed, including a
[or(that does not complete a link. No other formatting is applied. httpsonly. A link whose URL does not start withhttps://followed by a host, or that carries a user name (user@host), shows its label as plain text, so the text is never lost. A link with an empty label shows nothing.- After formatting. Links are read from the text after formatted text values are inserted. A value you send in
formatArgumentsalways shows as typed and never starts or ends a link. A value inside a label shows as part of the label; a link whose URL contains a value shows its label as plain text. - Special characters in a URL. In a printf-style text, write a
%in the URL as%%(so%29becomes%%29). In an ICU-style text, quote any brace. Otherwise the text cannot be composed. - Other tooltips are unchanged. In every other tooltip,
[and(are ordinary characters.
All of these fields are optional, so a response without them stays valid.
Enabling Drop Rate Display
To show drop rates or offer details in a popup:
-
Add a badge with the show details action: Include a badge on the offer with
action: BADGE_ACTION_SHOW_OFFER_DETAILS. This signals to the frontend to display an info button that calls the GetOfferDetails API and opens the corresponding modal. -
Enable per-item details (optional): For individual content items that should show their own reward/drop rate details, include
clickAction: CONTENT_ITEM_CLICK_ACTION_SHOW_DETAILS_BY_IDon thatContentItem.
Example Catalog.PurchasableItem Response
{
"attributes": {
"badge": {
"text": { "defaultText": "Loot Box" },
"action": "BADGE_ACTION_SHOW_OFFER_DETAILS"
}
},
"contents": [
{
"name": "Legendary Hero",
"guid": "xxx",
"image": "https://...",
"quantity": "1",
"dropRate": "2.5%",
"clickAction": "CONTENT_ITEM_CLICK_ACTION_SHOW_DETAILS_BY_ID"
},
{
"name": "Common Item",
"quantity": "1",
"dropRate": "97.5%"
}
]
}If using clickAction, the guid must be supplied (can't be auto-generated)
to cross-reference with the GetOfferDetails API response.
How is this guide?