Automate project creation and developer invitations via API
This is useful when:
- You connect games from third-party developers to your platform and want each developer to manage only their own game.
- You launch new games or products often and want to avoid manual setup.
Limitations:
- Xsolla assigns invited developers the owner role on the new project only. It can’t be customized per individual API request. You can change the role later in Publisher Account in the Company settings > Users section.
- Xsolla assigns invited developers the owner role on the new project only. It can’t be customized per individual API request. You can change the role later in your account in the Settings > Members section.
- Xsolla assigns invited developers the owner role on the new project only. It can’t be customized per individual API request. You can change the role later in your account in the Settings > Members section.
- Xsolla assigns invited developers the owner role on the new project only. It can’t be customized per individual API request. You can change the role later in your account in the Settings > Members section.
- Xsolla assigns invited developers the owner role on the new project only. It can’t be customized per individual API request. You can change the role later in your account in the Settings > Members section.
- Xsolla does not automatically delete projects created accidentally or via spam submissions. You can delete such a project yourself if you have the owner or developer role. If the project already has live transactions, it can’t be deleted. In this case, contact your Customer Success Manager.
How it works
To trigger automated project creation, send an API request containing the game title and the email of the developer who needs access.
For example, a developer submits their game details through an onboarding form. Your backend forwards the title and email to the Xsolla server. Xsolla then creates a project in your account and invites the developer by email.
Interaction flow:
- Your server gets a server token from Xsolla Login server.
- Your server sends Xsolla server a request with the game title and the developer’s email.
- Xsolla server accepts the request, creates the project, and invites the developer in the background.
- Your server polls the status endpoint until the request is
done(optional). - The developer receives an email: an invitation, or a notification if they already have projects in your account. If the developer already has the owner or developer role on all projects, no email is sent.
Invited developers are granted access only to the new project with the owner role. They receive no merchant-level permissions. They can manage the item catalog and promotions in this project but can’t refund payments.
If the developer already has access to projects in your account, the result depends on their current role:
- If they have the owner or developer role on specific projects, they are added to the new project with no changes to their existing permissions.
- If they are an owner or developer across all projects, they already have access, so nothing changes.
- If they have any other role (e.g., finance or support), the invitation fails and they are not added.
%%{init: {'themeVariables': { 'noteBkgColor': 'transparent', 'noteBorderColor': 'transparent' }}}%%
sequenceDiagram
participant S as Your server
participant L as Xsolla Login server
participant A as Xsolla server
participant D as Developer
S->>+L: Sends request to get server token
L-->>-S: Returns server token (JWT)
S->>+A: Sends request to create project and invite developer
A-->>-S: Returns HTTP code 202 with request ID
par Background processing
activate A
note right of A: 1. Creates the project in your account (state: project_creating, project_created).
note right of A: 2. Invites the developer to this project only (state: invited).
A-->>D: Sends email with access to the project
deactivate A
and Optional: until done is true
loop Check status
S->>+A: Sends request to check status
A-->>-S: Returns state: invited, done: true
end
end
Prerequisites
- Set up a server OAuth 2.0 client:
- Open your project in Publisher Account and go to the Players > Login section.
- Click Configure in the pane of a Login project.
- Go to the Security block and select the OAuth 2.0 section.
- Click Add OAuth 2.0 client.
- Specify the token lifetime.
- Check the Server (server-to-server connection) box.
- Click Connect.
- Copy and save the client ID and secret key.
- Set up a server OAuth 2.0 client:
- Open the project in your account and go to the Other tools > Login section.
- Click Configure in the pane of a Login project.
- Go to the Security block and select the OAuth 2.0 section.
- Click Add OAuth 2.0 client.
- Specify the token lifetime.
- Check the Server (server-to-server connection) box.
- Click Connect.
- Copy and save the client ID and secret key.
- Set up a server OAuth 2.0 client:
- Open the project in your account and go to the Players > Login section.
- Click Configure in the pane of a Login project.
- Go to the Security block and select the OAuth 2.0 section.
- Click Add OAuth 2.0 client.
- Specify the token lifetime.
- Check the Server (server-to-server connection) box.
- Click Connect.
- Copy and save the client ID and secret key.
- Set up a server OAuth 2.0 client:
- Open the project in your account and go to the Players > Login section.
- Click Configure in the pane of a Login project.
- Go to the Security block and select the OAuth 2.0 section.
- Click Add OAuth 2.0 client.
- Specify the token lifetime.
- Check the Server (server-to-server connection) box.
- Click Connect.
- Copy and save the client ID and secret key.
- Set up a server OAuth 2.0 client:
- Open the project in your account and go to the Players > Login section.
- Click Configure in the pane of a Login project.
- Go to the Security block and select the OAuth 2.0 section.
- Click Add OAuth 2.0 client.
- Specify the token lifetime.
- Check the Server (server-to-server connection) box.
- Click Connect.
- Copy and save the client ID and secret key.
- Send the client ID to your Customer Success Manager and request to enable automated project creation and developer invitations via API.
Store the secret key on your server only.
If the key is compromised, rotate it immediately: generate a new secret key for your OAuth client in your account, update it on your server, and contact your Customer Success Manager.
To rotate the key as planned, follow the same steps. The client ID stays the same, so you don’t need to notify Xsolla.
Build onboarding flow using API
Get server token
Implement a call to Xsolla Login to get a server token. You need the token to authorize the requests that create projects and check their status. For detailed information about the call, see Generate JWT.
Request
- http
1POST https://login.xsolla.com/api/oauth2/token
2Content-Type: application/x-www-form-urlencoded
Parameters:
| Parameter | Type | Description |
|---|---|---|
grant_type | string | Pass client_credentials. Required. |
client_id | string | ID of your server OAuth 2.0 client. Required. |
client_secret | string | Secret key of the same client. Required. |
Example request:
- curl
1curl -X POST "https://login.xsolla.com/api/oauth2/token" \
2 -H "Content-Type: application/x-www-form-urlencoded" \
3 -d "grant_type=client_credentials" \
4 -d "client_id=<client_id>" \
5 -d "client_secret=<client_secret>"
Response
The response contains the token and its lifetime. For the complete list of response fields and error codes, see the Generate JWT description.
| Field | Type | Description |
|---|---|---|
access_token | string | Server token (JWT). |
token_type | string | Token type. The value is bearer. |
expires_in | integer | Token lifetime in seconds. |
Pass the received token in the Authorization: Bearer <token> header of every request below. The token must:
Be issued by a client registered for your account.
Contain your merchant ID (
publisher_id).
Submit project creation request
Implement a call that creates a project in your account and invites a developer to it. In the request body, pass the game title and the developer’s email.
Request
- http
1POST https://api.xsolla.com/merchant/onboarding/submissions
2Authorization: Bearer <token>
3Content-Type: application/json
Parameters:
| Parameter | Type | Description |
|---|---|---|
game_title | string | The project name. Up to 80 characters after trimming. Can’t contain <, >, control characters, or emoji. Required. |
developer_email | string | A valid email address, up to 255 characters. Required. |
Example request:
- curl
1curl -X POST "https://api.xsolla.com/merchant/onboarding/submissions" \
2 -H "Authorization: Bearer <token>" \
3 -H "Content-Type: application/json" \
4 -d '{"game_title": "My Game", "developer_email": "[email protected]"}'
Response
The response contains the ID of your request and its processing state:
| Field | Type | Description |
|---|---|---|
request_id | integer | Request ID. |
project_id | integer or null | ID of the created project. null until the project is created. |
state | string | Current state. For possible values, see Check request status. |
done | boolean | true if processing is finished successfully. |
duplicate | boolean | true if the request repeats an earlier one. |
project_retained | boolean | true if the project exists but the invitation failed. |
Example response (for 202 code):
- json
1{
2 "request_id": 123456,
3 "project_id": null,
4 "state": "received",
5 "done": false,
6 "duplicate": false,
7 "project_retained": false
8}
Response codes:
| Code | Meaning | What to do |
|---|---|---|
202 | The request is accepted and queued. | Poll the status endpoint until done is true. |
200 | The request was already submitted. It is queued again unless it has finished. | Poll the status endpoint. |
400 | Invalid input. The reason is in the response body. | Fix the input. Don’t retry as is. |
401 | The token is missing, invalid, or expired. | Get a new token. If the error persists, check your OAuth client. |
403 | The client isn’t registered for your account. | Contact your Customer Success Manager. |
429 | The limit of 20 new requests per 24 hours is reached. | Retry later or ask your Customer Success Manager to raise the limit. |
503 | The service is temporarily unavailable. | Retry with exponential backoff. |
400 don’t count. When the limit is reached, the API returns 429. To raise the limit, contact your Customer Success Manager.Check request status
Implement a call that checks the status of a submitted request. Repeat it until done is true to know that the project is created and the developer is invited. This step is optional.
Request
- http
1GET https://api.xsolla.com/merchant/onboarding/submissions/{request_id}
2Authorization: Bearer <token>
Parameters:
| Parameter | Type | Description |
|---|---|---|
request_id | integer | Request ID from the response to the submit request. Pass it in the URL path. Required. |
Example request:
- curl
1curl -X GET "https://api.xsolla.com/merchant/onboarding/submissions/<request_id>" \
2 -H "Authorization: Bearer <token>"
Response
The response has the same fields as the response to the submit request. The state field takes these values:
| State | Meaning | What to do |
|---|---|---|
received | The request is accepted and waits for processing. | Keep polling. |
project_creating | The project is being created. The request is blocked from retrying so that a second project isn’t created. | Check the request status again in a few minutes. If the state is still project_creating, contact your Customer Success Manager. |
project_created | The project is created, and the invitation is being sent. | Keep polling. |
invited (done: true) | The project is created and the developer is invited. | - |
project_create_failed | Processing failed before the project was created. | Send the same request again. |
invite_failed | The project exists (project_retained: true), but the invitation failed. | Send the same request again; only the invitation is retried. If it fails again, the developer probably has a role that conflicts with the invitation (see How it works). Contact your Customer Success Manager. |
Example response:
- json
1{
2 "request_id": 123456,
3 "project_id": 654321,
4 "state": "invited",
5 "done": true,
6 "duplicate": false,
7 "project_retained": false
8}
Response codes:
| Code | Meaning | What to do |
|---|---|---|
200 | The request status is returned. | Check the state and done fields. |
401 | The token is missing, invalid, or expired. | Get a new token. If the error persists, check your OAuth client. |
403 | The client isn’t registered for your account. | Contact your Customer Success Manager. |
404 | The request isn’t found in your account. | Check the request_id. |
Troubleshooting
| Symptom | Cause | Solution |
|---|---|---|
Every request returns 403. | The OAuth 2.0 client isn’t registered for your account. | Contact your Customer Success Manager. |
| The token request is rejected. | The client ID or secret key is wrong, or the secret key has been rotated. | Check the credentials and use the current secret key. |
429 after about 20 requests within 24 hours. | The limit of 20 new requests per 24 hours is reached. | Retry later or ask your Customer Success Manager to raise the limit. Each request stops counting toward the limit 24 hours after it was created, so capacity returns gradually. |
503 persists. | The service is temporarily unavailable. | Retry later. If it persists, contact your Customer Success Manager. |
Found a typo or other text error? Select the text and press Ctrl+Enter.