Enable Buy Button via link-outs to Web Shop
Why is it important

Following recent updates to Apple’s policies in certain regions, developers are now permitted to guide users from their apps to external websites to accept payments for virtual items.
You can add visible buttons, banners, messages, and other calls to action that take users directly from your game to item purchase using a secure, browser-based checkout (to your Web Shop or payment UI) in a single click — without violating Apple’s rules or risking enforcement.
Buy Button integration via Web Shop link is a quick, low-code way to enable item-specific purchases from your game using a browser-based checkout. It offers:- A seamless flow — tapping Buy Button opens the Web Shop checkout for a specific item, allowing users to automatically return to the game after a successful payment.
- Support for a wide range of payment methods, including one-click payments via Apple Pay, for fast and familiar mobile checkout.
- Fast setup — if your Web Shop is already set up, you only need to add a link with parameters to the game.
- Instant onboarding — if you don’t have Web Shop yet, you can get started quickly by instantly creating Web Shop, adding payment links to your game, and going live.
This integration option gives you access not only to Buy Button integration, but also to the full Web Shop experience including features like personalization, referral program, loyalty system, promo codes, and more.
Check the integration via Xsolla Mobile SDK if you’re using a custom Web Shop not based on Site Builder and are looking to integrate Pay Station directly into your game.
How it works
- The user opens the app on iOS.
- The user taps the
Buy Button next to the desired item. - The app launches a browser with a Web Shop link that includes the
user-id
,purchase-sku
andredirect-url
parameters. - Web Shop automatically authenticates the user and displays the payment UI for the selected item.
- The user chooses a payment method and completes the purchase.
- The user is automatically redirected back to the game via a deep link.
- The app receives the purchase confirmation via a webhook and delivers the purchased item.
How to get it
Add logic to your iOS app to show the button with purchase link only to users in the United States. To do this, add the button to your game and detect the iOS storefront. If the returned storefront country is the United States (“USA”
), the button with the purchase link should be displayed to the user.
Adding button with purchase link to your game
Before following these instructions, make sure you created an item catalog, set up user authentication, and published Web Shop.
Open the main page of your project in Publisher Account and select the Enable
To implement this scenario, add a button in your game with a link in the following format: https://yourwebshop.xsolla.site/?user-id=<USER_ID>&purchase-sku=<SKU>&redirect-url=<RETURN_TO_GAME_URL>
, where:
yourwebshop.xsolla.site
is a link to your Web Shop site.user-id
is the user ID in your system.purchase-sku
is the SKU of the desired item from the Web Shop catalog.redirect-url
is the URL the user is redirected to after a successful payment. Use any valid URL, such as a deep link (e.g.,mygame://
) that returns the user to the game.
When the user follows this link, they are automatically authorized on Web Shop, and the payment UI for the selected item is displayed.
To find the item SKU (using a virtual item as an example):
- Open your project in Publisher Account, go to Store > Virtual Items section, and click Configure.
- Navigate to the group of items where the item is located.
- Copy the SKU from the line of the specific item below its name.
Detecting iOS storefront
To determine whether you can show “USA”
, enable the functionality to display the
Ensure your implementation is flexible enough to support additional countries in the future, as regulatory conditions and platform policies may change.
Note that the storefront value on the device does not change unless the user explicitly updates their Apple ID region in system settings.
- swift
1let countryCode = await Storefront.current?.countryCode
2let showBuyButton = countryCode == "USA"
Additional features
You can provide users with quick access to the Web Shop features by using query parameters in website links; for example, when promoting a page on social media and in mass mailings. Such links let you automatically authenticate users on your website or redirect them to a specific item when they open the site.
Using query parameters, you can configure the following actions that will be performed when a link is clicked:
- Automatic authentication using the user ID.
- Automatic authentication using the deep link.
- Redirecting to the card of a specific item. If the user is already logged in to the site, they will proceed to purchase the item.
- Automatically applying a promo code to the catalog or redeeming a coupon with a reward.
You can use multiple parameters in a single link, thus combining multiple features.
Setting up authorization via user ID
Use a link with a query parameter for automatic user authorization when navigating to the site. This option is suitable if your site is set up for authorization via User ID.
To automatically authenticate a user via User ID:
- Copy the link to the site.
- At the end of the link, add
?user-id=<UserID>
, where<UserID>
is the user ID to whom you are sending the link.
- Example:
https://webshop-external-demo.xsolla.site/?user-id=12345
- Send individual links to users.
After the user clicks on the link, they will be directed to the site and automatically authenticated.
Setting up authorization via deep link
Use a link with a query parameter for automatic user authorization when navigating to the site. This option is suitable if your site is set up for authentication via a deep link.
To automatically authenticate a user via a deep link:
- Copy the link to the site.
- At the end of the link, add
?deeplink=true
.
- Example:
https://webshop-external-demo.xsolla.site/?deeplink=true
- Share the link in public materials or send individual links to users.
Setting up focus on a specific item
Use a link with a query parameter to redirect the user directly to the desired item when opening the site. For an unauthorized user, a card with information about the item specified in the query parameter will be opened. If the user is already logged in to the site, upon clicking on the link, the payment interface for purchasing the item will open for them.
To direct a user to a specified item:
- Copy the link to the site.
- At the end of the link, add
?purchase-sku=<item SKU>
, where<item SKU>
is the SKU of the desired item.
- To find the item SKU (using a virtual item as an example):
- Open your project in Publisher Account, go to Store > Virtual Items section, and click Configure.
- Navigate to the group where the item is located.
- Copy the SKU from the line of the specific item below its name.
- Example:
https://webshop-external-demo.xsolla.site/?purchase-sku=giant
- Share the link in public materials or send individual links to users.
After the user clicks on the link, they will be directed to the website where the item card with detailed information about the item is displayed, or to the payment interface for purchasing the item. The resulting message depends on whether the user is authenticated on the site.
Setting up application of promo code or coupon
Use a link with a query parameter to apply a promo code or coupon by the user. The code can be applied automatically after navigating to the website or by clicking the Redeem code button. You can also add parameters to the link for one of the authentication methods. To use a link with a code parameter, set up promo codes and coupons in the project.
- Copy the link to the site.
- At the end of the link, add one of the following query parameters:
?redeem-code=<promo code>
— for automatic code redemption?insert-code=<promo code>
— for redemption upon button click
- Instead of
<promo code>
, specify the promo code or coupon that was generated in the Publisher Account or that you have set.
- Example:
https://xsolla.webshop.com/?redeem-code=promo777
- If you want the user to be automatically authenticated on the site, add one of the authentication parameters before the code parameter in the link:
?user-id=<UserID>
or?deeplink=true
.
- Example:
https://webshop-external-demo.xsolla.site/?user-id=12345&redeem-code=TESTCOUPON
- Share the link in public materials or send individual links to users.
Supported URL parameters
Parameter | Description |
---|---|
promo-code | Applies a promo code with a discount or bonus. |
coupon-code | Redeems a reward coupon. |
user-id | User ID. |
purchase-sku | The SKU of the desired item from your Web Shop catalog. |
redirect-url | The URL the user is redirected to after a successful payment. It can be any valid URL, such as a deep link (e.g., mygame:// ) that returns the user to the game. |
Advanced analytics in AppsFlyer
When you use link-outs to allow users to make purchases in the web payment UI directly from the game, you can still track their purchases and measure lifetime value (LTV) with a Mobile Measurement Partner (MMP), such as AppsFlyer. Xsolla supports two integration types to enable seamless tracking of user acquisition, retargeting, and purchase activity across both mobile and web platforms.
Choose a type that best fits your setup to keep full visibility into your campaigns and revenue:
Integration type | How it works |
---|---|
Mobile app S2S integration — allows completion of full LTV and return on advertising spend (ROAS) measurement for the purchases within the application and on Web Shop. |
|
Web SDK integration — allows you to measure and evaluate the effectiveness of user acquisition and retargeting campaigns for attracting traffic to the Web Shop. |
|
Found a typo or other text error? Select the text and press Ctrl+Enter.