Publisher Account API v2.0

Overview

The section describes methods for working with Publisher Account. Use basic authentication to call methods.

Endpoint path: https://api.xsolla.com.

Projects

Create Project

Creates a new project.

HTTP REQUEST

POST https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/projects

Parameter Type Description
merchant_id
integer Merchant ID.
descriptor
string Short project name for reports (up to 12 characters).
name
array of strings Array of localized project names.
url
string Project website URL.
description
string Array of localized project descriptions.
payment_url
string Webhook URL.
key
string Project secret key.
return_url
string URL to redirect the user to after a successful payment.
user_billing_enabled
boolean Whether to keep user data in the Xsolla database.
show_user_in_paystation
boolean Whether to show the user’s saved payment accounts and payment history in the payment UI.
locale_list
array of strings List of languages that corresponding settings are localized to.
user_public_id_enabled
boolean Enables user details verification via Public User ID (for payments through cash kiosks).
components
object Module details (object).
components.virtual_currency
object Virtual currency module details (object).
components.virtual_currency.enabled
boolean Whether to enable the module for this project.
components.virtual_currency.custom_name
array of strings Localized module names to show in the payment UI.
components.items
object Virtual items module details (object).
components.items.enabled
boolean Whether to enable the module for this project.
components.items.custom_name
array of strings Localized module names to show in the payment UI.
components.simple_checkout
object Simple checkout module details (object).
components.simple_checkout.enabled
boolean Whether to enable the module for this project.
components.simple_checkout.custom_name
array of strings Localized module names to show in the payment UI.
components.subscriptions
object Subscriptions module details (object).
components.subscriptions.enabled
boolean Whether to enable the module for this project.
components.subscriptions.custom_name
array of strings Localized module names to show in the payment UI.
send_json_to_paystation
boolean Enables tokenless integration.
is_external_id_required
boolean Whether External ID is required for integration with Xsolla.
ipn_enabled
boolean Whether to send webhooks to the webhook URL.
payments_available
boolean Whether the partner can accept real payments. ‘true’ if there is a signed agreement in force and at least one enabled project. ‘false’ by default.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->CreateProject(array(
    'merchant_id' => MERCHANT_ID,
    'request' => array (
         'descriptor' => 'demo',
         'name' =>
             array (
                 'en' => 'Demo Project for Universal Protocol',
             ),
         'url' => 'http://xsolla.com',
         'description' =>
             array (
             ),
         'payment_url' => 'https://xsolla.com/sample.universal.php',
         'key' => 'KEY',
         'return_url' => 'http://xsolla.com/return.php',
         'user_billing_enabled' => true,
         'show_user_in_paystation' => true,
         'user_public_id_enabled' => false,
         'locale_list' =>
             array (
                 'en',
             ),
         'components' =>
             array (
                 'virtual_currency' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Virtual currency custom name',
                             ),
                     ),
                 'items' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Items custom name',
                             ),
                     ),
                 'simple_checkout' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Simple checkout custom name',
                             ),
                     ),
                 'subscriptions' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Subscriptions custom name',
                             ),
                     ),
             ),
         'send_json_to_paystation' => false,
         'is_external_id_required' => false,
         'ipn_enabled' => true,
         'payments_available' => true
     )
));
POST /merchant/v2/merchants/{merchant_id}/projects HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "descriptor":"demo",
    "name":{
        "en":"Demo Project for Universal Protocol"
    },
    "url":"http:\/\/xsolla.com",
    "description":[
    ],
    "payment_url":"https:\/\/xsolla.com\/sample.universal.php",
    "key":"KEY",
    "return_url":"http:\/\/xsolla.com\/return.php",
    "user_billing_enabled":true,
    "show_user_in_paystation":true,
    "user_public_id_enabled":false,
    "locale_list":[
        "en"
    ],
    "components":{
        "virtual_currency":{
            "enabled":true,
            "custom_name":{
                "en":"Virtual currency custom name"
            }
        },
        "items":{
            "enabled":true,
            "custom_name":{
                "en":"Items custom name"
            }
        },
        "simple_checkout":{
            "enabled":true,
            "custom_name":{
                "en":"Simple checkout custom name"
            }
        },
        "subscriptions":{
            "enabled":true,
            "custom_name":{
                "en":"Subscriptions custom name"
            }
        }
    },
    "send_json_to_paystation":false,
    "is_external_id_required":false,
    "ipn_enabled":true,
    "payments_available":true
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/projects' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
    "descriptor":"demo",
    "name":{
        "en":"Demo Project for Universal Protocol"
    },
    "url":"http:\/\/xsolla.com",
    "description":[],
    "payment_url":"https:\/\/xsolla.com\/sample.universal.php",
    "key":"KEY",
    "return_url":"http:\/\/xsolla.com\/return.php",
    "user_billing_enabled":true,
    "show_user_in_paystation":true,
    "user_public_id_enabled":false,
    "locale_list":[
        "en"
    ],
    "components":{
        "virtual_currency":{
            "enabled":true,
            "custom_name":{
                "en":"Virtual currency custom name"
            }
        },
        "items":{
            "enabled":true,
            "custom_name":{
                "en":"Items custom name"
            }
        },
        "simple_checkout":{
            "enabled":true,
            "custom_name":{
                "en":"Simple checkout custom name"
            }
        },
        "subscriptions":{
            "enabled":true,
            "custom_name":{
                "en":"Subscriptions custom name"
            }
        }
    },
    "send_json_to_paystation":false,
    "is_external_id_required":false,
    "ipn_enabled":true,
    "payments_available":true
}'
Response
<?php

// example response
$response = array (
    'id' => 12345
);
HTTP/1.1 201 Created
Content-Type: application/json

{
    "id": 12345
}
{
    "id": 12345
}

Get Project

Retrieves information about a project.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/projects/{project_id}

Parameter Type Description
project_id
integer Project ID.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->GetProject(array(
    'project_id' => PROJECT_ID
));
GET /merchant/v2/projects/{project_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    'id' => 12345,
    'descriptor' => 'demo',
    'name' =>
        array (
            'en' => 'Demo Project for Universal Protocol',
        ),
    'url' => 'http://xsolla.com',
    'keywords' => '',
    'description' =>
        array (),
    'payment_url' => 'https://secure.xsolla.com/api/calc/billing/sample.universal.php',
    'key' => 'KEY',
    'is_cancel_implemented' => true,
    'enabled' => true,
    'return_url' => 'http://xsolla.com/return',
    'is_send_email' => false,
    'user_billing_enabled' => true,
    'show_user_in_paystation' => true,
    'user_public_id_enabled' => false,
    'send_email_for_user_billing_purchase' => true,
    'is_sandbox_available' => 1,
    'locale_list' =>
        array (
            'en'
        ),
    'users_count' => 0,
    'cardRecurring' => true,
    'components' =>
        array (
            'virtual_currency' =>
                array (
                    'enabled' => true,
                    'status' => 'ready',
                    'live' => false,
                    'custom_name' =>
                        array (
                            'en' => 'Virtual currency custom name',
                        ),
                ),
            'items' =>
                array (
                    'enabled' => true,
                    'status' => 'ready',
                    'live' => false,
                    'custom_name' =>
                        array (
                            'en' => 'Items custom name',
                        ),
                ),
            'simple_checkout' =>
                array (
                    'enabled' => true,
                    'status' => 'ready',
                    'live' => true,
                    'custom_name' =>
                        array (
                            'en' => 'Simple checkout custom name',
                        ),
                ),
            'subscriptions' =>
                array (
                    'enabled' => true,
                    'status' => 'ready',
                    'live' => true,
                    'custom_name' =>
                        array (
                            'en' => 'Subscriptions custom name',
                        ),
                ),
        ),
    'send_json_to_paystation' => false,
    'is_external_id_required' => false,
    'ipn_enabled' => true,
    'payments_available' => true,
);
HTTP/1.1 200 OK
Content-Type: application/json

