Skip to content

Overview

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:

  1. The user visits the distribution site.
  2. The user logs in through the Xsolla account in the Metaframe widget.
  3. The user purchases the item or gets it for free and selects the option to move the item to the Backpack.
  4. Information about the received item is transferred to the Backpack.
  5. In the Metaframe widget or Xsolla Wallet, the user opens the Backpack section and selects the item.
  6. The user receives the item.
  7. Information about the received item is transferred to the game.

Features

  • 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.

Getting Started

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.

Key Entities

Backpack revolves around three major entities:

  1. Items: The core entities that can be distributed to users.
  2. Game: The entity designed to combine items.
  3. Backpack: The entity designed to to grant user items in the game.

Authorization

To interact with the Backpack API, you need to set up authorization.

For authorization, you have to provide 2 kinds of headers:

  1. X-HOST-ID header.
  2. Authorization header.

X-HOST-ID header

It is a unique header issued by Xsolla. To obtain it, please contact the integration team at integration@xsolla.com or your Customer Success Manager at csm@xsolla.com. Provide them with the project ID and merchant ID.

You can find the merchant ID parameter in your Publisher Account:

  • in the Project settings > Webhooks section.
  • 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>.

You can find the project ID parameter in your Publisher Account next to the name of the project.

Note

Keep X-HOST-ID confidential, as it is part of the authentication key.

Authorization header

Set up user authentication via Xsolla account on Xsolla Wallet by following this guide. This process involves actions in the Publisher Account and assistance from our integration team.

Once the Xsolla account client is set up, use this endpoint to generate a token. The token is valid for 1 hour, after which you'll need to invoke the endpoint again for a new token.

Use the obtained token by providing the Authorization header with the Bearer token string.

Webhooks

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:

  1. Open your project in the Publisher Account.
  2. Click Project settings in the side menu and navigate to Webhooks.
  3. Specify the URL where you want to receive webhooks in the https://example.com format.
  4. A secret key to sign project webhooks is generated by default. To generate a new secret key, click the refresh icon.
  5. 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.

Download OpenAPI description
Languages
Servers
Mock server
https://xsolla.redocly.app/_mock/api/backpack/
https://metaframe.xsolla.com/

Game

Operations related to creating and updating game entities. Game entities are used to combine and sort items.

Operations

Items

Operations for creating, managing, and distributing items to users via Backpack. Items are the core entities associated with games.

Operations

Webhooks

Various events and notifications related to Backpack functionality, such as player validations and item redemptions.

Webhooks

Backpack

Endpoints for granting users items from their Backpack, including game keys, virtual items, and virtual currency.

Operations

Request

Returns the list of items from user's Backpack. Items can be game keys, virtual items, and virtual currency.

Security
bearer
Query
offsetinteger(uint32)

Number of the element from which the list is generated (the count starts from 0).

Default 0
limitinteger(uint32)

Limit for the number of elements on the page.

Default 50
groupstring

Field by which items should be grouped.

Example: group=game_name
item_typeArray of strings

Type of the item.

Items Enum"game_key""virtual_item""virtual_currency""promo_code"
curl -i -X GET \
  'https://xsolla.redocly.app/_mock/api/backpack/web/backpack/items?offset=0&limit=50&group=game_name&item_type=game_key' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

The list of items from users's Backpack was succesfully recieved.

