Promo codes
How it works
Promo codes are a marketing tool for getting new users and increasing sales. After activating the promo code and paying for the items in the cart, the user receives one of the reward options:
- a discount that applies to the user’s cart
- bonus items:
- virtual currency package
- game key
- virtual item including a bundle or nonrenewing subscription
Main features:
- Choose only a discount, only a bonus item, or both as a reward.
- Decide the number of times the promo code can be used in a campaign.
- Determine the number of promo code redemptions for one user in one campaign.
- Set regional restrictions on demand.
- Generate promo codes multiple times.
- Change the list of items in the cart after using a promo code.
- Apply the discount on the items added to the cart after using a promo code.
Restrictions:
- Users can apply only one promo code to one cart.
- Users can activate a promo code in the cart UI only after they add some items to the cart.
- To get a discount or bonus, the user should pay for the items in the cart.
- If a promo code includes an item with regional sale restrictions, the user from a restricted region can’t get the items linked to this promo code.
User flow:
- The user enters the promo code in the corresponding field in the cart UI.
- The cart’s total is recalculated.
- The user pays for the cart and redeems a promo code by it.
- If the promo code included some bonus items, they are delivered to the user in one of the following ways:
- directly to the inventory (virtual item or a virtual currency package)
- via email (a game key)
- directly to the entitlement system (a game key)
Who can use it
- Partners who have integrated one of the following products (or both):
- Partners who want to increase sales with the help of promo codes.
How to get it
Prerequisites
- Create your Xsolla Publisher Account.
- Connect Store to your project.
Integration flow
- Set up a promotional campaign with promo codes.
- Implement the method of getting a promo code reward.
- Implement the methods of promo code redemption.
Set up campaign with promo codes
- Go to Store > Promotions in Publisher Account and create a promotion.
- Specify necessary parameters:
- Enter the promotion title.
- Choose Promo codes as a promotion type.
- Choose the discount amount for a promo code.
- Choose the bonus product that the user receives when they redeem a promo code. Available options:
- No reward.
- Virtual currency package.
- Game key.
- Virtual item (one or several, including bundles and nonrenewing subscriptions).
- Decide the total number of redemptions and the number of redemptions per user.
- Set the campaign start and end dates.
- Check the settings and save the promotion.
- Go to the promotion editing menu.
- In the Codes menu, choose the method for how the promo codes are generated.
- Generate the promo code or enter it manually.
- Save changes.
- Activate the promotion.
Promo code with a virtual currency package
You should specify the currency package for a virtual currency package promo code. To create a virtual currency package:
- Go to the Virtual currency module settings and specify the following parameters:
- Image
- SKU
- Currency name
- Price of one unit of virtual currency
- Default currency
- Create a required number of currency packages and specify the following parameters for every one of them:
- Image
- SKU
- Name
- Description
- Used currency
- Amount of currency in a package
- Price
- Default currency
- Enable the currency packages to display in Store.
Promo code with a game key
You should specify a game key SKU and DRM selection method for a game key promo code. There are 2 options:
- Generate promo codes for the already set DRM. The parameter is set when generating promo codes.
- Choose a DRM when using a promo code.
Promo code with a virtual item
You should specify the virtual item SKU and its quantity for a virtual items promo code. You can choose one or several items with different SKUs for one promo code including bundles and nonrenewing subscriptions.
Generating promo codes
A campaign may include one or several promo codes. The promo code format has 2 options:
- Manually entered string — suitable for a campaign with only one promo code that can be used many times (maximum is 128 characters).
- Generated string — line of numerals and Latin symbols (10 characters). Suits the campaign with many promo codes.
Regional restrictions
Regional restrictions apply to the whole promotion campaign. The regional restrictions are applied on demand via email to Xsolla.
Get promo code rewards
Implement the call of the
- If the
is_selectable=true value, you should show the form for choosing elements from the unit_items object for everyitem withtype=unit element. In this form, the user chooses only one element for eachunit type.
- http
{
"bonus": [{
"item": {
"sku": "xsollus_gold_edition",
"name": "Xsollus: Gold Edition",
"type": "unit",
"description": null,
"image_url": "https:\/\/cdn3.xsolla.com\/img\/misc\/images\/9541470622d96a821a9a11ea7763ea4c.png",
"unit_items": [{
"sku": "xsollus_gold_edition_steam",
"name": "Xsollus: Gold Edition (steam)",
"type": "game_key",
"drm_name": "Steam",
"drm_sku": "steam"
}, {
"sku": "xsollus_gold_edition_playstation",
"name": "Xsollus: Gold Edition (playstation)",
"type": "game_key",
"drm_name": "Playstation",
"drm_sku": "playstation"
}, {
"sku": "xsollus_gold_edition_xbox",
"name": "Xsollus: Gold Edition (xbox)",
"type": "game_key",
"drm_name": "XBox",
"drm_sku": "xbox"
}, {
"sku": "xsollus_gold_edition_nintendo_eshop",
"name": "Xsollus: Gold Edition (nintendo_eshop)",
"type": "game_key",
"drm_name": "Nintendo Switch eShop",
"drm_sku": "nintendo_eshop"
}]
},
"quantity": 1
}, {
"item": {
"sku": "xsollus_bonus_pack_edition",
"name": "Xsollus: Bonus Pack",
"type": "unit",
"description": null,
"image_url": "https:\/\/cdn3.xsolla.com\/img\/misc\/images\/aa2efd78dfd4e5dda5293f8c8e49af6d.png",
"unit_items": [{
"sku": "xsollus_bonus_pack_edition_steam",
"name": "Xsollus: Bonus Pack (steam)",
"type": "game_key",
"drm_name": "Steam",
"drm_sku": "steam"
}, {
"sku": "xsollus_bonus_pack_edition_origin",
"name": "Xsollus: Bonus Pack (origin)",
"type": "game_key",
"drm_name": "Origin",
"drm_sku": "origin"
}, {
"sku": "xsollus_bonus_pack_edition_drmfree",
"name": "Xsollus: Bonus Pack (drmfree)",
"type": "game_key",
"drm_name": "DRM Free",
"drm_sku": "drmfree"
}, {
"sku": "xsollus_bonus_pack_edition_gog",
"name": "Xsollus: Bonus Pack (gog)",
"type": "game_key",
"drm_name": "GOG",
"drm_sku": "gog"
}, {
"sku": "xsollus_bonus_pack_edition_rockstar",
"name": "Xsollus: Bonus Pack (rockstar)",
"type": "game_key",
"drm_name": "Rockstar Games Launcher",
"drm_sku": "rockstar"
}]
},
"quantity": 3
}],
"discount": {
"percent": null
},
"is_selectable": true
- If
is_selectable=false , you shouldn’t pass additional parameters in the request.
Redeem a promo code
Implement the call of the
- If
is_selectable=true , you should pass the selected_unit_items object in the following format when calling theRedeem promo code method:
- http
selected_unit_items:{
unit_1_sku: "selected_unit_item_sku",
unit_2_sku: "selected_unit_item_sku"
}
Example of the response:
- http
{
{
"items": [
{
"sku": "xsollus_gold_edition_steam",
"name": "Xsollus: Gold Edition (steam)",
"type": "game_key",
"description": null,
"image_url": "https:\/\/cdn3.xsolla.com\/img\/misc\/images\/9541470622d96a821a9a11ea7763ea4c.png",
"attributes": [],
"is_free": true,
"groups": [],
"price": null,
"virtual_prices": [],
"drm_name": "Steam",
"drm_sku": "steam",
"has_keys": false,
"is_pre_order": true,
"release_date": null,
"quantity": 1
},
{
"sku": "xsollus_bonus_pack_edition_origin",
"name": "Xsollus: Bonus Pack (origin)",
"type": "game_key",
"description": null,
"image_url": "https:\/\/cdn3.xsolla.com\/img\/misc\/images\/aa2efd78dfd4e5dda5293f8c8e49af6d.png",
"attributes": [],
"is_free": true,
"groups": [],
"price": null,
"virtual_prices": [],
"drm_name": "Origin",
"drm_sku": "origin",
"has_keys": false,
"is_pre_order": true,
"release_date": null,
"quantity": 3
}
]
}
- If
is_selectable=false , you shouldn’t pass additional parameters in the request.