Dynamic Catalog
To use dynamic catalogs, you need to create a REST API endpoint on your game backend. Stash calls this endpoint and passes a player ID to you, which determines what to show individual players in the webshop.
There are no strict limits on your dynamic catalog payload—just follow the base format detailed below. Add any metadata you need (e.g., item attributes). Stash’s dynamic catalog is fully customizable; contact our team if you need advanced features.
Catalog endpoint
Whenever a player visits your webshop, Stash will send a GET request to your game server to retrieve a player-specific catalog.
Request
Stash sends a GET request with the player’s ID as a query parameter:
GET /your-catalog-endpoint?player_id={player_id}
You can configure the endpoint URL and authentication methods in Stash Studio, the process is detailed in the configuration step below.
Response
Your endpoint should return a JSON response with the following structure:
{
"rows": [
{
"id": "row-1",
"header": "Featured Items",
"items": [
{
"type": "product",
"guid": "battle_pass",
"product_id": "battle_pass",
"name": "Battle Pass",
"description": "Dominate the battlefield with powerful heroes and essential resources!",
"image": "https://example.com/images/battle_pass.png",
"price": {
"amount": "34.99",
"currency": "USD"
},
"max_purchasable": 1,
"contents": [
{
"name": "Potion",
"description": "A mysterious potion you can drink to get some abilities or health back.",
"image": "https://example.com/images/potion.png",
"quantity": 10
}
],
"attributes": {
"banner": {
"text": "New"
},
"badge": {
"text": "Battle Pass"
}
}
}
]
},
{
"id": "banner-row",
"header": "",
"items": [
{
"type": "banner",
"guid": "promo_banner",
"title": "Earn free coins with every purchase",
"body": "and unlock exclusive rewards only available on the web",
"attributes": {
"background": {
"imageUrl": "https://example.com/images/banner-bg.png"
}
}
}
]
}
]
}
If the response is malformed or your endpoint returns error code (such as 400) Stash webshop will display an configurable error message to the player.
Data structure
This is a base payload structure, you can define the shop’s whole layout using rows and assing specific offers to each row. If any game-specific metadata needs to be passed you can leverage attributes field for each item. This object have no set structure and you can pass as much custom medata as needed to be displayed on your webshop.
Stash can also completly customize this payload structure on client-basis using our custom adapters, please contact us for more details.
Root Object
Property | Type | Required | Description |
---|---|---|---|
rows | Array | Yes | Array of catalog rows containing items and banners |
Row Object
Property | Type | Required | Description |
---|---|---|---|
id | String | Yes | Unique identifier for the row |
header | String | No | Display title for the row section |
items | Array | Yes | Array of items (products or banners) in this row |
Item Object (Product)
Property | Type | Required | Description |
---|---|---|---|
type | String | Yes | Item type. Must be "product" for purchasable items |
guid | String | Yes | Unique identifier for the item |
product_id | String | Yes | Product identifier used for purchase transactions |
name | String | Yes | Display name of the product |
description | String | No | Product description text |
image | String | Yes | URL to the product’s main image |
price | Object | Yes | Price information (see Price Object) |
max_purchasable | Number | No | Maximum quantity a player can purchase (default: unlimited) |
contents | Array | No | Array of items included in this product (see Content Object) |
attributes | Object | No | Additional visual attributes (see Attributes Object) |
Item Object (Banner)
Property | Type | Required | Description |
---|---|---|---|
type | String | Yes | Item type. Must be "banner" for promotional banners |
guid | String | Yes | Unique identifier for the banner |
title | String | Yes | Main banner headline |
body | String | No | Secondary banner text |
attributes | Object | No | Banner styling attributes (see Attributes Object) |
Price Object
Property | Type | Required | Description |
---|---|---|---|
amount | String | Yes | Price amount as a string (e.g., “19.99”) |
currency | String | Yes | ISO currency code (e.g., “USD”, “EUR”) |
Content Object
Property | Type | Required | Description |
---|---|---|---|
name | String | Yes | Name of the content item |
description | String | No | Description of the content item |
image | String | No | URL to the content item’s image |
quantity | Number | Yes | Quantity of this item included |
Attributes Object
The attributes object supports various visual enhancements:
Property | Type | Description |
---|---|---|
banner | Object | Banner overlay with text property |
badge | Object | Badge overlay with text property |
ribbon | Object | Ribbon overlay with text property |
tooltip | Object | Tooltip text with text property |
background | Object | Background image with imageUrl property |
Attribute Examples
{
"attributes": {
"banner": { "text": "New" },
"badge": { "text": "Limited Time" },
"ribbon": { "text": "Web Exclusive" },
"tooltip": { "text": "This is a special offer" },
"background": { "imageUrl": "https://example.com/bg.png" }
}
}
Configuration
To configure your dynamic catalog endpoint:
- In Stash Studio, navigate to your game settings
- Go to Webshop → Configuration
- Set your catalog endpoint URL
- Configure authentication if required
Debugging & Logs
Stash Studio provides comprehensive logging and debugging tools for your dynamic catalog. Use these tools to monitor your catalog endpoint’s performance and troubleshoot any issues:
- Check Stash Studio logs for endpoint response times
- Verify your endpoint returns valid JSON
- Ensure all required fields are present
- Test with different player IDs to verify personalization