Bodyapplication/json
One of:
<= 100 items
Array [
item_idstringrequired

The unique identifier for the item. Specified when creating item via API call.

item_skustringrequired

The item's Stock Keeping Unit (SKU) from the Publisher Account. The SKU may only contain lowercase Latin alphanumeric characters, periods, dashes, and underscores.

item_namestringrequired

The item's name from the Publisher Account. Currently, only English names are supported, and this information is displayed to the user in the Metaframe widget.

image_urlstringrequired

The URL pointing to the item's image, which is displayed to the user in the Metaframe widget.

Note

An image should have an aspect ratio of 8 x 3, meaning that the width to height ratio should be approximately 2.67 (e.g., width = 400 px and height = 150 px). In this case, the image scales with minimal cropping at the edges, so the content remains visible. Optimum minimal resolution is 620 x 233 px (1240 x 466 px for Retina display).
image_proxy_urlstring or nullrequired

The URL pointing to the image of the item in the proxy storage, which is displayed to the player in the Metaframe widget. This URL allows you to resize the image by passing the dimensions to the URL as parameters.

descriptionstring or null

The item's description from the Publisher Account. Currently, only English descriptions are supported, and this information is displayed to the user in the Metaframe widget.

project_idinteger(uint32)required

The Publisher Account project ID associated with the item.

merchant_idinteger(uint32)required

The Publisher Account ID associated with the item.

item_typestringrequired

The item type indicates the category of claimed item.

Enum"game_key""promo_code""virtual_item""virtual_currency"
pricenumberrequired

The price of the virtual currency item in the specified currency (currency parameter). This value represents the cost of acquiring the specified amount of virtual currency. For example, if the price is 10.99 and the currency is USD, it means the cost to obtain the associated amount of virtual currency is $10.99.

currencystringrequired

The currency which prices are displayed in (USD by default). Three-letter currency code per ISO 4217.

Default "USD"
promo_codestringrequired

Unique case sensitive code that user can redeem in the game to recieve the item. Contains letters and numbers.

codestringrequired

The game key associated with the item.

game_namestringrequired

The name of the game associated with the item. Refer to endpoints under the Game tag for additional details.

external_game_idstringrequired

The external identifier uniquely assigned by you to represent the game. Refer to endpoints under the Game tag for additional details.

Note

It's recommended to specify it, so that all items associated with the same game would be sorted by the game in the Metaframe widget.
created_atstringrequired

The timestamp indicates the moment in which the item is claimed by user.

item_statusstringrequired

The item status shows stage of item. In this case, the item status will be claimed.

quantityinteger(uint32)required

Item quantity.

is_external_vcbooleanrequired

Whether the virtual currency is partners' currency or Xsolla currency.

platformstring(Platform)required

The game platform associated with the item. If specified, the user needs to link their game platform account to Backpack to get the item.

Value"steam"
]
Response
application/json
[ { "item_id": "item123", "item_sku": "sku_item_001", "item_name": "Magic Sword Game Key", "image_url": "https://example.com/images/item123.png", "image_proxy_url": "https://proxy.example.com/images/item123.png?w=620&h=233", "description": "A powerful sword with magical properties.", "project_id": 12345, "merchant_id": 98765, "item_type": "game_key", "price": null, "currency": "USD", "promo_code": "", "code": "ABC123-DEF456-GHI789", "game_name": "Epic Adventure", "external_game_id": "game_456", "created_at": "2023-10-24T14:53:00Z", "item_status": "claimed", "quantity": 1, "is_external_vc": false, "platform": "steam" }, { "item_id": "item456", "item_sku": "sku_item_002", "item_name": "Healing Potion", "image_url": "https://example.com/images/item456.png", "image_proxy_url": "https://proxy.example.com/images/item456.png?w=620&h=233", "description": "Restores 50% of health.", "project_id": 12345, "merchant_id": 98765, "item_type": "virtual_item", "price": 5.99, "currency": "USD", "promo_code": "", "code": "", "game_name": "Epic Adventure", "external_game_id": "game_456", "created_at": "2023-10-24T14:55:00Z", "item_status": "claimed", "quantity": 0, "is_external_vc": false, "platform": "" } ]

Request

Returns a specified item from the user's Backpack. The item can be a game key, a virtual item and a virtual currency.

Security
bearer
Path
itemIdstring(uuid)required

The unique identifier for the item. Specified when creating item via API call.

curl -i -X GET \
  'https://xsolla.redocly.app/_mock/api/backpack/web/backpack/items/{itemId}' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

The details of a specified item from user's Backpack was seccessfully recieved.

Bodyapplication/json
item_idstringrequired

The unique identifier for the item. Specified when creating item via API call.

item_skustringrequired

The item's Stock Keeping Unit (SKU) from the Publisher Account. The SKU may only contain lowercase Latin alphanumeric characters, periods, dashes, and underscores.

item_namestringrequired

The item's name from the Publisher Account. Currently, only English names are supported, and this information is displayed to the user in the Metaframe widget.

image_urlstringrequired

The URL pointing to the item's image, which is displayed to the user in the Metaframe widget.

Note