{
    "id":12345,
    "descriptor":"demo",
    "name":{
        "en":"Demo Project for Universal Protocol"
    },
    "url":"http:\/\/xsolla.com",
    "keywords":"",
    "description":[],
    "payment_url":"https:\/\/secure.xsolla.com\/api\/calc\/billing\/sample.universal.php",
    "key":"KEY",
    "is_cancel_implemented":true,
    "enabled":true,
    "return_url":"http:\/\/xsolla.com\/return",
    "is_send_email":false,
    "user_billing_enabled":true,
    "show_user_in_paystation":true,
    "user_public_id_enabled":false,
    "send_email_for_user_billing_purchase":true,
    "is_sandbox_available":1,
    "locale_list":[
        "en"
    ],
    "users_count":0,
    "cardRecurring":true,
    "components":{
        "virtual_currency":{
            "enabled":true,
            "status":"ready",
            "live":false,
            "custom_name":{
                "en":"Virtual currency custom name"
            }
        },
        "items":{
            "enabled":true,
            "status":"ready",
            "live":false,
            "custom_name":{
                "en":"Items custom name"
            }
        },
        "simple_checkout":{
            "enabled":true,
            "status":"ready",
            "live":true,
            "custom_name":{
                "en":"Simple checkout custom name"
            }
        },
        "subscriptions":{
            "enabled":true,
            "status":"ready",
            "live":true,
            "custom_name":{
                "en":"Subscriptions custom name"
            }
        }
    },
    "send_json_to_paystation":false,
    "is_external_id_required":false,
    "ipn_enabled":true,
    "payments_available":true
}
{
    "id":12345,
    "descriptor":"demo",
    "name":{
        "en":"Demo Project for Universal Protocol"
    },
    "url":"http:\/\/xsolla.com",
    "keywords":"",
    "description":[
    ],
    "payment_url":"https:\/\/secure.xsolla.com\/api\/calc\/billing\/sample.universal.php",
    "key":"KEY",
    "is_cancel_implemented":true,
    "enabled":true,
    "return_url":"http:\/\/xsolla.com\/return",
    "is_send_email":false,
    "user_billing_enabled":true,
    "show_user_in_paystation":true,
    "user_public_id_enabled":false,
    "send_email_for_user_billing_purchase":true,
    "is_sandbox_available":1,
    "locale_list":[
        "en"
    ],
    "users_count":0,
    "cardRecurring":true,
    "components":{
        "virtual_currency":{
            "enabled":true,
            "status":"ready",
            "live":false,
            "custom_name":{
                "en":"Virtual currency custom name"
            }
        },
        "items":{
            "enabled":true,
            "status":"ready",
            "live":false,
            "custom_name":{
                "en":"Items custom name"
            }
        },
        "simple_checkout":{
            "enabled":true,
            "status":"ready",
            "live":true,
            "custom_name":{
                "en":"Simple checkout custom name"
            }
        },
        "subscriptions":{
            "enabled":true,
            "status":"ready",
            "live":true,
            "custom_name":{
                "en":"Subscriptions custom name"
            }
        }
    },
    "send_json_to_paystation":false,
    "is_external_id_required":false,
    "ipn_enabled":true,
    "payments_available":true
}

Update Project

Updates a project.

HTTP REQUEST

PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/projects/{project_id}

Parameter Type Description
merchant_id
integer Merchant ID.
project_id
integer Project ID.
descriptor
string Short project name for reports (up to 12 characters).
name
array of strings Array of localized project names.
url
string Project website URL.
description
string Array of localized project descriptions.
payment_url
string Webhook URL.
key
string Project secret key.
return_url
string URL to redirect the user to after a successful payment.
user_billing_enabled
boolean Whether to keep user data in the Xsolla database.
show_user_in_paystation
boolean Whether to show the user’s saved payment accounts and payment history in the payment UI.
locale_list
array of strings List of languages that corresponding settings are localized to.
user_public_id_enabled
boolean Enables user details verification via Public User ID (for payments through cash kiosks).
components
object Module details (object).
components.virtual_currency
object Virtual currency module details (object).
components.virtual_currency.enabled
boolean Whether to enable the module for this project.
components.virtual_currency.custom_name
array of strings Localized module names to show in the payment UI.
components.items
object Virtual items module details (object).
components.items.enabled
boolean Whether to enable the module for this project.
components.items.custom_name
array of strings Localized module names to show in the payment UI.
components.simple_checkout
object Simple checkout module details (object).
components.simple_checkout.enabled
boolean Whether to enable the module for this project.
components.simple_checkout.custom_name
array of strings Localized module names to show in the payment UI.
components.subscriptions
object Subscriptions module details (object).
components.subscriptions.enabled
boolean Whether to enable the module for this project.
components.subscriptions.custom_name
array of strings Localized module names to show in the payment UI.
send_json_to_paystation
boolean Enables tokenless integration.
is_external_id_required
boolean Whether External ID is required for integration with Xsolla.
ipn_enabled
boolean Whether to send webhooks to the webhook URL.
payments_available
boolean Whether the partner can accept real payments. ‘true’ if there is a signed agreement in force and at least one enabled project. ‘false’ by default.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->UpdateProject(array(
    'merchant_id' => MERCHANT_ID,
    'request' => array (
         'id' => 12345,
         'descriptor' => 'demo',
         'name' =>
             array (
                 'en' => 'Demo Project for Universal Protocol',
             ),
         'url' => 'http://xsolla.com',
         'description' =>
             array (
             ),
         'payment_url' => 'https://xsolla.com/sample.universal.php',
         'key' => 'KEY',
         'return_url' => 'http://xsolla.com/return.php',
         'user_billing_enabled' => true,
         'user_public_id_enabled' => false,
         'show_user_in_paystation' => true,
         'locale_list' =>
             array (
                 'en',
             ),
         'components' =>
             array (
                 'virtual_currency' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Virtual currency custom name',
                             ),
                     ),
                 'items' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Items custom name',
                             ),
                     ),
                 'simple_checkout' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Simple checkout custom name',
                             ),
                     ),
                 'subscriptions' =>
                     array (
                         'enabled' => true,
                         'custom_name' =>
                             array (
                                 'en' => 'Subscriptions custom name',
                             ),
                     ),
             ),
         'send_json_to_paystation' => false,
         'is_external_id_required' => false,
         'ipn_enabled' => true,
         'payments_available' => true
     )
));
PUT /merchant/v2/merchants/{merchant_id}/projects/{project_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "id":12345,
    "descriptor":"demo",
    "name":{
        "en":"Demo Project for Universal Protocol"
    },
    "url":"http:\/\/xsolla.com",
    "description":[
    ],
    "payment_url":"https:\/\/xsolla.com\/sample.universal.php",
    "key":"KEY",
    "return_url":"http:\/\/xsolla.com\/return.php",
    "user_billing_enabled":true,
    "show_user_in_paystation":true,
    "user_public_id_enabled":false,
    "locale_list":[
        "en"
    ],
    "components":{
        "virtual_currency":{
            "enabled":true,
            "custom_name":{
                "en":"Virtual currency custom name"
            }
        },
        "items":{
            "enabled":true,
            "custom_name":{
                "en":"Items custom name"
            }
        },
        "simple_checkout":{
            "enabled":true,
            "custom_name":{
                "en":"Simple checkout custom name"
            }
        },
        "subscriptions":{
            "enabled":true,
            "custom_name":{
                "en":"Subscriptions custom name"
            }
        }
    },
    "send_json_to_paystation":false,
    "is_external_id_required":false,
    "ipn_enabled":true,
    "payments_available":true
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/projects/{project_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
    "id":12345,
    "descriptor":"demo",
    "name":{
        "en":"Demo Project for Universal Protocol"
    },
    "url":"http:\/\/xsolla.com",
    "description":[],
    "payment_url":"https:\/\/xsolla.com\/sample.universal.php",
    "key":"KEY",
    "return_url":"http:\/\/xsolla.com\/return.php",
    "user_billing_enabled":true,
    "show_user_in_paystation":true,
    "user_public_id_enabled":false,
    "locale_list":[
        "en"
    ],
    "components":{
        "virtual_currency":{
            "enabled":true,
            "custom_name":{
                "en":"Virtual currency custom name"
            }
        },
        "items":{
            "enabled":true,
            "custom_name":{
                "en":"Items custom name"
            }
        },
        "simple_checkout":{
            "enabled":true,
            "custom_name":{
                "en":"Simple checkout custom name"
            }
        },
        "subscriptions":{
            "enabled":true,
            "custom_name":{
                "en":"Subscriptions custom name"
            }
        }
    },
    "send_json_to_paystation":false,
    "is_external_id_required":false,
    "ipn_enabled":true,
    "payments_available":true
}'
Response
<?php

// example response
$response = array (
    'id' => 12345
);
HTTP/1.1 201 Created
Content-Type: application/json

{
    "id": 12345
}
{
    "id": 12345
}

Get Projects List

Gets projects of a merchant.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/projects?sort=asc

Parameter Type Description
merchant_id
integer Merchant ID.
sort
string Sorting the list items by their creation date. Can be ‘asc’ (sort in ascending order) and ‘desc’ (sort in descending order). Default is ‘asc’.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListProjects(array(
    'merchant_id' => MERCHANT_ID,
    'sort' => 'asc'
));
GET /merchant/v2/merchants/{merchant_id}/projects?sort=asc HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/projects?sort=asc' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'id' => 12345,
        'name' => 'Demo Project for Universal Protocol',
        'protocolKey' => 'universal',
        'enabled' => true,
        'components' =>
            array (
                'virtual_currency' =>
                    array (
                        'status' => 'ready',
                        'live' => true,
                        'custom_name' =>
                            array (
                            ),
                    ),
            ),
        'cardRecurring' => false,
        'user_billing_enabled' => false,
        'send_json_to_paystation' => false,
    ),
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "id":12345,
        "name":"Demo Project for Universal Protocol",
        "protocolKey":"universal",
        "enabled":true,
        "components":{
            "virtual_currency":{
                "status":"ready",
                "live":true,
                "custom_name":[]
            }
        },
        "cardRecurring":false,
        "user_billing_enabled":false,
        "send_json_to_paystation": false
    }
]
[
    {
        "id":12345,
        "name":"Demo Project for Universal Protocol",
        "protocolKey":"universal",
        "enabled":true,
        "components":{
            "virtual_currency":{
                "status":"ready",
                "live":true,
                "custom_name":[]
            }
        },
        "cardRecurring":false,
        "user_billing_enabled":false,
        "send_json_to_paystation": false
    }
]

