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.

Note
To enable Apple Pay in Web Shop, make sure your domain is allowlisted (refer to the setup instructions) and contact the Xsolla integration team at integration@xsolla.com. Alternatively, the Xsolla Mobile SDK enables Apple Pay by default.
Notice
Buy Button is currently available only on iOS, and only for users in the United States. We are actively monitoring regulatory developments in other regions and on other platforms, and will share updates as they become available.

How it works

  1. The user opens the app on iOS.
  2. The user taps the Buy Button next to the desired item.
  3. The app launches a browser with a Web Shop link that includes the user-id, purchase-sku and redirect-url parameters.
  4. Web Shop automatically authenticates the user and displays the payment UI for the selected item.
  5. The user chooses a payment method and completes the purchase.
  6. The user is automatically redirected back to the game via a deep link.
  7. 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

Note

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 Buy Button via link-outs to Web Shop focus to view related settings, or refer to the relevant sections of Web Shop documentation for detailed information.

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.

Note
An item added to the catalog can be purchased from the game, even if it’s not displayed on Web Shop. The availability allows you to sell exclusive or limited offers that are not visible on the main storefront but are accessible via a direct link.

To find the item SKU (using a virtual item as an example):

  1. Open your project in Publisher Account, go to Store > Virtual Items section, and click Configure.
  2. Navigate to the group of items where the item is located.
  3. Copy the SKU from the line of the specific item below its name.

Detecting iOS storefront

To determine whether you can show Buy Button, retrieve the storefront information at the initial app launch after installation, or on subsequent launches if needed. The storefront may already be available as part of your existing StoreKit implementation or provided by your Mobile Measurement Partner (MMP). If the storefront’s country code is “USA”, enable the functionality to display the Buy Button.

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.

Copy
Full screen
Small screen
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:

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:

  1. Copy the link to the site.
  2. 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

  1. Send individual links to users.

After the user clicks on the link, they will be directed to the site and automatically authenticated.

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:

  1. Copy the link to the site.
  2. At the end of the link, add ?deeplink=true.
  • Example: https://webshop-external-demo.xsolla.site/?deeplink=true
  1. 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 site and automatically authenticated.

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:

  1. Copy the link to the site.
  2. 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):
    1. Open your project in Publisher Account, go to Store > Virtual Items section, and click Configure.
    2. Navigate to the group where the item is located.
    3. Copy the SKU from the line of the specific item below its name.
  • Example: https://webshop-external-demo.xsolla.site/?purchase-sku=giant
  1. 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.

Note
Only an authenticated user can apply the code. If the user is not logged in to the site, a modal window for authentication opens after the link is clicked.
To apply the code:
  1. Copy the link to the site.
  2. 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
  1. Instead of <promo code>, specify the promo code or coupon that was generated in the Publisher Account or that you have set.
  1. Example: https://xsolla.webshop.com/?redeem-code=promo777
  1. 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.
  1. Example: https://webshop-external-demo.xsolla.site/?user-id=12345&redeem-code=TESTCOUPON
  1. Share the link in public materials or send individual links to users.
After the authenticated user clicks on the link, they will be directed to the site, where the code will be activated automatically or the user will have the option to manually redeem the code.

Supported URL parameters

ParameterDescription
promo-codeApplies a promo code with a discount or bonus.
coupon-codeRedeems a reward coupon.
user-idUser ID.
purchase-skuThe SKU of the desired item from your Web Shop catalog.
redirect-urlThe 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 typeHow 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.
  1. Xsolla sends information about purchases in Web Shop to AppsFlyer as mobile in-app events.
  2. AppsFlyer attributes events to the number of mobile application installments, user acquisition and re-engagement campaigns.
Web SDK integration — allows you to measure and evaluate the effectiveness of user acquisition and retargeting campaigns for attracting traffic to the Web Shop.
  1. Xsolla sends information about purchases in Web Shop to AppsFlyer as web events.
  2. AppsFlyer attributes events to the corresponding media source, campaign, advertising set, and advertisement that led the user to the purchase.
Note
Refer to the instructions on integration with AppsFlyer for detailed information.
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Last updated: July 7, 2025

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!
We couldn't send your feedback
Try again later or contact us at doc_feedback@xsolla.com.