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

Remove promo code from cartClient-side

Request

Removes a promo code from a cart. After the promo code is removed, the total price of all items in the cart will be recalculated without bonuses and discounts provided by a promo code.

Security
AuthForCart
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
cartobject or null
curl -i -X PUT \
  https://xsolla.redocly.app/_mock/api/shop-builder/v2/project/44056/promocode/remove \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "cart": {
      "id": "current"
    }
  }'

Responses

Promo code is successfully canceled.

Bodyapplication/json
cart_idstring

Cart ID.

Example: "cart_id"
priceobject or null

Cart price.

Example: {"amount":"6150.0000000000000000","amount_without_discount":"6150.0000000000000000","currency":"USD"}
is_freeboolean(value-is_free)

If true, the item is free.

Default false
Example: false
itemsArray of objects
Example: [{"attributes":[],"description":"Take it, take it all! All of Xsolla's riches in one Mega Booster.","groups":[{"external_id":"powerups","name":"Power Ups"}],"image_url":"https://cdn.xsolla.net/img/misc/images/e9f2f4a634bc96ea03b5d5ceadd7c55f.png","is_free":false,"name":"Xsolla Booster Mega","price":{"amount":"50.0000000000000000","amount_without_discount":"100.0000000000000000","currency":"USD"},"quantity":123,"sku":"com.xsolla.booster_mega_1","type":"virtual_good","virtual_item_type":"consumable","virtual_prices":[],"promotions":[{"name":"Bonus promotion","date_start":"2020-04-15T16:16:00+03:00","date_end":"2026-04-15T16:16:00+03:00","discount":{"percent":"50.00"},"bonus":[{"quantity":1,"name":"Xsolla Minigun","image_url":"https://cdn.xsolla.net/img/misc/images/2fc5c491a47413a8e8000447889093c2.png","sku":"com.xsolla.minigun_1","type":"virtual_good"}]}],"can_be_bought":true,"vp_rewards":[{"item_id":175232,"sku":"com.xsolla.value_point_1","amount":130,"name":"Value point","image_url":"https://cdn3.xsolla.com/img/misc/images/54c0cf9d345817cdacfdde198db178e0.jpg"},{"item_id":186321,"sku":"com.xsolla.clan_value_point_1","amount":50,"name":"Clan Reward VP 1","image_url":"https://cdn3.xsolla.com/img/misc/images/54c0cf9d345817cdacfdde198db178e0.jpg","is_clan":true}],"limits":{"per_user":{"available":3,"recurrent_schedule":{"interval_type":"weekly","reset_next_date":1746057600},"total":5}},"periods":[{"date_from":"2020-08-11T10:00:00+03:00","date_until":"2020-08-11T20:00:00+03:00"}]}]
Response
application/json
{ "cart_id": "cart_id", "is_free": false, "items": [ {} ], "price": { "amount": "6150.0000000000000000", "amount_without_discount": "6150.0000000000000000", "currency": "USD" } }

Request

Gets promo code rewards by its code. Can be used to allow users to choose one of many items as a bonus. The usual case is choosing a DRM if the promo code contains a game as a bonus (type=unit).

Security
XsollaLoginUserJWT
Path
project_idintegerrequired

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

Example: 44056
promocode_codestring[ 1 .. 128 ] charactersrequired

Unique case sensitive code. Contains letters and numbers.

Example: SO6rew99j9
curl -i -X GET \
  https://xsolla.redocly.app/_mock/api/shop-builder/v2/project/44056/promocode/code/SO6rew99j9/rewards \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>'

Responses

List of promo code rewards was successfully received.

Bodyapplication/json
bonusArray of objects(Promotions_200-promo-code-bonus-reward)
discountobject or null(Promotions_200-coupon-discount-reward)

Percent discount. The price of cart will be decreased using a value calculated by using this percent and then rounded to 2 decimal places.

discounted_itemsArray of objects or null(Promotions_discounted_items)

List of items that are discounted by a promo code.

is_selectableboolean

If true, the user should choose the bonus before redeeming a promo code.