Get Payment Methods

Returns the list of payment systems enabled for a project.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/payment_systems/search.json?offset=0&limit=21

Parameter Type Description
project_id
integer Project ID.
offset
integer Number of the element from which the list is generated (the count starts from 0).
limit
integer Limit for the number of elements on the page.
Copy
Full screen
  • http
  • curl
Request
GET /merchant/v2/projects/{project_id}/payment_systems/search.json?offset=0&limit=21 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/payment_systems/search.json?offset=0&limit=21' \
-X GET \
-u merchant_id:merchant_api_key
Response
HTTP/1.1 200 OK
Content-Type: application/json

{
    "count": 1,
    "payment_systems": [
        {
            "id": 2449,
            "name": "Bank transfers",
            "image_url": "\/\/cdn.xsolla.net\/paymentoptions\/paystation\/theme_33\/108x63\/2449.1450081985.png",
            "categories": "Bank Transfer",
            "regions": "Western Europe, Eastern Europe",
            "countries": "Austria, Belgium, Cyprus, Germany, Estonia, Spain, Finland, France, Greece, Ireland, Italy, Lithuania, Luxembourg, Latvia, Malta, Netherlands, Portugal, Slovenia, Slovakia",
            "enabled": true,
            "prices": [
                {
                    "fee_percent": 0.75,
                    "fee_fixed_value": 0,
                    "fee_fixed_currency": null,
                    "is_unknown_commission": false,
                    "currencies": "EUR",
                    "description": null
                },
                {
                    "fee_percent": 0,
                    "fee_fixed_value": 0.1,
                    "fee_fixed_currency": "EUR",
                    "is_unknown_commission": false,
                    "currencies": "EUR",
                    "description": null
                }
            ]
        }
    ]
}
{
    "count": 1,
    "payment_systems": [
        {
            "id": 2449,
            "name": "Bank transfers",
            "image_url": "\/\/cdn.xsolla.net\/paymentoptions\/paystation\/theme_33\/108x63\/2449.1450081985.png",
            "categories": "Bank Transfer",
            "regions": "Western Europe, Eastern Europe",
            "countries": "Austria, Belgium, Cyprus, Germany, Estonia, Spain, Finland, France, Greece, Ireland, Italy, Lithuania, Luxembourg, Latvia, Malta, Netherlands, Portugal, Slovenia, Slovakia",
            "enabled": true,
            "prices": [
                {
                    "fee_percent": 0.75,
                    "fee_fixed_value": 0,
                    "fee_fixed_currency": null,
                    "is_unknown_commission": false,
                    "currencies": "EUR",
                    "description": null
                },
                {
                    "fee_percent": 0,
                    "fee_fixed_value": 0.1,
                    "fee_fixed_currency": "EUR",
                    "is_unknown_commission": false,
                    "currencies": "EUR",
                    "description": null
                }
            ]
        }
    ]
}

User Management

Create User

Creates a new user.

HTTP REQUEST

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID. Required.
user_name
string Username.
user_custom
string Custom parameter for user identification.
email
string User email.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->CreateWalletUser(array(
    'project_id' => PROJECT_ID,
    'request' => array(
        'user_id' => USER_ID
    )
));
POST /merchant/v2/projects/{project_id}/users HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "user_id": 1
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
    "user_id": 1
}'
Response
<?php

$response = null;
HTTP/1.1 204 No Content

Get User

Retrieves user details.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->GetWalletUser(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID
));
GET /merchant/v2/projects/{project_id}/users/{user_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    'user_id' => 0,
    'user_name' => 'John',
    'user_custom' => 'Smith',
    'email' => 'email@example.com',
    'register_date' => '2014-10-08T21:44:32+04:00',
    'balance' => 100,
    'wallet_amount' => 1.5,
    'wallet_currency' => 'USD',
    'enabled' => true
);
HTTP/1.1 200 OK
Content-Type: application/json

{
    "user_id": 0,
    "user_name": "John",
    "user_custom": "Smith",
    "email": "email@example.com",
    "register_date": "2014-10-08T21:44:32-08:00",
    "balance": 100,
    "wallet_amount": 1.5,
    "wallet_currency": "USD",
    "enabled": true
}
{
    "user_id": 0,
    "user_name": "John",
    "user_custom": "Smith",
    "email": "email@example.com",
    "register_date": "2014-10-08T21:44:32-08:00",
    "balance": 100,
    "wallet_amount": 1.5,
    "wallet_currency": "USD",
    "enabled": true
}

Update User

Updates user details.

HTTP REQUEST

PUT https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID. Required.
user_name
string Username.
user_custom
string Custom parameter for user identification.
email
string User email.
enabled
boolean Whether the user is enabled. Required.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->UpdateWalletUser(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID,
    'request' => array(
        'enabled' => true
    )
));
PUT /merchant/v2/projects/{project_id}/users/{user_id} HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "enabled": true
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
    "enabled": true
}'
Response
<?php

$response = null;
HTTP/1.1 204 No Content

Get Transactions List

