콘텐츠로 건너뛰기

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.

OpenAPI 설명 다운로드
언어
서버
Mock server
https://xsolla.redocly.app/_mock/ko/api/backpack/
https://metaframe.xsolla.com/

Game

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

작업

요청

Creates a game entity for a specified project.

보안
bearer
경로
merchantIdinteger(uint32)필수

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>.
projectIdinteger(uint32)필수

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

헤더
X-HOST-IDstring(uuid)필수

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. Keep X-HOST-ID confidential, as it is part of the authentication key.

본문application/json

A JSON object containing game information.

external_game_idstring

The external identifier uniquely assigned by you to represent the game. Used in other requests to associate items, keys, and currencies with a game. Enables grouping items, keys, and currencies under one game in the Metaframe widget.

game_namestring

The name of the game.

game_image_urlstring

The URL pointing to the image representing the associated game. It's recommended to upload images that weigh no more than 1 MB. This image is displayed to players in the Metaframe widget.

merchant_idinteger(uint32)사용 중단됨필수
project_idinteger(uint32)사용 중단됨필수
curl -i -X POST \
  'https://xsolla.redocly.app/_mock/ko/api/backpack/web/backpack/merchants/{merchantId}/projects/{projectId}/games' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-HOST-ID: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -d '{
    "external_game_id": "string",
    "game_name": "string",
    "game_image_url": "string",
    "merchant_id": 0,
    "project_id": 0
  }'

응답

Game entity was successfully created.

본문application/json
idstring(uuid)필수

The unique identifier for the game.

응답
application/json
{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08" }

요청

Retrieves external IDs and names of the created game entities.

보안
bearer
경로
merchantIdinteger(uint32)필수

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>.
projectIdinteger(uint32)필수

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

헤더
X-HOST-IDstring(uuid)필수

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. Keep X-HOST-ID confidential, as it is part of the authentication key.

curl -i -X GET \
  'https://xsolla.redocly.app/_mock/ko/api/backpack/web/backpack/merchants/{merchantId}/projects/{projectId}/games' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'X-HOST-ID: 497f6eca-6276-4993-bfeb-53cbbbba6f08'

응답

The list of created games was successfully recieved.

본문application/jsonArray [
external_game_idstring

The external identifier uniquely assigned by you to represent the game.

game_namestring

The name of the game.

]
응답
application/json
[ { "external_game_id": "string", "game_name": "string" } ]

요청

Updates game entity details

보안
bearer
경로
merchantIdinteger(uint32)필수

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>.
projectIdinteger(uint32)필수

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

헤더
X-HOST-IDstring(uuid)필수

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. Keep X-HOST-ID confidential, as it is part of the authentication key.

본문application/json필수

A JSON object containing game information.

external_game_idstring필수

The external identifier uniquely assigned by you to represent the game. Used in other requests to associate items, keys, and currencies with a game. Enables grouping items, keys, and currencies under one game in the Metaframe widget.

game_namestring

The name of the game.

game_image_urlstring

The URL pointing to the image representing the game. It's recommended to upload images that weigh no more than 1 MB. This image is displayed to players in the Metaframe widget.

curl -i -X PUT \
  'https://xsolla.redocly.app/_mock/ko/api/backpack/web/backpack/merchants/{merchantId}/projects/{projectId}/games' \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -H 'X-HOST-ID: 497f6eca-6276-4993-bfeb-53cbbbba6f08' \
  -d '{
    "external_game_id": "string",
    "game_name": "string",
    "game_image_url": "string"
  }'

응답

No content.

응답
콘텐츠 없음

Items

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

작업

Webhooks

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

웹훅

Backpack

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

작업