Response
application/json
{ "bonus": [ {}, {} ], "discount": { "percent": "10.00" }, "is_selectable": true, "discounted_items": [ {} ] }

Create promo code promotionServer-sideAdmin

Request

Creates a promo code promotion.

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
external_idstring(Promotions_coupon-external_id)required

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

Default "coupon_external_id"
Example: "coupon_external_id"
promotion_periodsArray of objects(promotion_periods)

Promotion validity periods. If multiple periods are specified, both date_from and date_until are required.

nameobject(Promotions_coupon_name)required

Name of promotion. Should contain key/value pairs where key is a locale with "^[a-z]{2}-[A-Z]{2}$" format, value is string.

Default {"en-US":"Coupon title","de-DE":"Gutscheintitel"}
Example: {"en-US":"Coupon title","de-DE":"Gutscheintitel"}
name.​property name*stringadditional property
bonusArray of objects or null(Promotions_coupon_bonus)
redeem_total_limitinteger or null(Promotions_coupon-redeem_total_limit)

Limits total numbers of coupons.

Default 10
Example: 10
redeem_user_limitinteger or null(Promotions_coupon-redeem_user_limit)

Limits total numbers of coupons redeemed by single user.

Default 10
Example: 10
redeem_code_limitinteger or null(Promotions_redeem_code_limit)

Number of redemptions per code.

Default 10
Example: 10
discountobject or null
Example: {"percent":"10.10"}
discounted_itemsArray of objects or null(Promotions_discounted_items)

List of items that are discounted by a promo code.

attribute_conditionsArray of type = string (object) or type = number (object) or type = date (object)(promotion_user-attribute_conditions_model-post)[ 1 .. 100 ] items

Conditions for validating user attributes. Determine promotion availability based on whether user attributes match all specified conditions.

price_conditionsArray of objects or null(price_conditions_promocode)

Array of objects with conditions that set the price range for applying the promotion to the entire cart.
The total price of all items in the user's cart is compared with the price range specified in the condition. Bonuses and discounts are applied to all items in the cart if the price of the cart meets the specified condition.
If you pass this array, set the value of the discounted_items array to null.

item_price_conditionsArray of objects or null(item_price_conditions_promocode)

Array of objects with conditions that set the price range for applying the promotion to certain items in the cart.
The price of each item in the user's cart is compared with the price range specified in the condition. Bonuses and discounts are applied only to those items in the cart whose price meets the condition.
If you pass this array, set the value of the discounted_items array to null.

excluded_promotionsArray of integers(excluded_promotions)

List of promotion IDs to exclude when applying this promotion.
Example: [12, 789]

Example: [12,789]
curl -i -X POST \
  -u <username>:<password> \
  https://xsolla.redocly.app/_mock/api/shop-builder/v3/project/44056/admin/promocode \
  -H 'Content-Type: application/json' \
  -d '{
    "external_id": "promo_code_external_id",
    "promotion_periods": [
      {
        "date_from": "2020-04-15T18:16:00+05:00",
        "date_until": "2020-04-25T18:16:00+05:00"
      },
      {
        "date_from": "2020-05-15T18:16:00+05:00",
        "date_until": "2020-05-25T18:16:00+05:00"
      }
    ],
    "name": {
      "en-US": "New Year Bonus",
      "de-DE": "Neujahrsbonus"
    },
    "redeem_total_limit": 100,
    "redeem_user_limit": 1,
    "redeem_code_limit": 1,
    "bonus": [
      {
        "sku": "com.xsolla.elven_sword_1",
        "quantity": 1
      },
      {
        "sku": "com.xsolla.elven_shield_1",
        "quantity": 2
      },
      {
        "sku": "com.xsolla.elven_gloves_1",
        "quantity": 2
      }
    ]
  }'

Responses

Promo code was successfully created.

Bodyapplication/json
external_idstring(Promotions_coupon-external_id)

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

Default "coupon_external_id"
Example: "coupon_external_id"
Response
application/json
{ "external_id": "coupon_external_id" }

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