Lists all transactions of a user.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/transactions

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID. Required.
datetime_from
datetime Period start. Required.
datetime_to
datetime Period end. Required.
transaction_type
string Type of transaction, can be ‘payment’, ‘coupon’, ‘inGamePurchase’, ‘internal’, or ‘cancellation’.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListWalletUserOperations(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID,
    'datetime_from' => '2015-01-01T00:00:00Z',
    'datetime_to' => '2016-01-01T00:00:00Z'
));
GET /merchant/v2/projects/{project_id}/users/{user_id}/transactions?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/transactions?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'operation_id' => 647287,
        'transaction_id' => 1234567,
        'coupon_id' => null,
        'coupon_code' => null,
        'transaction_type' => 'invoice',
        'comment' => 'Incoming payment',
        'date' => '2014-10-28T12:00:00+04:00',
        'amount' => 1000,
        'sum' => 10,
        'currency' => 'USD',
        'status' => 'notified',
        'user_balance' => 100,
        'user_id' => '1234567'
    ),
    array (
        'operation_id' => 647288,
        'transaction_id' => null,
        'coupon_id' => null,
        'coupon_code' => 'DemoCoupon',
        'transaction_type' => 'coupon',
        'comment' => 'Coupon Redeem',
        'date' => '2014-10-28T14:00:00+04:00',
        'amount' => 0,
        'sum' => null,
        'currency' => null,
        'status' => 'failed',
        'user_balance' => 100,
        'user_id' => '1234567'
    )
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "operation_id": 647287,
        "transaction_id": 1234567,
        "coupon_id": null,
        "coupon_code": null,
        "transaction_type": "invoice",
        "comment": "Incoming payment",
        "date": "2014-10-28T12:00:00+04:00",
        "amount": 1000,
        "sum": 10,
        "currency": "USD",
        "status": "notified",
        "user_balance": 100,
        "user_id": "1234567"
    },
    {
        "operation_id": 647288,
        "transaction_id": null,
        "coupon_id": 12345,
        "coupon_code": "DemoCoupon",
        "transaction_type": "coupon",
        "comment": "Coupon Redeem",
        "date": "2014-10-28T14:00:00+04:00",
        "amount": 0,
        "sum": null,
        "currency": null,
        "status": "failed",
        "user_balance": 100,
        "user_id": "1234567"
    }
]
[
    {
        "operation_id": 647287,
        "transaction_id": 1234567,
        "coupon_id": null,
        "coupon_code": null,
        "transaction_type": "invoice",
        "comment": "Incoming payment",
        "date": "2014-10-28T12:00:00+04:00",
        "amount": 1000,
        "sum": 10,
        "currency": "USD",
        "status": "notified",
        "user_balance": 100,
        "user_id": "1234567"
    },
    {
        "operation_id": 647288,
        "transaction_id": null,
        "coupon_id": 12345,
        "coupon_code": "DemoCoupon",
        "transaction_type": "coupon",
        "comment": "Coupon Redeem",
        "date": "2014-10-28T14:00:00+04:00",
        "amount": 0,
        "sum": null,
        "currency": null,
        "status": "failed",
        "user_balance": 100,
        "user_id": "1234567"
    }
]

Add Virtual Items

Adds virtual items to a user’s account.

HTTP REQUEST

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/add

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID.
virtual_items
array Virtual items (array).
virtual_items.virtual_item
object Virtual item details (object).
virtual_items.virtual_item.sku
string Unique item ID.
virtual_items.amount
integer Item quantity.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->AddVirtualItemToWalletUser(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID,
    'request' => array(
        'virtual_items' => array(
            array(
                'virtual_item' => array(
                    'sku' => 'ar23_shop_expiration_3'
                ),
                'amount' => 2
            )
        )
    )
));
POST /merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/add HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "virtual_items": [
        {
            "virtual_item":
                {
                    "sku" : "ar23_shop_expiration_3"
                },
            "amount": 2
        }
    ]
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/add' \
-X POST \
-u merchant_id:merchant_api_key
-d '{
        "virtual_items": [
            {
                "virtual_item":
                    {
                        "sku" : "ar23_shop_expiration_3"
                    },
                "amount": 2
            }
        ]
    }'
Response
<?php

$response = null;
HTTP/1.1 204 No Content

Get Virtual Items

Retrieves a list of virtual items owned by a user.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID.
offset
integer Number of the element from which the list is generated (the count starts from 0).
limit
integer Limit for the number of elements on the page.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListWalletUserVirtualItems(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID,
    'limit' => 1,
    'offset' => 0
));
GET /merchant/v2/projects/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'id' => 1,
        'sku' => 'item1',
        'quantity' => 10
    ),
    array (
        'id' => 2,
        'sku' => 'item2',
        'quantity' => 5
    ),
);
HTTP/1.1 200 OK
Content-Type: application/json

[
         {
            "id": 1,
            "sku": "item1",
            "quantity": 10
         },
         {
            "id": 2,
            "sku": "item2",
            "quantity": 5
         }
]
[
         {
            "id": 1,
            "sku": "item1",
            "quantity": 10
         },
         {
            "id": 2,
            "sku": "item2",
            "quantity": 5
         }
]

Delete Virtual Items

Removes virtual items from a user’s account.

HTTP REQUEST

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/remove

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID.
virtual_items
array Virtual items (array).
virtual_items.virtual_item
object Virtual item details (object).
virtual_items.virtual_item.sku
string Unique item ID.
virtual_items.amount
integer Item quantity.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->DeleteVirtualItemFromWalletUser(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID,
    'request' => array(
        'virtual_items' => array(
            array(
                'virtual_item' => array(
                    'sku' => 'ar23_shop_expiration_3'
                ),
                'amount' => 2,
            )
        )
    )
));
POST /merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/remove HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "virtual_items": [
        {
            "virtual_item":
                {
                    "sku" : "ar23_shop_expiration_3"
                },
            "amount": 2
        }
    ]
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items/remove' \
-X POST \
-u merchant_id:merchant_api_key
-d '{
        "virtual_items": [
            {
                "virtual_item":
                    {
                        "sku" : "ar23_shop_expiration_3"
                    },
                "amount": 2
            }
        ]
    }'
Response
<?php

$response = null;
HTTP/1.1 204 No Content

Update User Balance

Updates the balance of a user.

HTTP REQUEST

POST https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/recharge

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID.
amount
float Virtual currency quantity.
comment
string Reason for changing the balance.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->RechargeWalletUserBalance(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID,
    'request' => array(
        'amount' => 10,
        'comment' => 'Incoming payment'
    )
));
POST /merchant/v2/projects/{project_id}/users/{user_id}/recharge HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "amount": 10,
    "comment": "Incoming payment"
}
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/recharge' \
-X POST \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
    "amount": 10,
    "comment": "Incoming payment"
}'
Response
<?php

// example response
$response = array (
    'amount' => 110
);
HTTP/1.1 200 OK
Content-Type: application/json

{
    "amount": 110
}
{
    "amount": 110
}

Get All Users

Lists all users.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users

Parameter Type Description
project_id
integer Project ID. Required.
user_requisites
string User ID or name.
email
string User email.
offset
integer Number of the element from which the list is generated (the count starts from 0). Required.
limit
integer Limit for the number of elements on the page. Required.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListWalletUsers(array(
    'project_id' => PROJECT_ID,
    'limit' => 1,
    'offset' => 0
));
GET /merchant/v2/projects/{project_id}/users?offset=1&limit=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users?offset=1&limit=1' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    'recordsTotal' => 1,
    'data' =>
        array (
            array (
                'user_id' => 0,
                'user_name' => 'John',
                'user_custom' => 'Smith',
                'email' => 'email@example.com',
                'register_date' => '2014-10-08T21:44:32-08:00',
                'balance' => 100,
                'wallet_amount' => 1.5,
                'wallet_currency' => 'USD',
                'enabled' => true
            )
        )
);
HTTP/1.1 200 OK
Content-Type: application/json

{
    "recordsTotal": 1,
    "data": [
        {
            "user_id": 0,
            "user_name": "John",
            "user_custom": "Smith",
            "email": "email@example.com",
            "register_date": "2014-10-08T21:44:32-08:00",
            "balance": 100,
            "wallet_amount": 1.5,
            "wallet_currency": "USD",
            "enabled": true
        }
    ]
}
{
    "recordsTotal": 1,
    "data": [
        {
            "user_id": 0,
            "user_name": "John",
            "user_custom": "Smith",
            "email": "email@example.com",
            "register_date": "2014-10-08T21:44:32-08:00",
            "balance": 100,
            "wallet_amount": 1.5,
            "wallet_currency": "USD",
            "enabled": true
        }
    ]
}