An image should have an aspect ratio of 8 x 3, meaning that the width to height ratio should be approximately 2.67 (e.g., width = 400 px and height = 150 px). In this case, the image scales with minimal cropping at the edges, so the content remains visible. Optimum minimal resolution is 620 x 233 px (1240 x 466 px for Retina display).
image_proxy_urlstring or nullrequired

The URL pointing to the image of the item in the proxy storage, which is displayed to the player in the Metaframe widget. This URL allows you to resize the image by passing the dimensions to the URL as parameters.

descriptionstring or null

The item's description from the Publisher Account. Currently, only English descriptions are supported, and this information is displayed to the user in the Metaframe widget.

project_idinteger(uint32)required

The Publisher Account project ID associated with the item.

merchant_idinteger(uint32)required

The Publisher Account ID associated with the item.

item_typestringrequired

The item type indicates the category of claimed item.

Enum"game_key""promo_code""virtual_item""virtual_currency"
pricenumberrequired

The price of the virtual currency item in the specified currency (currency parameter). This value represents the cost of acquiring the specified amount of virtual currency. For example, if the price is 10.99 and the currency is USD, it means the cost to obtain the associated amount of virtual currency is $10.99.

currencystringrequired

The currency which prices are displayed in (USD by default). Three-letter currency code per ISO 4217.

Default "USD"
promo_codestringrequired

Unique case sensitive code that user can redeem in the game to recieve the item. Contains letters and numbers.

codestringrequired

The game key associated with the item.

game_namestringrequired

The name of the game associated with the item. Refer to endpoints under the Game tag for additional details.

external_game_idstringrequired

The external identifier uniquely assigned by you to represent the game. Refer to endpoints under the Game tag for additional details.

Note

It's recommended to specify it, so that all items associated with the same game would be sorted by the game in the Metaframe widget.
created_atstringrequired

The timestamp indicates the moment in which the item is claimed by user.

item_statusstringrequired

The item status shows stage of item. In this case, the item status will be claimed.

quantityinteger(uint32)required

Item quantity.

is_external_vcbooleanrequired

Whether the virtual currency is partners' currency or Xsolla currency.

platformstring(Platform)required

The game platform associated with the item. If specified, the user needs to link their game platform account to Backpack to get the item.

Value"steam"
Response
application/json
{ "item_id": "string", "item_sku": "string", "item_name": "string", "image_url": "string", "image_proxy_url": "string", "description": "string", "project_id": 0, "merchant_id": 0, "item_type": "game_key", "price": 0, "currency": "USD", "promo_code": "string", "code": "string", "game_name": "string", "external_game_id": "string", "created_at": "string", "item_status": "string", "quantity": 0, "is_external_vc": true, "platform": "steam" }

Move user's virtual currency to game

Request

Grants the user virtual currency from Backpack in the game.

Security
bearer
Bodyapplication/json
item_idstringrequired

The unique identifier for the item. Specified when creating item via API call.

user_game_idstringrequired

The external identifier uniquely assigned to the game. Refer to endpoints under the Game tag for additional details.

curl -i -X POST \
  https://xsolla.redocly.app/_mock/api/backpack/web/backpack/virtual_currency/move_to_game \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "item_id": "string",
    "user_game_id": "string"
  }'

Responses

The user was successfully granted virtual currency in the game.

Response
No content

Moves user's virtual currency to Xsolla Wallet

Request

Grants the user virtual currency from Backpack in Xsolla Wallet.

Security
bearer
Bodyapplication/json
item_idstringrequired

The unique identifier for the item. Specified when creating item via API call.

curl -i -X POST \
  https://xsolla.redocly.app/_mock/api/backpack/web/backpack/virtual_currency/receive \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "item_id": "string"
  }'

Responses

The user was successfully granted virtual currency in Xsolla Wallet.

Response
No content

Request

Grants the user virtual item from Backpack in the game.

Security
bearer
Bodyapplication/json
item_idstringrequired

The unique identifier for the item. Specified when creating item via API call.

user_game_idstringrequired

The external identifier uniquely assigned to the game. Refer to endpoints under the Game tag for additional details.

curl -i -X POST \
  https://xsolla.redocly.app/_mock/api/backpack/web/backpack/virtual_items/move_to_game \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "item_id": "string",
    "user_game_id": "string"
  }'

Responses

The user was successfully granted virtual item in the game.

Response
No content