Sandbox mode

Sandbox mode is a stand-alone environment that supports all the features of a live environment, except real payments. You can use sandbox mode to test:

  • payment widget
  • payee account
  • forms to pass identification procedure (KYC) and a tax interview
  • integration with API

Payment widget

To open a payment widget in sandbox mode:

  1. Get the token. In the request, pass the Authorization:Basic <your_authorization_basic_key> parameter, where <your_authorization_basic_key> is the platform ID: secret key pair, encoded according to the Base64 standard. To find this test data:
    1. Open your project in Publisher Account and go to the Payouts > Settings section.
    2. In the upper-right corner, choose Sandbox from the drop-down list.
    3. Go to the Settings > Security section.

Example of a request for getting a token:

Copy
Full screen
Small screen
    curl -X POST 'https://payouts-sandbox-api.xsolla.com/api/v1/merchants/customer/auth' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Basic <your_authorization_basic_key>' \
    -d '{"email": "<your email>", "name": "<your name>"}'
    
    1. Open sandbox mode following the link https://payouts-sandbox-widget.xsolla.com/?token={token}, where {token} is the token received on step 1.
    Note
    Open the widget using SDKs

    To open the payment widget in sandbox mode, pass the sandbox: true parameter in the script for opening the widget or in the initialization code of the npm-package.

    The script for opening the payment widget:

    Copy
    Full screen
    Small screen
      <script>
          var s = document.createElement('script');
          s.type = "text/javascript";
          s.async = true;
          s.src = "https://static.xsolla.com/payouts/v0/_bundles/santorelli.min.js";
          s.addEventListener('load', function () {
              const widget = new XPayoutsWidget.Widget({
                          token: '<auth token>',
                          theme: 'black',
                          size: 'fixed',
                          sandbox: true
                      });
      
              widget.show('<container_id>');
      
              widget.addEventListener('load', () => {
                  console.log('loaded');
              });
          }, false);
          var head = document.getElementsByTagName('head')[0];
          head.appendChild(s);
      </script>
      

      The initialization code for opening the payment widget:

      Copy
      Full screen
      Small screen
        import {Widget} from '@xsolla/payouts-sdk';
        
        const widget = new Widget({
        	token: '<auth token>',
        	theme: 'black',
        	size: 'fixed',
        	sandbox: true  
        });
        
        widget.show('<container_id>');
        
        widget.addEventListener('load', () => {
        	console.log('loaded');
        });
        

        1. In the widget that opens, check the box for reading and agreeing with the licensing agreement.
        2. In the Verification tab, fill in the fields with test data:
          • name
          • surname
          • middle name (not required)
          • country
          • nationality
        3. If you want to test an unsuccessful scenario, check the box for generating an error when passing an identification procedure (KYC).
        4. Click Send.
        1. In the Tax Interview tab, select a scenario you want to test: a success or an error.
        2. Make a payment using test data.
        Note
        Transactions made in sandbox mode don’t have any effect on the production environment.

        Payee account

        To open a payee account in sandbox mode:

        1. Open your project in Publisher Account and go to the Payouts > Settings section.
        2. In the upper-right corner, choose Sandbox from the drop-down list.

        1. Go to the Users tab and invite yourselves.
        2. In the email you received to your email address, follow the link to the payee account.
        3. In the payee account, choose a merchant and make a payment using test data.
        Note
        You can also go to the sandbox payee account by following the link https://payouts-sandbox.xsolla.com/ and passing the authentication procedure.

        Test data

        Notice
        Any data not included in the list of the test one will not work in sandbox mode.

        Test cards

        Card numberCVCExpiration dateDescription
        4242424242424242Any 3 digitsAny date in the futureSuccessful payment
        4000000000000002Any 3 digitsAny date in the futureUnsuccessful payment

        Test transactions

        IBANOther fieldsDescription
        FI211234569876543210Any dataSuccessful withdrawal
        AT483200000012345864Any dataUnsuccessful withdrawal

        Test email address

        Email addressOther fieldsDescription
        success@xsolla.comAny dataSuccessful withdrawal
        failed@xsolla.comAny dataUnsuccessful withdrawal

        Test phone numbers

        Phone numberOther fieldsDescription
        +1 (555) 123-4567Any dataSuccessful withdrawal
        +1 (555) 987-6543Any dataUnsuccessful withdrawal
        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.
        Rate this page
        Rate this page
        Is there anything we can improve?

        Don’t want to answer

        Thank you for your feedback!
        Last updated: January 22, 2024

        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!