Get All Virtual Items

Get virtual items of all the project’s users.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/projects/{project_id}/users/virtual_items/total

Parameter Type Description
project_id
integer Project ID.
user_id
string User ID.
offset
integer Number of the element from which the list is generated (the count starts from 0).
limit
integer Limit for the number of elements on the page.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListWalletUserVirtualItems(array(
    'project_id' => PROJECT_ID,
    'user_id' => USER_ID,
    'limit' => 1,
    'offset' => 0
));
GET /merchant/v2/projects/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1 HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/projects/{project_id}/users/{user_id}/virtual_items?offset=1&limit=1' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
  array (
      'user_id' => 'V1',
      'virtual_items' =>
          array (
              'id' => 1,
              'sku' => 'item1',
              'quantity' => '10'
            ),
            array (
                'id' => 2,
                'sku' => 'item2',
                'quantity' => '5'
              ),
        ),   
  array (
      'user_id' => 'V2',
      'virtual_items' =>
          array (
              'id' => 1,
              'sku' => 'item1',
              'quantity' => '9'
              ),
        ),            
);
HTTP/1.1 200 OK
Content-Type: application/json

[
{
   "user_id": "V1",
   "virtual_items": [
      {
         "id": 1,
         "sku": "item1",
         "quantity": 10
      },
      {
         "id": 2,
         "sku": "item2",
         "quantity": 5
      }
   ]
},
{
   "user_id": "V2",
   "virtual_items": [
      {
         "id": 1,
         "sku": "item1",
         "quantity": 9
      }
   ]      
}
]
[
{
   "user_id": "V1",
   "virtual_items": [
      {
         "id": 1,
         "sku": "item1",
         "quantity": 10
      },
      {
         "id": 2,
         "sku": "item2",
         "quantity": 5
      }
   ]
},
{
   "user_id": "V2",
   "virtual_items": [
      {
         "id": 1,
         "sku": "item1",
         "quantity": 9
      }
   ]
}
]

Reports

Find Transactions

Gets a list of transactions based on specific search parameters.

Note: You can get the list in JSON, CSV, or XLS format.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/search.{format}

Parameter Type Description
merchant_id
integer Merchant ID. Required.
format
string Data format: json / csv / xls. Required.
datetime_from
datetime Period start.
datetime_to
datetime Period end.
project_id
integer Project ID.
show_dry_run
boolean Whether to include test transactions.
transaction_id
integer Transaction ID.
phone
string Phone number in international format.
user_id
string User ID.
user_name
string Username.
user_custom
string Custom parameter for user identification.
email
string User email.
external_id
string Transaction external ID.
offset
integer Number of the element from which the list is generated (the count starts from 0).
limit
integer Limit for the number of elements on the page.
transaction_type
string Type of transaction, can be “payment”, “coupon”, “inGamePurchase”, “internal”, or “cancellation”.
status
string Additional transaction status: created/processing/done/canceled/error/review/refunded/awaitingRefund.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->SearchPaymentsRegistry(array(
    'format' => 'json',
    'type' => 'all',
    'limit' => 1,
    'offset' => 0
));
GET /merchant/v2/merchants/{merchant_id}/reports/transactions/search.{format}?datetime_from=2014-10-14&datetime_to=2014-10-15&project_id=1&transaction_id=123456&phone=%2B18184356613&v1=xsolla&v2=xsolla&v3=xsolla&offset=1&limit=1&email=user%40example.com&type=all HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/search.{format}?datetime_from=2014-10-14&datetime_to=2014-10-15&project_id=1&transaction_id=123456&phone=%2B18184356613&v1=xsolla&v2=xsolla&v3=xsolla&offset=1&limit=1&email=user%40example.com&type=all' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'transaction' =>
            array (
                'project' =>
                    array (
                        'id' => 14004,
                        'name' => 'Farm Fresh'
                    ),
                'payment_method' =>
                    array (
                        'id' => 26,
                        'name' => 'Visa Mastercard'
                    ),
                'transfer_date' => '2015-04-27T21:55:00+03:00',
                'id' => 1,
                'refund_reason' => null,
                'status' => 'done',
                'external_id' => null,
                'dry_run' => 0
            ),
        'user' =>
            array (
                'id' => 'user_1',
                'name' => 'John Smith',
                'custom' => null,
                'email' => null,
                'phone' => null,
                'country' => 'US'
            ),
        'payment_details' =>
            array (
                'payment' =>
                    array (
                        'currency' => 'USD',
                        'amount' => 0.39,
                        'amount_from_ps' => 0.39,
                    ),
                'sales_tax' =>
                    array (
                        'percent' => 0,
                        'amount' => 0,
                    )
            ),
        'purchase' =>
            array (
                'virtual_currency' =>
                    array (
                        'amount' => 100,
                        'name' => 'DemoGoods',
                    ),
                'virtual_items' => null,
                'simple_checkout' => null,
                'purchase_amount_from_ps' => 0.38,
                'pin_codes' =>
                    array (
                        'amount' => 1,
                        'currency' => 'EUR',
                        'content' => 'Game delivery content'
                    ),
                'subscription' =>
                    array (
                        'name' => '1 Month Subscription'
                    )
            )
    )
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "transaction": {
            "project": {
                "id": 14004,
                "name": "Farm Fresh"
            },
            "payment_method": {
                "id": 26,
                "name": "Visa Mastercard"
            },
            "transfer_date": "2015-04-27T21:55:00+03:00",
            "id": 1,
            "refund_reason": null,
            "status": "done",
            "external_id": null,
            "dry_run": 0
        },
        "user":{
            "id": "user_1",
            "name": "John Smith",
            "custom": null,
            "email": null,
            "phone": null,
            "country": "US"
        },
        "payment_details": {
            "payment": {
                "currency": "USD",
                "amount": 0.39,
                "amount_from_ps": 0.39
            },
            "sales_tax": {
                "percent": 0,
                "amount": 0
            }
        },
        "purchase": {
            "virtual_currency": {
                "amount": 100,
                "name": "DemoGoods"
            },
            "virtual_items": null,
            "simple_checkout": null,
            "purchase_amount_from_ps": 0.38,
            "pin_codes": {
                "amount": 1,
                "currency": "EUR",
                "content": "Game delivery content"
            },
            "subscription": {
                "name": "1 Month Subscription"
            }
        }
    }
]
[
    {
        "transaction": {
            "project": {
                "id": 14004,
                "name": "Farm Fresh"
            },
            "payment_method": {
                "id": 26,
                "name": "Visa Mastercard"
            },
            "transfer_date": "2015-04-27T21:55:00+03:00",
            "id": 1,
            "refund_reason": null,
            "status": "done",
            "external_id": null,
            "dry_run": 0
        },
        "user":{
            "id": "user_1",
            "name": "John Smith",
            "custom": null,
            "email": null,
            "phone": null,
            "country": "US"
        },
        "payment_details": {
            "payment": {
                "currency": "USD",
                "amount": 0.39,
                "amount_from_ps": 0.39
            },
            "sales_tax": {
                "percent": 0,
                "amount": 0
            }
        },
        "purchase": {
            "virtual_currency": {
                "amount": 100,
                "name": "DemoGoods"
            },
            "virtual_items": null,
            "simple_checkout": null,
            "purchase_amount_from_ps": 0.38,
            "pin_codes": {
                "amount": 1,
                "currency": "EUR",
                "content": "Game delivery content"
            },
            "subscription": {
                "name": "1 Month Subscription"
            }
        }
    }
]

Get Transactions

Gets all transactions for a specified period/payout/report.

Note: You can get the list in JSON, CSV, or XLS format.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/registry.{format}

