User age.
Catalog API (2.0.0)
- Version: 2.0.0
- Servers:
https://store.xsolla.com/api - Contact Us by Email
- Contact URL: https://xsolla.com/
- Required TLS version: 1.2
Catalog API provides endpoints to manage your in-game store catalog and process purchases. Use the endpoints to configure virtual items, virtual currencies, game keys, bundles, cart and payment flows, item attributes, and import items from external sources.
Request
Generates an order and a payment token for it. The order is generated based on the items passed in the request body.
To open the payment UI in a new window, use the following link: https://secure.xsolla.com/paystation4/?token={token}, where {token} is the received token.
For testing purposes, use this URL: https://sandbox-secure.xsolla.com/paystation4/?token={token}.
user.country.value parameter is used to select a currency for the order. If user's country is unknown,
providing the user's IP in X-User-Ip header is an alternative option. One of these two options is required for the correct work of this method.
The selected currency is used for payment methods at Pay Station.
Project ID. You can find this parameter in your Publisher Account next to the name of the project.
Set to true to test out the payment process. In this case, use https://sandbox-secure.xsolla.com to access the test payment UI.
User ID. For testing, you can pass any value. To accept real payments, you need to use the user ID value from your system. This ID is passed in the User validation webhook.
Unique case sensitive code. Contains letters and numbers.
Your custom parameters represented as a valid JSON set of key-value pairs.
You can pass additional parameters through this field to configure anti-fraud filters. See Pay Station documentation.
- Mock serverhttps://xsolla.redocly.app/_mock/api/catalog/v3/project/{project_id}/admin/payment/token
- https://store.xsolla.com/api/v3/project/{project_id}/admin/payment/token
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
-u <username>:<password> \
https://xsolla.redocly.app/_mock/api/catalog/v3/project/44056/admin/payment/token \
-H 'Content-Type: application/json' \
-d '{
"user": {
"id": {
"value": "user-id"
},
"name": {
"value": "user-name"
},
"email": {
"value": "user@xsolla.com"
},
"country": {
"value": "US",
"allow_modify": false
}
},
"purchase": {
"items": [
{
"sku": "com.xsolla.cup01",
"quantity": 2
},
{
"sku": "com.xsolla.t-shirt01",
"quantity": 1
},
{
"sku": "com.xsolla.cup01",
"quantity": 1
},
{
"sku": "com.xsolla.hat01",
"quantity": 1
}
]
},
"settings": {
"language": "de",
"external_id": "AABBCCDD01",
"currency": "USD",
"payment_method": 1380,
"return_url": "https://developers.xsolla.com/",
"ui": {
"theme": "63295aab2e47fab76f7708e3"
}
}
}'{ "token": "huooAqbXBSJxB8Q4dYBqJp4ybiInqsPb", "order_id": 12345 }