Xsolla-logo

Grant entitlement (admin)Server-sideAdmin

post/v2/project/{project_id}/admin/entitlement/grant

Grants entitlement to user.

Attention

Game codes or games for DRM free platform can be granted only.
SecuritybasicAuth
Request
path Parameters
project_id
required
integer

Project ID. You can find this parameter in your Publisher Account next to the name of the project.

Example: 44056
Request Body schema: application/json
user_external_id
required
string

Unique user identifier.

required
object

Object with game properties.

sku
required
string [ 1 .. 255 ] characters ^[a-zA-Z0-9_\\-–.]*$

Unique key package ID.

required
object

Object with DRM properties.

sku
required
string

Unique DRM ID.

Enum: "steam" "playstation" "xbox" "uplay" "origin" "drmfree" "gog" "epicgames" "nintendo_eshop" "discord_game_store" "oculus" "rockstar" "viveport" "stadia"
mode
required
string

What type of entitlements should be granted. If the parameter is set to sandbox, the entitlement will be granted to the user in the sandbox mode. If the parameter is set to default, the entitlement will be granted to the user in the live mode.

Enum: "default" "sandbox"
code
string or null

Game code of the game.

user_country
string or null

User's country.

Responses
200

Entitlement was granted.

403

Authorization header not sent.

404

Game code not found. Make sure the code and project_id are correct.

422

Invalid request.

Request samples
application/json
{
  • "user_external_id": "user-external-id",
  • "game": {
    },
  • "drm": {
    },
  • "code": "AAAA-BBBB-CCCC-DDDD",
  • "mode": "default",
  • "user_country": "US"
}
Response samples
application/json
{
  • "statusCode": 403,
  • "errorCode": 0,
  • "errorMessage": "Authorization header not sent"
}