Parameter Type Description
merchant_id
integer Merchant ID. Required.
format
string Data format: json / csv / xls. Required.
datetime_from
datetime Period start. Required.
datetime_to
datetime Period end. Required.
project_id
integer Project ID.
show_dry_run
boolean Whether to include test transactions.
transfer_id
integer Payout ID.
report_id
integer Financial report ID.
limit
integer Limit for the number of elements on the page.
offset
integer Number of the element from which the list is generated (the count starts from 0).
in_transfer_currency
boolean Converts all financial data to the payout currency (the pay-in currency is used by default). Required.
show_total
boolean Adds totals to the report. Required.
status
string Transaction status. Can be ‘done’, ‘error’, or ‘canceled’.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListPaymentsRegistry(array(
    'format' => 'json',
    'datetime_from' => '2015-01-01T00:00:00Z',
    'datetime_to' => '2015-01-02T00:00:00Z',
    'in_transfer_currency' => false,
    'limit' => 1,
    'offset' => 0,
    'show_total' => true
));
GET /merchant/v2/merchants/{merchant_id}/reports/transactions/registry.{format}?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z&limit=1&offset=1&in_transfer_currency=true&show_total=false HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/registry.{format}?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z&limit=1&offset=1&in_transfer_currency=true&show_total=false' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'transaction' =>
            array (
                'project' =>
                    array (
                        'id' => 14004,
                        'name' => 'Farm Fresh'
                    ),
                'payment_method' =>
                    array (
                        'id' => 26,
                        'name' => 'Visa Mastercard'
                    ),
                'transfer_date' => '2015-04-27T21:55:00+03:00',
                'id' => 1,
                'refund_reason' => null,
                'external_id': null,
                'status' => 'done',
                'dry_run' => 0,
                'custom_parameters': null,
                'direct_account': 0
            ),
        'user' =>
            array (
                'id' => 'user_1',
                'name' => 'John Smith',
                'custom' => null,
                'email' => null,
                'phone' => null,
                'country' => 'US',
                'marketplace': 'PayStation'
            ),
        'payment_details' =>
            array (
                'payment' =>
                    array (
                        'currency' => 'USD',
                        'amount' => 0.39,
                        'amount_from_ps' => 0.39
                    ),
                'commission_xsolla' =>
                    array (
                        'amount' => 0.02,
                        'percent' => 5
                    ),
                'commission_ps' =>
                    array (
                        'amount' => 0.02,
                        'percent' => 5,
                        'fixed_amount' => 0
                    ),
                'payout' =>
                    array (
                        'amount' => 0.34,
                        'percent' => 90,
                        'currency' => 'USD',
                        'fx_rate' => 1,
                        'amount_from_ps' => 0.35
                    ),
                'commission_agent' =>
                    array (
                        'amount' => 0.04,
                        'percent' => 10
                    ),
                'commission_user' =>
                    array (
                        'amount' => 0,
                        'percent' => 0
                    ),
                'vat' =>
                    array (
                      'user_amount': 0,
                      'user_percent': 0,
                      'amount': 0,
                      'percent': 0
                        ),
                'repatriation_costs' =>
                    array (
                      'percent' => 0,
                      'amount' => 0,
                            ),
                'commission_ps_external' =>
                    array (
                        'percent' => null,
                        'amount' => null,
                        'currency' => null
                    ),
                'vat' =>
                    array (
                        'amount' => 0,
                        'percent' => 0
                    ),

                'commission_agent_fixed' => 0,
                'sales_tax' =>
                    array (
                        'percent' => 0,
                        'amount' => 0
                    ),
                'commission_ps_from_vat' =>
                    array (
                        'amount' => 0
                    )
            ),
        'purchase' =>
            array (
                'virtual_currency_amount' => 0,
                'purchase_amount' => 0.39,
                'virtual_currency' =>
                    array (
                        'amount' => 0,
                        'currency' => 'USD'
                    ),
                'simple_checkout' =>
                    array (
                        'amount' => 0,
                        'currency' => 'USD'
                    ),
                'virtual_items' =>
                    array (
                        'amount' => 0.39,
                        'currency' => 'USD',
                        'content' => '1 Sheep'
                    ),
                'items_amount': 1,
                'pin_codes' =>
                    array (
                        'amount' => 0.39,
                        'currency' => 'USD',
                        'content' => 'Good Game'
                    ),
                'subscription' =>
                    array (
                        'name' => '1 Month Subscription',
                        'subscription_id' => 12345,
                        'plan_id' => '1_month_subscription'
                    )
            ),
        'user_balance' =>
            array (
            'payment_currency' =>
                array (
                    'deduction_amount' => 0,
                    'purchase_amount_from_balance' => 0,
                    'payout_amount_from_balance' => 0
                )
        )
    )
);
HTTP/1.1 200 OK
Content-Type: application/json

[
  {
    "transaction": {
      "project": {
        "id": 14004,
        "name": "Farm Fresh"
      },
      "payment_method": {
        "id": 26,
        "name": "Visa Mastercard"
      },
      "transfer_date": "2015-04-27T21:55:00+03:00",
      "id": 1,
      "refund_reason": null,
      "refund_reason_comment": null,
      "external_id": null,
      "status": "done",
      "dry_run": 0,
      "custom_parameters": null,
      "direct_account": 0
    },
    "user": {
      "id": "user_1",
      "name": "John Smith",
      "custom": null,
      "email": null,
      "phone": null,
      "country": "US",
      "marketplace": "PayStation"
    },
    "payment_details": {
      "payment": {
        "currency": "USD",
        "amount": 0.39,
        "amount_from_ps": 0.39
      },
      "commission_xsolla": {
        "amount": 0.02,
        "percent": 5
      },
      "commission_ps": {
        "amount": 0.02,
        "percent": 5,
        "fixed_amount": 0
      },
      "payout": {
        "amount": 0.35,
        "percent": 90,
        "currency": "USD",
        "fx_rate": 1,
        "amount_from_ps": 0.35
      },
      "commission_agent": {
        "amount": 0.04,
        "percent": 10
      },
      "commission_user": {
        "amount": 0,
        "percent": 0
      },
      "vat": {
        "user_amount": 0,
        "user_percent": 0,
        "amount": 0,
        "percent": 0
      },
      "repatriation_costs": {
        "percent": 0,
        "amount": 0
      },
      "commission_agent_fixed": 0,
      "sales_tax": {
        "percent": 0,
        "amount": 0
      },
      "commission_ps_from_vat": {
        "amount": 0
      }
    },
    "purchase": {
      "virtual_currency_amount": 0,
      "purchase_amount": 0.39,
      "virtual_currency": {
        "amount": null,
        "currency": null
      },
      "simple_checkout": {
        "amount": null,
        "currency": null
      },
      "virtual_items": {
        "amount": 0.39,
        "currency": "USD",
        "content": "1 Sheep"
      },
      "items_amount": 1,
      "pin_codes": {
        "amount": 0.39,
        "currency": "USD",
        "content": "1 Sheep"
      },
      "subscription": {
        "amount": 0.39,
        "currency": "USD",
        "content": "1 Sheep"
      }
    },
    "user_balance": {
      "payment_currency": {
        "deduction_amount": 0,
        "purchase_amount_from_balance": 0,
        "payout_amount_from_balance": 0
      }
    }
  }
]
[
  {
    "transaction": {
      "project": {
        "id": 14004,
        "name": "Farm Fresh"
      },
      "payment_method": {
        "id": 26,
        "name": "Visa Mastercard"
      },
      "transfer_date": "2015-04-27T21:55:00+03:00",
      "id": 1,
      "refund_reason": null,
      "refund_reason_comment": null,
      "external_id": null,
      "status": "done",
      "dry_run": 0,
      "custom_parameters": null,
      "direct_account": 0
    },
    "user": {
      "id": "user_1",
      "name": "John Smith",
      "custom": null,
      "email": null,
      "phone": null,
      "country": "US",
      "marketplace": "PayStation"
    },
    "payment_details": {
      "payment": {
        "currency": "USD",
        "amount": 0.39,
        "amount_from_ps": 0.39
      },
      "commission_xsolla": {
        "amount": 0.02,
        "percent": 5
      },
      "commission_ps": {
        "amount": 0.02,
        "percent": 5,
        "fixed_amount": 0
      },
      "payout": {
        "amount": 0.35,
        "percent": 90,
        "currency": "USD",
        "fx_rate": 1,
        "amount_from_ps": 0.35
      },
      "commission_agent": {
        "amount": 0.04,
        "percent": 10
      },
      "commission_user": {
        "amount": 0,
        "percent": 0
      },
      "vat": {
        "user_amount": 0,
        "user_percent": 0,
        "amount": 0,
        "percent": 0
      },
      "repatriation_costs": {
        "percent": 0,
        "amount": 0
      },
      "commission_agent_fixed": 0,
      "sales_tax": {
        "percent": 0,
        "amount": 0
      },
      "commission_ps_from_vat": {
        "amount": 0
      }
    },
    "purchase": {
      "virtual_currency_amount": 0,
      "purchase_amount": 0.39,
      "virtual_currency": {
        "amount": null,
        "currency": null
      },
      "simple_checkout": {
        "amount": null,
        "currency": null
      },
      "virtual_items": {
        "amount": 0.39,
        "currency": "USD",
        "content": "1 Sheep"
      },
      "items_amount": 1,
      "pin_codes": {
        "amount": 0.39,
        "currency": "USD",
        "content": "1 Sheep"
      },
      "subscription": {
        "amount": 0.39,
        "currency": "USD",
        "content": "1 Sheep"
      }
    },
    "user_balance": {
      "payment_currency": {
        "deduction_amount": 0,
        "purchase_amount_from_balance": 0,
        "payout_amount_from_balance": 0
      }
    }
  }
]

