Skip to content

Overview

  • Version: 2.0.0
  • Servers:
    • https://api.xsolla.com/api

Pay Station allows partners to monetize their products by providing users with a convenient UI to pay for in-game purchases in the game store. To set up opening the payment UI, refer to these instructions.

The Pay Station API provides the following groups of calls:

  • Token — includes the API call to generate a token with arbitrary user parameters for further payment processing via the payment UI.
  • Tokenization — includes API calls to securely process payments without opening the payment UI or involving the user.
  • Reports — includes API calls to return data on user transactions, generate reports, and get payouts breakdown by currency.
  • Refund — includes API calls to request full and partial refunds.
  • Testing — includes the API call to test the chargeback process.

You can find detailed information about configuring the payment UI in the Payments solution integration guide.

Note

You can also refer to the Xsolla Base API section in the Postman collection to test API calls used for integration.

Download OpenAPI description
Languages
Servers
https://api.xsolla.com/merchant/v2/
Mock server
https://xsolla.redocly.app/_mock/api/pay-station/
Operations
Operations

Request

Lists saved payment accounts of a given user.

Note

In sandbox mode, this API call works only with test cards that have no 3-D Secure function.

Security
basicAuth
Path
project_idintegerrequired

Project ID.

user_idstringrequired

Unique user ID in the game stored on your side. Make sure you pass the existing user ID. In case an error occurs, refer to the answers to the FAQs.

Query
modestring

Set to sandbox to test the payment process. Remove the parameter to make real payments.

curl -i -X GET \
  -u <username>:<password> \
  'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payment_accounts?mode=string'

Responses

OK.

Bodyapplication/json
Response
application/json
[ { "id": 4612345, "name": "PP_saved_account", "payment_system": {}, "type": "paypal" } ]

Request

Charges a user via a saved payment account.

Note

In sandbox mode, this API call works only with test cards that have no 3-D Secure function.

Notice

For the API call to work correctly, configure a timeout of 2 minutes.

Security
basicAuth
Path
project_idintegerrequired

Project ID.

user_idstringrequired

Unique user ID in the game stored on your side. Make sure you pass the existing user ID. In case an error occurs, refer to the answers to the FAQs.

typestringrequired

Type of payment account.

Enum ValueDescription
card

Bank cards.

amazon

Amazon Pay.

skrill

Skrill Digital Wallet.

paypal

PayPal.

toss

Toss Wallet.

alipayplus_cn

Alipay.

alipayplus_hk

Alipay (Hong Kong).

alipayplus_gcash

GCash.

alipayplus_dana

DANA.

alipayplus_rabbitlinepay

Rabbit LINE pay.

account_idintegerrequired

ID of the saved account in Xsolla database.

Bodyapplication/jsonrequired
userobject

User details.

user.​ipstringrequired

User IP address.

user.​namestring

Username.

user.​legalobject(legal)

Object with legal entity details.

user.​legal.​namestring

Full legal name.

user.​legal.​addressstring

Full legal address.

user.​legal.​vat_idstring

Individual taxpayer identifier.

user.​legal.​countrystring

Country of incorporation. Two-letter uppercase country code per ISO 3166-1 alpha-2 is used.

settingsobject

Object containing purchase settings.

settings.​currencystring(currency)

Preferred payment currency. Three-letter currency code per ISO 4217.

settings.​external_idstring(external_id)

Transaction ID in the game. Has to be unique for each user payment. Refer to documentation for detailed information.

settings.​modestring

Set to sandbox to test out the payment process. Remove the parameter for real payments.

settings.​mock_codeinteger(mock_code)

An error code that you want to reproduce when testing the payment process via PayPal in sandbox mode. It works correctly only if you pass the "mode":"sandbox" parameter.

Enum1002101510391046105710891201120318011803
purchaseobject

Object containing purchase details.

purchase.​descriptionobject
purchase.​description.​valuestring<= 4000 characters
purchase.​virtual_currencyobject

Object containing virtual currency details.

purchase.​virtual_currency.​quantitynumber(float)

Purchase amount in the virtual currency.

purchase.​checkoutobject

Object containing checkout details.

purchase.​checkout.​currencystring

Currency of the purchase. Three-letter currency code per ISO 4217.

purchase.​checkout.​amountnumber(float)

Purchase amount.

custom_parametersobject(custom_parameters)

This object contains parameters to configure anti-fraud filters. The list of parameters is shown below. To add custom parameters, contact your Customer Success Manager or email at csm@xsolla.com.

