Xsolla-logo

Grant items by purchases to users

post/v2/project/{project_id}/inventory/purchase

Adds the specified items by purchase to the specified user inventories.

Attention

Only 50 operations can be processed at once. Operations that exceed this limit will be ignored.
SecuritybasicAuth
Request
path Parameters
project_id
required
integer
Default: 44056

Project ID.

Request Body schema: application/json
Array
required
object
id
string
Default: "d342dad2-9d59-11e9-a384-42010aa8003f"

The unique user identifier on the platform.

required
Array of objects non-empty
Array (non-empty)
sku
required
string
Default: "booster_mega_1"

Item class identifier. The SKU may only contain lowercase Latin alphanumeric characters, periods, dashes, and underscores.

quantity
required
number
Default: 1

Number of items of this class needed to be granted.

required
object
amount
required
string
Default: "2.99"

Purchase amount prior to any deductions.

currency
required
string
Default: "USD"

Purchase currency in ISO 4217.

external_purchase_id
required
string
Default: "10-534-35"

Purchase invoice identifier from the platform a purchase was made on.

external_purchase_date
required
string
Default: "2020-01-01T05:00:00+05:00"

Purchase date in ISO 8601.

comment
string [ 1 .. 255 ] characters
Default: "Monthly challenge rewards"

Operation description. For example: "Monthly challenge rewards".

platform
string
Default: "xsolla"

Publishing platform the user plays on.

Enum: "playstation_network" "xbox_live" "xsolla" "pc_standalone" "nintendo_shop" "google_play" "app_store_ios" "android_standalone" "ios_standalone" "android_other" "ios_other" "pc_other"
object [ 1 .. 200 ] properties

Project specific parameters.

additional property
Array of arrays or object or string or integer or null or number or boolean
One of:
arrays
Responses
200

Successful user purchase.

422

Unprocessable Entity.

Request samples
application/json
[
  • {
    }
]
Response samples
application/json
{
  • "count": 2,
  • "operations": [
    ]
}