Get Payouts

Lists all payouts for a period.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transfers

Parameter Type Description
merchant_id
integer Merchant ID.
datetime_from
datetime Period start.
datetime_to
datetime Period end.
integer ID of the developer’s legal entity.
status
string Payout status:
  • hold: waiting for a request to proceed
  • ready: payout in progress
  • paid: payout completed
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListTransfersRegistry(array(
));
GET /merchant/v2/merchants/{merchant_id}/reports/transfers?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transfers?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
            'payout' =>
                array (
                    'id' => 1,
                    'date' => '2014-01-03T00:00:00+04:00',
                    'note' => '12/05/2013 - 01/04/2014',
                    'currency' => 'USD'
                ),
            'transfer' =>
                array (
                    'date' => '2014-01-05T00:00:00+04:00',
                    'note' => '004357',
                    'currency' => 'USD'
                ),
            'rate' => 1,
            'canceled' => 0
        )
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "payout": {
            "id": 1,
            "date": "2014-01-03T00:00:00+04:00",
            "note": "12/05/2013 - 01/04/2014",
            "currency": "USD"
        },
        "transfer": {
            "date": "2014-01-05T00:00:00+04:00",
            "note": "004357",
            "currency": "USD"
        },
        "rate": 1,
        "canceled": 0
    }
]
[
    {
        "payout": {
            "id": 1,
            "date": "2014-01-03T00:00:00+04:00",
            "note": "12/05/2013 - 01/04/2014",
            "currency": "USD"
        },
        "transfer": {
            "date": "2014-01-05T00:00:00+04:00",
            "note": "004357",
            "currency": "USD"
        },
        "rate": 1,
        "canceled": 0
    }
]

Get Reports

Gets the list of financial reports over a specified period.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports

Parameter Type Description
merchant_id
integer Merchant ID.
datetime_from
datetime Period start.
datetime_to
datetime Period end.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListReportsRegistry(array(
));
GET /merchant/v2/merchants/{merchant_id}/reports?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports?datetime_from=2014-10-14T00%3A00%3A00Z&datetime_to=2014-10-15T00%3A00%3A00Z' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'report_id' => '5514',
        'datetime' => '2014-02-01T00:00:00+04:00',
        'show_name' => 'EUR',
        'agreement_num_doc' => 'Test1-1',
        'isAgreementDrafts' => '0'
    ),
    array (
        'report_id' => '5248',
        'datetime' => '2014-01-01T00:00:00+04:00',
        'show_name' => 'EUR',
        'agreement_num_doc' => 'Test1-1',
        'isAgreementDrafts' => '0'
    )
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "report_id": "5514",
        "datetime": "2014-02-01T00:00:00+04:00",
        "show_name": "EUR",
        "agreement_num_doc": "Test1-1",
        "isAgreementDrafts": "0"
    },
    {
        "report_id": "5248",
        "datetime": "2014-01-01T00:00:00+04:00",
        "show_name": "EUR",
        "agreement_num_doc": "Test1-1",
        "isAgreementDrafts": "0"
    }
]
[
    {
        "report_id": "5514",
        "datetime": "2014-02-01T00:00:00+04:00",
        "show_name": "EUR",
        "agreement_num_doc": "Test1-1",
        "isAgreementDrafts": "0"
    },
    {
        "report_id": "5248",
        "datetime": "2014-01-01T00:00:00+04:00",
        "show_name": "EUR",
        "agreement_num_doc": "Test1-1",
        "isAgreementDrafts": "0"
    }
]

Refund Request

Sends a refund request to return a payment to a user.

HTTP REQUEST

PUT https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/{transaction_id}/refund

Parameter Type Description
merchant_id
integer Merchant ID.
transaction_id
integer Transaction ID.
description
string Reason for refund.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->CreateRefundRequest(array(
    'transaction_id' => 'TRANSACTION_ID',
    'request' => array(
        'description' => 'Reason of refund'
    )
));
PUT /merchant/v2/merchants/{merchant_id}/reports/transactions/{transaction_id}/refund HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json

{
    "description": "Reason of refund"
}
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/reports/transactions/{transaction_id}/refund' \
-X PUT \
-u merchant_id:merchant_api_key \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
    "description": "Reason of refund"
}'
Response
<?php

$response = null;
HTTP/1.1 204 No Content

Support

Get Events

Lists all events.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/events/messages

Parameter Type Description
merchant_id
integer Merchant ID. Required.
offset
integer Number of the element from which the list is generated (the count starts from 0).
limit
integer Limit for the number of elements on the page.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListEvents(array(
));
GET /merchant/v2/merchants/{merchant_id}/events/messages HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/events/messages' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    'id' => 13962627715102,
    'short_message' => 'Welcome, Demo User!',
    'complete_description' => 'Welcome to Demo Account',
    'sender' => 'demo',
    'agent_id' => null,
    'tag_list' => array ('info')
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "id": 13962627715102,
        "short_message": "Welcome, Demo User!",
        "complete_description": "Welcome to Demo Account",
        "sender": "demo",
        "agent_id": null,
        "tag_list": [
            "info"
        ]
    }
]
[
    {
        "id": 13962627715102,
        "short_message": "Welcome, Demo User!",
        "complete_description": "Welcome to Demo Account",
        "sender": "demo",
        "agent_id": null,
        "tag_list": [
            "info"
        ]
    }
]

Get Tickets

Lists all support tickets.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/support/tickets

