Xsolla-logoXsolla Developers
または
パブリッシャーアカウントへ

ユーザ残高:購入Webhook POST

ユーザーがゲーム内で何かを購入したときに送信されます。ユーザの残高の変更を詳述します。

Request
Request Body schema: application/json
id_operation
integer

エクソラデータベースの操作ID。

Array of objects

購入内の仮想アイテム。

Array
amount
integer

アイテム数量。

sku
string

アイテムID。

items_operation_type
string

仮想アイテムで行われる操作の種類。

notification_type
string

通知タイプ。

operation_type
string

操作の種類。

object

カスタムプロジェクト設定(オブジェクト)。

merchant_id
integer

マーチャントID。

project_id
integer

プロジェクトID。このパラメータは、ドメインページのプロジェクト名の横にあります。

object

ユーザーの詳細(オブジェクト)。

id
required
string

ユーザーID。

email
string

ユーザーのEメール。

name
string

ユーザー名。

object

ユーザ残高:内部操作

diff
string

購入時の仮想通貨の数量。

new_value
string

トランザクション後の残高。

old_value
string

トランザクション前の残高。

Responses
204

処理の成功を示すために戻ります。

400

提供された情報(たとえば、必要なパラメーターの欠落、認可の失敗など。)にエラーが発生した場合に戻ります。

500

リターンはサーバーに一時的なエラーが発生したことを示します。

Request samples
curl -v 'https://your.hostname/your/uri' \
-X POST \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-H 'authorization: Signature 13342703ccaca5064ad33ba451d800c5e823db8f' \
-d '{
        "settings": {
            "project_id": 18404,
            "merchant_id": 2340
        },
        "virtual_currency_balance": {
            "old_value": "0",
            "new_value": "200",
            "diff": "200"
        },
        "user": {
            "name": "Xsolla User",
            "id": "1234567",
            "email": "email@example.com"
        },
        "operation_type": "inGamePurchase",
        "notification_type": "user_balance_operation",
        "items_operation_type": "add",
            "items": [{
            "sku": "com.xsolla.item_1468",
            "amount": "2"
            }],
        "id_operation": "66989"
    }'
Response samples
application/json
{
  • "error": {
    }
}