Skip to main content

Store Get Webhook

The store.get webhook retrieves a list of items available for a player in the Game Hub store. This is useful for displaying the store content based on game logic.

This webhook is triggered in the following cases:

  • A player logs in to the game hub.
  • A player opens the store.
  • A player makes a purchase.
Get store webhook
Get store webhook

Requirements

To use the store.get webhook from Aghanim, you should have the webhook server configured as follows:

  • HTTPS endpoint, accepting POST webhook requests.
  • Listen for events, generated and signed by Aghanim.
  • Respond with 2xx status codes to signal successful processing, and 4xx or 5xx for denial or errors.

Configuration

  1. Develop a function for the store.get webhook processing.
  2. Make your endpoint available.
  3. Register your endpoint within Aghanim account → GameWebhooksNew Webhook by choosing the store.get event type.

Alternatively, you can register your endpoint within Aghanim using the Create Webhook API method.

Request schema

Below is an example of an store.get webhook request:

POST /your/webhook/uri HTTP/1.1
Content-Type: application/json
Host: your-webhook-endpoint.com
User-Agent: Aghanim/0.1.0
X-Aghanim-Signature: 2e45ed4dede5e09506717490655d2f78e96d4261040ef48cc623a780bda38812
X-Aghanim-Signature-Timestamp: 1725548450

{
"event_type": "store.get",
"event_data": {
"player_id": "2D2R-OP3C",
"is_anonymous": false,
"placement_keys": null,
"category_slugs": null,
"current_page_path": "/store",
"locale": "en"
},
"event_time": 1725548450,
"event_id": "whevt_eCacGbJVbvToOgzjXUgOCitkQE",
"idempotency_key": "idmpt_aXRlb...JkX2VFS",
"request_id": "d1593e9c-c291-4004-8846-6679c2e5810b",
"sandbox": false,
"trigger": "hub.store.open",
"transaction_id": "whtx_eCacGbJVbvT",
"context": null,
"game_id": "gm_exTAyxPsVwh"
}

The Event schema

KeyTypeDescription
event_idstringUnique Event ID generated by Aghanim.
game_idstringYour game ID in the Aghanim system.
event_typestringThe type of the event, store.get in this case.
event_timenumberEvent date in Unix epoch time.
event_dataEventDataContains the event-specific data, with possible keys for inherited objects.
idempotency_keystringEnsures webhook actions are executed only once, even if retried.
request_idstring|nullIf the event was triggered by an API request, the request ID is included.
sandboxbooleanIndicates whether the event was sent from the sandbox game environment.
triggerstring|nullThe trigger that caused the event to be sent.
transaction_idstringThe transaction ID generated by Aghanim. This ID may be the same for multiple events emitted within the same transaction.
contextEventContext|nullContextual information about the event.

The EventContext schema

KeyTypeDescription
orderOrderContext|nullOrder information associated with the event if applicable.
playerPlayerContext|null(Optional) Player information. To add this, enable "Add player context" in the webhook settings.

The EventData schema

KeyTypeDescription
player_idstringThe unique Player ID chosen for player authentication.
is_anonymousbooleanIndicates whether the current user is unauthenticated (anonymous).
placement_keysstring[]|nullList of placement keys from where store.get was requested.
category_slugsstring[]|nullList of category slugs from where store.get was requested.
current_page_pathstring|nullPath of the currently opened page, relative to the game hub root (for example, /store/offers).
localestringThe current player's locale code (ISO 639-1). Find the full list of possible locales in Locales.

The Trigger values

ValueDescription
hub.store.openWhen the store is opened.
hub.loginWhen the player opens the game hub.
hub.purchaseWhen the player clicks the buy button in the store to verify that the item is still available for the player.
order.capturedJust before payment processing begins, to verify that the item is still available for the player.
testWhen using the "Send test event" in the Dashboard.

Response schema

Upon a successful response, your server is expected to return a status code in the 2xx range and the following JSON payload:

KeyTypeDescriptionRequired?
items[Item|BundleItem]An array of items available for the player in the store.No
rolling_offersRollingOffer[]An array of rolling offers available for the playerNo

The Item schema

KeyTypeDescriptionRequired?
skustringItem SKU matching on both the game and Aghanim sides.Yes
start_atnumberThe unix-timestamp when the item becomes available to the player.No
end_atnumberThe unix-timestamp when the item expires and is no longer available to the player.No
max_purchasesnumberThe maximum number of purchases allowed for the item.No

The BundleItem schema

