Set up item purchase
Choose the most suitable method for your project to access Xsolla data:
Create order on the client side of application
You can sell both an item with one SKU in any quantity, or a cart of items with different SKUs pre-filled by a user. To create an order with data about a user and items on the Xsolla side, use one of the following API calls:
- Create order with specified item
- Create order with all items from current cart
- Create order with all items from particular cart
The API call used will return a payment token, which is required to open the payment UI and make a payment. To use sandbox mode, pass the “sandbox”: true
parameter in the body of the request for getting a token.
Open payment UI
To open the payment UI in a new window, use the following URL: https://sandbox-secure.xsolla.com/paystation4/?token=TOKEN
, where TOKEN
is the obtained token.
You can also open the payment UI using other options:
- With Pay Station Embed. Limitation: there might be problems when opening it in the in-game browser (WebView).
- In iframe. Limitation: there might be problems when opening it in the in-game browser (WebView) and in the mobile version of your application.
Make test payment
To test the payment process, you can use sandbox mode. Sandbox mode is a standalone environment that supports all features of a live environment, except real and declined payments. You can access sandbox mode by sending “sandbox”: true
when you create an order.
Before you sign a contract with Xsolla, testing the payment process is only available in sandbox mode.
Testing does not require withdrawing money from real bank accounts.
- Open the payment UI in sandbox mode.
- Choose the Bank card payment method.
- Enter the bank card details. In other fields (e.g., name or address), you can enter any data. You can also specify incorrect details (card number or expiration date) to test if an error is generated.
- Click Pay.
In addition to card details, you need to specify the ZIP code if at least one of the following conditions is true:
- The user’s country is the US or Canada.
- The Bank Identification Number (BIN) indicates that a card was issued in the US.
You can specify any valid ZIP code (e.g., 12345). This determines the sales tax rate and does not affect the progress of the test payment.
Sandbox bank card payments can be made in the following currencies: USD, EUR, RUB, GBP, AED, ALL, AMD, ARS, AUD, AZN, BGN, BRL, BYN, CAD, CHF, CLP, CNY, COP, CZK, DKK, DZD, EGP, GEL, HKD, HRK, HUF, IDR, ILS, INR, ISK, JPY, KES, KGS, KRW, KZT, MAD, MDL, MKD, MNT, MXN, MYR, NGN, PEN, PHP, PKR, PLN, RON, RSD, SAR, SEK, SGD, THB, TRY, TWD, UAH, UYU, UZS, VEF, VND, ZAR.
To see detailed information, including fees, about transactions made in sandbox mode:
- Open your Publisher Account.
- Go to Accounting > Transaction registry.
- Check the Show test transactions box.
Additionally, you can see the transactions’ details and request refunds in Publisher Account in the Support > Transaction search section.
Found a typo or other text error? Select the text and press Ctrl+Enter.