Skip to content

Overview

  • Version: 2.0.0
  • Servers: https://store.xsolla.com/api
  • Contact Us by Email
  • Contact URL: https://xsolla.com/
  • Required TLS version: 1.2

Shop Builder API provides a third-party solution for implementing the server side for your store interface. Use the endpoints to manage in-game items, in-game currencies, cart, player inventory, promotions, game library, etc.

Download OpenAPI description
Languages
Servers
Mock server
https://xsolla.redocly.app/_mock/api/shop-builder/
https://store.xsolla.com/api/
Operations

Personalized catalog

This API allows to specify rules for user attributes. If the user meets all conditions for a concrete rule, personalized items will be shown.

For personalized promotions see Promotions section.

To pass attributes before a purchase, you can use Xsolla Login API or pass them into user.attributes property while generating token using Pay Station API.

Operations
Operations
Operations
Operations
Operations
Operations
Operations

Create payment token for purchaseServer-side

Request

Generates an order and a payment token for it. The order is generated based on the items passed in the request body.

To open the payment UI in a new window, use the following link: https://secure.xsolla.com/paystation4/?token={token}, where {token} is the received token.

For testing purposes, use this URL: https://sandbox-secure.xsolla.com/paystation4/?token={token}.

Notice

user.country.value parameter is used to select a currency for the order. If user's country is unknown, providing the user's IP in X-User-Ip header is an alternative option.
One of these two options is required for the correct work of this method.
The selected currency is used for payment methods at Pay Station.
Security
basicAuth
Path
project_idintegerrequired

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

Example: 44056
Bodyapplication/json
sandboxboolean(Cart-Payment_settings_sandbox)

Set to true to test out the payment process. In this case, use https://sandbox-secure.xsolla.com to access the test payment UI.

Default false
userobject(Cart-Payment_admin-user-request-body)required
user.​idobjectrequired
user.​id.​valuestring[ 1 .. 255 ] characters

User ID. For testing, you can pass any value. To accept real payments, you need to use the user ID value from your system. This ID is passed in the User validation webhook.

user.​nameobject
user.​emailobject
user.​countryobject
user.​ageinteger

User age.

user.​phoneobject
user.​tracking_idobject
user.​steam_idobject
user.​is_legalboolean

Whether the user is a legal entity.

user.​legalobject

Object with legal entity details. Object and all its parameters are required if user.is_legal is true.

purchaseobject(Cart_admin_payment)required
purchase.​itemsArray of objectsnon-emptyrequired
purchase.​items[].​skustringnon-emptyrequired

Unique item ID. The SKU may contain only lowercase and uppercase Latin alphanumeric characters, periods, dashes, and underscores.

Example: "t-shirt"
purchase.​items[].​quantitynumber>= 1required

Quantity of the item.

Example: 2
promo_codestring(Promotions_coupon_code)[ 1 .. 128 ] characters^[a-zA-Z0-9]+$

Unique case sensitive code. Contains letters and numbers.

Default "WINTER2021"
Example: "WINTER2021"
settingsobject

Settings for configuring payment process and the payment UI for a user.

custom_parametersobject or null(Cart-Payment_custom_parameters)[ 1 .. 200 ] properties

Your custom parameters represented as a valid JSON set of key-value pairs.
You can pass additional parameters through this field to configure anti-fraud filters. See Pay Station documentation.

Example: {"custom_parameters":{"string_param":"example","bool_param":true,"int_param":100,"null_param":null}}
curl -i -X POST \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/api/shop-builder/v3/project/44056/admin/payment/token \
  -H 'Content-Type: application/json' \
  -d '{
    "user": {
      "id": {
        "value": "user-id"
      },
      "name": {
        "value": "user-name"
      },
      "email": {
        "value": "user@xsolla.com"
      },
      "country": {
        "value": "US",
        "allow_modify": false
      }
    },
    "purchase": {
      "items": [
        {
          "sku": "com.xsolla.cup01",
          "quantity": 2
        },
        {
          "sku": "com.xsolla.t-shirt01",
          "quantity": 1
        },
        {
          "sku": "com.xsolla.cup01",
          "quantity": 1
        },
        {
          "sku": "com.xsolla.hat01",
          "quantity": 1
        }
      ]
    },
    "settings": {
      "language": "de",
      "external_id": "AABBCCDD01",
      "currency": "USD",
      "payment_method": 1380,
      "return_url": "https://developers.xsolla.com/",
      "ui": {
        "theme": "63295aab2e47fab76f7708e3"
      }
    }
  }'

Responses

Successfully created payment token and order.

Bodyapplication/json
tokenstring

Payment token.

order_idinteger

Order ID.

Example: 1
Response
application/json
{ "token": "huooAqbXBSJxB8Q4dYBqJp4ybiInqsPb", "order_id": 12345 }
Operations
Operations
Operations
Operations
Operations

Catalog

This API allows getting any kind of sellable items or specific item.

Operations
Operations
Operations
Operations
Operations
Operations

Coupons

This API allows to you to manage coupons.

Operations

Promo codes

This API allows to manage promo codes.

Operations

Unique catalog offers

This API allows to you to manage unique catalog offers.

Operations

Discounts

This API allows to you to manage discount promotions.

Operations

Bonuses

This API allows to manage bonus promotions.

Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations
Operations