Subscriber account
How it works
The subscriber account is a service that allows users to view and manage their subscriptions configured in your Xsolla project.

- the subscription details view
- the subscription management — immediate cancellation, disabling of auto-renewal, or reactivation (depending on the project settings)
- the subscription plan change
- the payment method update
- by clicking the link in Xsolla subscription-related email notifications
- from the in-game payment page
Getting subscriber account link via API
Server-side call
The call allows you to implement generation of a link to the subscriber account from the server side of your applications via an HTTP POST
request.
URL address:
https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/user_account
Authorization:
The call uses basic access authentication. All requests to API must contain the Authorization: Basic <your_authorization_basic_key>
header, where <your_authorization_basic_key>
is the merchant_id:api_key
pair encoded according to the Base64 standard.
Go to Publisher Account to find these parameters:
merchant_id
is shown:- In the Company settings > Company section.
- In the URL in the browser address bar on any Publisher Account page. The URL has the following format:
https://publisher.xsolla.com/<merchant_id>
.
api_key
is shown in Publisher Account only once when it is created and must be stored on your side. You can create a new key in the following section:- Company settings > API keys
- Project settings > API keys
Parameters:
As a path parameter, specify project_id
— project ID, which is specified in Publisher Account next to the name of your project or in the browser address bar on any page of the project. The URL has the following format: https://publisher.xsolla.com/<merchantId>/projects/<projectId>
.
Body parameters:
Parameter | Type | Description |
---|---|---|
user_v1 | string | Required. Client-side user ID. |
locale | string | Interface language in two-letter lowercase per ISO 639-1. If this parameter is not passed, the language is determined by the user’s IP address. If the passed locale is not in the Xsolla list, English is used by default. |
- curl
1curl -v https://subscriptions.xsolla.com/api/v1/projects/{projectId}/subscriptions/user_account \
2-X POST \
3-u your_merchant_id:merchant_api_key \
4-H 'Content-Type:application/json' \
5-H 'Accept: application/json' \
6-d '
7{
8 "user_v1": "user123",
9 "locale": "en"
10}'
Response example:
- json
1{
2 "redirect_url": "https://subscriptions-user-account.xsolla.com/?token=<access_token>&projectId=<project_id>&merchantId=<merchant_id>&locale=<locale>"
3}
Client-side call
The call allows you to implement generation of a link to the subscriber account from the client side of your applications via an HTTP GET
request if Xsolla Login is set up for your project.
URL address:
https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/user_account
Authorization:
The request must contain an Authorization: Bearer <client_user_jwt>
header, where <client_user_jwt>
is user’s JSON Web Token (JWT) — a unique, Base64-encoded token encoded according to the Base64 standard. To get the token:
- Use the
Register new user andAuth by username and password API calls if your application uses login and password authorization. - Use the
Auth via social network API call if your application uses authorization through social networks.
Parameters:
As a path parameter, specify project_id
— project ID, which is specified in Publisher Account next to the name of your project or in the browser address bar on any page of the project. The URL has the following format: https://publisher.xsolla.com/{merchantId}/projects/{projectId}
.
As a query parameter, specify locale
— interface language in two-letter lowercase per ISO 639-1. If this parameter is not passed, the language is determined by the user’s IP address. If the passed locale is not in the Xsolla list, English is used by default.
Request example:
- curl
1curl -v https://subscriptions.xsolla.com/api/user/v1/projects/{project_id}/subscriptions/user_account \
2-X GET \
3-u your_merchant_id:merchant_api_key \
4-H 'Content-Type:application/json' \
5-H 'Accept: application/json' \
Response example:
- json
1{
2 "redirect_url": "https://subscriptions-user-account.xsolla.com/?token=<access_token>&projectId=<project_id>&merchantId=<merchant_id>&locale=<locale>"
3}
Found a typo or other text error? Select the text and press Ctrl+Enter.