KeyTypeDescriptionRequired?
skustringThe unique SKU identifier for the dynamic bundle itemYes
pricenumberThe price in USD in centsYes
namestringThe name of the bundle itemYes
nested_itemsNestedItem[]An array of items included in the bundle.Yes
descriptionstringThe description of the bundle itemNo
image_urlstringThe image URL of the bundle itemNo
image_url_featuredstringThe image URL for the bundle item when displayed as a featured item. Applies only if the item is featured.No
featured_card_background_image_urlstringThe background image URL for the bundle item card when displayed as a featured item. Applies only if the item is featured.No
category_slugsstring[]Array of category slugs to determine the placement of the bundle itemNo
start_atnumberThe unix-timestamp when the item becomes available to the player.No
end_atnumberThe unix-timestamp when the item expires and is no longer available to the player.No
max_purchasesnumberThe maximum number of purchases allowed for the item. Once the limit is reached, the item disappears from the storeNo
price_template_idstringThe ID of the price template that will be used for pricing in different countries.No
custom_badgestringCustom badge text of the bundleNo
bonus_itemsWebhookItemBonus[]An array of bonus items included in the bundleNo
bonus_badgestringBadge text about bonus itemsNo
bonus_percentnumberBonus percent applied for first stackable item in nested_itemsNo
bonus_fixednumberFixed bonus value applied to the first stackable item in nested_items. If set, bonus_percent is ignored.No
metadataobjectThe metadata object structured as key-value pairs to store additional information about the item.No
view_optionItemViewOptionControls the store appearance of the item. Allowed values: default, in_title

No
card_typeStoreCardTypeThe type of the card for the item, used for displaying in the store: default, featured
No
free_claimsFreeClaimsSettings to make the item claimable for free instead of being purchased.
No

The NestedItem schema

KeyTypeDescriptionRequired?
skustringItem SKU matching on both the game and Aghanim sides.Yes
quantitynumberThe quantity of the nested item, relevant for stackable itemsNo
is_featuredbooleanDefine if item is featured in the bundle listNo
metadataobjectThe metadata object structured as key-value pairs to store additional information about the item.No

The WebhookItemBonus schema

KeyTypeDescriptionRequired?
skustringItem SKU matching on both the game and Aghanim sides.Yes
quantitynumberThe quantity of the bonus item, relevant for stackable itemsNo

The FreeClaims schema

KeyTypeDescriptionRequired?
enabledbooleanIndicates whether the item can be claimed for free instead of being purchased.
Yes
max_claimsnumberThe maximum number of times an item can be claimed within the specified period.
Yes
periodPeriodPeriod window used to reset max_claims. If omitted, the limit will not reset after the maximum number of claims is reached.
No
exceeded_claims_behaviorExceededClaimsBehaviorDefines behavior after reaching the maximum number of claims. Allowed values: hide – removes the item from the store; disable_with_timer – keeps it visible but disabled with a countdown until the next reset. If the period is omitted, the countdown is not shown and the item remains disabled.
No

The Period schema

KeyTypeDescriptionRequired?
unitPeriodTypeThe type of period used for the claim limit. Possible values: month, week, day, hour.
Yes
durationnumberThe duration of the period, measured in the units specified by unit (for example, duration: 2 with unit: day, represents a two-day period).
Yes

The RollingOffer schema

KeyTypeDescriptionRequired?
keystringUnique offer key used to determine whether the item has been purchased or claimed.Yes
placement_keystringKey of the block in game hub, where the rolling offer will be displayed.Yes
namestringTitle of the rolling offer.Yes
descriptionstringDescription of the rolling offer.Yes
rolling_itemsRollingItem[]List of items included in the rolling offer.Yes
background_image_urlstringURL of the background image.No
background_sizestringSize of the background image. Possible values: contain, repeat, cover.No
expire_atnumberExpiration time of the offer as a Unix timestamp. The timer in the offer block counts down to this moment and the offer becomes hidden when it’s reached.No

The RollingItem schema

KeyTypeDescriptionRequired?
skustringThe unique SKU identifier for the dynamic bundle item.Yes
quantitynumberThe quantity of the item, relevant for stackable items.No
is_free_itembooleanIndicates whether the item can be claimed for free instead of being purchased.No

Example of a successful response

{
"items": [
{
"sku": "crystals"
},
{
"sku": "shield",
"start_at": 1630000000,
"end_at": 1635000000
},
{
"sku": "fly_bundle",
"price": 2000,
"name": "Fly Bundle",
"description": "Fly Bundle Description",
"image_url": "https://example.com/fly-bundle.png",
"image_url_featured": "https://example.com/fly-bundle-featured.png",
"featured_card_background_image_url": "https://example.com/fly-bundle-featured-background.png",
"nested_items": [
{
"sku": "nested_item_sku_1"
},
{
"sku": "nested_item_sku_2",
"quantity": 200
}
],
"category_slugs": [
"category_slug_1"
]
},
{
"sku": "free-fly-bundle-with-timer",
"name": "Fly Bundle",
"description": "Bundle with fly and sword",
"background_image_url": "https://example.com/background.jpg",
"category_slugs": ["first"],
"nested_items": [
{"sku": "diamond-002", "quantity": 2},
{"sku": "sword-thb"},
],
"free_claims": {
"enabled": True,
"max_claims": 1,
"period": {"unit": "day", "duration": 1},
"exceeded_claims_behavior": "disable_with_timer",
}
}
],
"rolling_offers": [
{
"key": "rolling_offer_1",
"placement_key": "place1",
"name": "Dynamic Special Offer",
"description": "Limited time offer",
"rolling_items": [
{
"sku": "coins",
"quantity": 256,
"is_free_item": false
},
{
"sku": "gold",
"quantity": 999,
"is_free_item": true
}
],
"background_image_url": "https://static-platform.aghanim.com/image.webp",
"background_size": "cover",
"expire_at": 1762964336
}
}

Need help?
Contact our integration team at integration@aghanim.com