Parameter Type Description
merchant_id
integer Merchant ID. Required.
datetime_from
datetime Period start.
datetime_to
datetime Period end.
status
string Ticket status.
type
string Ticket type.
offset
integer Number of the element from which the list is generated (the count starts from 0).
limit
integer Limit for the number of elements on the page.
sender
string Who created the ticket. Can be ‘partner’, ‘user’, or null.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListSupportTickets(array(
    'merchant_id' => MERCHANT_ID,
    'datetime_from' => '2015-01-01T00:00:00Z',
    'datetime_to' => '2015-01-02T00:00:00Z'
));
GET /merchant/v2/merchants/{merchant_id}/support/tickets HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/support/tickets' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'id' => 1,
        'created_at' => '2014-04-04T12:20:50+0400',
        'updated_at' => '2014-04-19T04:59:17+0400',
        'type' => 'question',
        'subject' => 'Question from Demo Partner',
        'priority' => 'normal',
        'status' => 'solved',
        'author_name' => 'Demo Account',
        'sender' => 'partner',
        'is_audio' => false,
        'vote' => 0,
        'title' => '#1586052. Demo Project. Live chat'
    ),
    array (
        'id' => 2,
        'created_at' => '2014-04-04T12:20:50+0400',
        'updated_at' => '2014-04-04T13:21:02+0400',
        'type' => 'incident',
        'subject' => 'Some problem',
        'priority' => 'normal',
        'status' => 'solved',
        'author_name' => 'Demo Account',
        'sender' => 'user',
        'is_audio' => false,
        'vote' => 0,
        'title' => '#1586053. Demo Project. Live chat'
    ),
    array (
        'id' => 3,
        'created_at' => '2014-04-04T12:20:50+0400',
        'updated_at' => '2014-04-04T13:21:02+0400',
        'type' => 'incident',
        'subject' => 'Caller',
        'priority' => 'normal',
        'status' => 'solved',
        'author_name' => 'Demo Account',
        'sender' => 'user',
        'is_audio' => true,
        'vote' => 0,
        'title' => '#1586054. Demo Project. Live chat'
    )
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "id": 1,
        "created_at": "2014-04-04T12:20:50+0400",
        "updated_at": "2014-04-19T04:59:17+0400",
        "type": "question",
        "subject": "Question from Demo Partner",
        "priority": "normal",
        "status": "solved",
        "author_name": "Demo Account",
        "sender": "partner",
        "is_audio": false,
        "vote": 0,
        "title": "#1586052. Demo Project. Live chat"
    },
    {
        "id": 2,
        "created_at": "2014-04-04T12:20:50+0400",
        "updated_at": "2014-04-04T13:21:02+0400",
        "type": "incident",
        "subject": "Some problem",
        "priority": "normal",
        "status": "solved",
        "author_name": "Demo Account",
        "sender": "user",
        "is_audio": false,
        "vote": 0,
        "title": "#1586053. Demo Project. Live chat"
    },
    {
        "id": 3,
        "created_at": "2014-04-04T12:20:50+0400",
        "updated_at": "2014-04-04T13:21:02+0400",
        "type": "incident",
        "subject": "Caller",
        "priority": "normal",
        "status": "solved",
        "author_name": "Demo Account",
        "sender": "user",
        "is_audio": true,
        "vote": 0,
        "title": "#1586054. Demo Project. Live chat"
    }
]
[
    {
        "id": 1,
        "created_at": "2014-04-04T12:20:50+0400",
        "updated_at": "2014-04-19T04:59:17+0400",
        "type": "question",
        "subject": "Question from Demo Partner",
        "priority": "normal",
        "status": "solved",
        "author_name": "Demo Account",
        "sender": "partner",
        "is_audio": false,
        "vote": 0,
        "title": "#1586052. Demo Project. Live chat"
    },
    {
        "id": 2,
        "created_at": "2014-04-04T12:20:50+0400",
        "updated_at": "2014-04-04T13:21:02+0400",
        "type": "incident",
        "subject": "Some problem",
        "priority": "normal",
        "status": "solved",
        "author_name": "Demo Account",
        "sender": "user",
        "is_audio": false,
        "vote": 0,
        "title": "#1586053. Demo Project. Live chat"
    },
    {
        "id": 3,
        "created_at": "2014-04-04T12:20:50+0400",
        "updated_at": "2014-04-04T13:21:02+0400",
        "type": "incident",
        "subject": "Caller",
        "priority": "normal",
        "status": "solved",
        "author_name": "Demo Account",
        "sender": "user",
        "is_audio": true,
        "vote": 0,
        "title": "#1586054. Demo Project. Live chat"
    }
]

Get Ticket Comments

Lists all comments to a ticket.

HTTP REQUEST

GET https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/support/tickets/{ticket_id}/comments

Parameter Type Description
merchant_id
integer Merchant ID.
ticket_id
integer Ticket ID.
Copy
Full screen
  • php
  • http
  • curl
Request
<?php

$response = $xsollaClient->ListSupportTicketComments(array(
    'ticket_id' => 'TICKET_ID'
));
GET /merchant/v2/merchants/{merchant_id}/support/tickets/{ticket_id}/comments HTTP/1.1
User-Agent: xsolla-api-client/1.0
Host: api.xsolla.com
Accept: application/json
Authorization: Basic ZGVtb0B4c29sbGEuY29tOmRlbW8=
Content-Type: application/json
$ curl -v 'https://api.xsolla.com/merchant/v2/merchants/{merchant_id}/support/tickets/{ticket_id}/comments' \
-X GET \
-u merchant_id:merchant_api_key
Response
<?php

// example response
$response = array (
    array (
        'id' => 1,
        'body' => 'Hello, i made a payment, but i do not see it on my account. Please help',
        'created_at' => '2014-04-04T11:20:50Z',
        'author_name' => 'Demo User',
        'public' => true
    ),
    array (
        'id' => 2,
        'body' => 'Hello Demo user, may you please provide us with the transaction number for your payment (it will contain 9 digits and start with 12).',
        'created_at' => '2014-04-04T12:21:02Z',
        'author_name' => 'Demo Analyst',
        'public' => true
    ),
    array (
        'id' => 3,
        'body' => 'Well, I closed the page with my transaction id. But i paid with my Visa card. It was a visa ending with 5676 for $20 today. Thanks',
        'created_at' => '2014-04-04T12:21:39Z',
        'author_name' => 'Demo User',
        'public' => true
    ),
    array (
        'id' => 4,
        'body' => 'Demo User, your payment has been successful and should appear on your account.',
        'created_at' => '2014-04-04T12:22:20Z',
        'author_name' => 'Demo Analyst',
        'public' => true
    )
);
HTTP/1.1 200 OK
Content-Type: application/json

[
    {
        "id": 1,
        "body": "Hello, i made a payment, but i do not see it on my account. Please help",
        "created_at": "2014-04-04T11:20:50Z",
        "author_name": "Demo User",
        "public": true
    },
    {
        "id": 2,
        "body": "Hello Demo user, may you please provide us with the transaction number for your payment (it will contain 9 digits and start with 12).",
        "created_at": "2014-04-04T12:21:02Z",
        "author_name": "Demo Analyst",
        "public": true
    },
    {
        "id": 3,
        "body": "Well, I closed the page with my transaction id. But i paid with my Visa card. It was a visa ending with 5676 for $20 today. Thanks",
        "created_at": "2014-04-04T12:21:39Z",
        "author_name": "Demo User",
        "public": true
    },    
    {
        "id": 4,
        "body": "Demo User, your payment has been successful and should appear on your account.",
        "created_at": "2014-04-04T12:22:20Z",
        "author_name": "Demo Analyst",
        "public": true
    }
]
[
    {
        "id": 1,
        "body": "Hello, i made a payment, but i do not see it on my account. Please help",
        "created_at": "2014-04-04T11:20:50Z",
        "author_name": "Demo User",
        "public": true
    },
    {
        "id": 2,
        "body": "Hello Demo user, may you please provide us with the transaction number for your payment (it will contain 9 digits and start with 12).",
        "created_at": "2014-04-04T12:21:02Z",
        "author_name": "Demo Analyst",
        "public": true
    },
    {
        "id": 3,
        "body": "Well, I closed the page with my transaction id. But i paid with my Visa card. It was a visa ending with 5676 for $20 today. Thanks",
        "created_at": "2014-04-04T12:21:39Z",
        "author_name": "Demo User",
        "public": true
    },    
    {
        "id": 4,
        "body": "Demo User, your payment has been successful and should appear on your account.",
        "created_at": "2014-04-04T12:22:20Z",
        "author_name": "Demo Analyst",
        "public": true
    }
]