Operations related to creating and updating game entities. Game entities are used to combine and sort items.
Backpack API & Webhooks (1.0.0)
Welcome to the Backpack API, an essential tool to enhance your item-selling strategy and promotional campaigns.
With Backpack, users can store information about the items they purchased or received for free. When receiving items, users don’t need to use their game ID or go to the game from the distributor site — they can keep items in the Backpack and redeem them later.
All items purchased or received for free on the distributor website are available to the user in the Metaframe widget or Xsolla Wallet.
User flow:
- The user visits the distribution site.
- The user logs in through the Xsolla account in the Metaframe widget.
- The user purchases the item or gets it for free and selects the option to move the item to the Backpack.
- Information about the received item is transferred to the Backpack.
- In the Metaframe widget or Xsolla Wallet, the user opens the Backpack section and selects the item.
- The user receives the item.
- Information about the received item is transferred to the game.
- Item Storage: Users can store information about items purchased or received for free.
- Redemption Flexibility: Items stored in the Backpack can be redeemed at the user's convenience.
To get started with Backpack, check out our detailed guide on Setting up Backpack. This guide will walk you through the process of configuring Backpack to suit your needs.
Backpack revolves around three major entities:
- Items: The core entities that can be distributed to users.
- Game: The entity designed to combine items.
- Backpack: The entity designed to to grant user items in the game.
Webhook notifications associated with the Backpack are listed under the Webhooks tag. For more in-depth information about working with webhooks, refer to our main webhook documentation.
To set up webhooks:
- Open your project in the Publisher Account.
- Click Project settings in the side menu and navigate to Webhooks.
- Specify the URL where you want to receive webhooks in the
https://example.comformat. - A secret key to sign project webhooks is generated by default. To generate a new secret key, click the refresh icon.
- Click Enable webhooks.
If you have set up a Metaframe webhook, please contact the integration team at integration@xsolla.com or your Customer Success Manager at csm@xsolla.com. They will assist you in setting up a second webhook for the project.
Pedido
Custom project settings.
Merchant ID. You can find this parameter in your Publisher Account:
- in the Company settings > Company section.
- in the URL in the browser address bar on any Publisher Account page. The URL has the following format:
https://publisher.xsolla.com/<merchant ID>/<Publisher Account section>.
- Mock serverhttps://xsolla.redocly.app/_mock/pt/api/backpack/user-validation
- https://metaframe.xsolla.com/user-validation
- CURL
- Payload
curl -v 'https://your.hostname/your/uri' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Signature 13342703ccaca5064ad33ba451d800c5e823db8f' \
-d '{
"notification_type": "user_validation",
"settings": {
"merchant_id": 111111,
"project_id": 222222
},
"user": {
"id": "test_player_id"
}
}'null
Pedido
Custom project settings.
Merchant ID. You can find this parameter in your Publisher Account:
- in the Company settings > Company section.
- in the URL in the browser address bar on any Publisher Account page. The URL has the following format:
https://publisher.xsolla.com/<merchant ID>/<Publisher Account section>.
The unique identifier for the item. Specified when creating item via API call.
The item's Stock Keeping Unit (SKU) from the Publisher Account. The SKU may only contain lowercase Latin alphanumeric characters, periods, dashes, and underscores.
The item type indicates the category of claimed item.
- Mock serverhttps://xsolla.redocly.app/_mock/pt/api/backpack/move-item-to-game
- https://metaframe.xsolla.com/move-item-to-game
- CURL
- Payload
curl -v 'https://your.hostname/your/uri' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Signature 13342703ccaca5064ad33ba451d800c5e823db8f' \
-d '{
"notification_type": "move_to_game",
"settings": {
"merchant_id": 111111,
"project_id": 222222
},
items": [
{
"id": "0559dd09-76d5-4c87-8218-2951196467fd",
"sku": "virtual-currency-item_test",
"type": "virtual_currency",
"quantity": 10
},
]
"user": {
"id": "test_player_id"
}
}'null