custom_parameters.​registration_datestring

Account creation date per ISO 8601.

custom_parameters.​total_hoursinteger

Total number of in-game hours.

custom_parameters.​total_charactersinteger

Number of in-game characters.

custom_parameters.​social_networks_addedboolean

Whether the player has connected social media profiles.

custom_parameters.​profile_image_addedboolean

Whether the player has uploaded a profile image.

custom_parameters.​active_datestring

Last seen date per ISO 8601.

custom_parameters.​total_friendsinteger

Number of friends.

custom_parameters.​additional_verificationboolean

Whether the player uses account verification procedures.

custom_parameters.​win_rateinteger

Win rate.

custom_parameters.​last_change_password_datestring

Last password change date per ISO 8601.

custom_parameters.​chat_activityboolean

Whether the player uses the chat function.

custom_parameters.​forum_activityboolean

Whether the player uses the forum function.

custom_parameters.​total_bansinteger

Number of times the player was banned in the chat/forum.

custom_parameters.​profile_completedboolean

Whether the player added additional information to their profile.

custom_parameters.​notifications_enabledboolean

Whether the player enabled notifications.

custom_parameters.​user_levelinteger

Player’s level, reputation, or rank.

custom_parameters.​karma_pointsinteger

Player’s karma.

custom_parameters.​total_sumnumber(float)

Total amount of payments.

custom_parameters.​non_premium_currencynumber(float)

Amount of non-premium currency.

custom_parameters.​total_game_eventsinteger

Number of in-game events the player took part in.

custom_parameters.​total_giftsinteger

Number of in-game gifts the player has sent/received.

custom_parameters.​tutorial_completedboolean

Whether the player has completed the game’s tutorial.

custom_parameters.​completed_tasksinteger

Number of tasks/objectives completed.

custom_parameters.​items_usedboolean

Whether the player uses purchased in-game items.

custom_parameters.​pvp_activityboolean

Whether the player takes part in PvP (Player(s) versus player(s)) battles.

custom_parameters.​total_clansinteger

Number of clans the player is a member of.

custom_parameters.​unlocked_achievementsinteger

Number of achievements unlocked.

custom_parameters.​total_inventory_valuenumber(float)

Total inventory value (in-game currency).

custom_parameters.​character_customizedboolean

Whether the player has customized their character.

custom_parameters.​session_timestring

Average session time per ISO 8601.

curl -i -X POST \
  -u <username>:<password> \
  'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payments/{type}/{account_id}' \
  -H 'Content-Type: application/json' \
  -d '{
    "purchase": {
      "description": {
        "value": "currency purchase"
      },
      "virtual_currency": {
        "quantity": 100
      }
    },
    "settings": {
      "currency": "USD",
      "external_id": "ext123",
      "mode": "sandbox"
    },
    "user": {
      "ip": "111.11.11.11",
      "name": "John Smith",
      "legal": {
        "name": "My Awesome Company",
        "address": "17 Crown Street London SW2 0JW United Kingdom",
        "vat_id": "GB111111111",
        "country": "GB"
      }
    }
  }'

Responses

Created.

Bodyapplication/json
transaction_idinteger
Response
application/json
{ "transaction_id": 123458390 }

Request

Deletes a saved payment account.

Note

In sandbox mode, this API call works only with test cards that have no 3-D Secure function.

Note

You can call this API method in sandbox mode. To do this, pass the test payment account data in the request. Refer to the instruction for more information about sandbox mode access and testing scenarios.

Security
basicAuth
Path
project_idintegerrequired

Project ID.

user_idstringrequired

Unique user ID in the game stored on your side. Make sure you pass the existing user ID. In case an error occurs, refer to the answers to the FAQs.

typestringrequired

Type of payment account.

Enum ValueDescription
card

Bank cards.

amazon

Amazon Pay.

skrill

Skrill Digital Wallet.

paypal

PayPal.

toss

Toss Wallet.

alipayplus_cn

Alipay.

alipayplus_hk

Alipay (Hong Kong).

alipayplus_gcash

GCash.

alipayplus_dana

DANA.

alipayplus_rabbitlinepay

Rabbit LINE pay.

account_idintegerrequired

ID of the saved account in Xsolla database.

curl -i -X DELETE \
  -u <username>:<password> \
  'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/payment_accounts/{type}/{account_id}'

Responses

No Content.

Operations
Operations
Operations