Xsolla-logo
  • 文档
  • 创建帐户

用户验证Webhook POST

Xsolla sends a webhook with the user_validation type to the webhook URL to verify that a user is registered in the game. The request is sent multiple times as part of the payment process:

  • when a user chooses a payment method in the payment UI
  • when a user enters data in the payment form, e.g., bank card data or the ZIP code when paying via PayPal
  • when a user clicks Pay now to proceed with payment
  • when payment process is completed and the transaction status changes to done

The request is sent when paying with any payment methods.

You can give permissions to receive detailed information in webhooks. To do that, you can set the following toggles to On in Publisher Account in the Project settings > Webhooks > Advanced settings section:

Toggle Description
Send only necessary user parameters without sensitive data

Only the following information about the user is passed in the webhook:

  • ID
  • country
Send custom parameters Information about custom token parameters is passed in the webhook.
Request
Request Body schema: application/json
notification_type
required
string

通知类型。

object

带有自定义项目设置的对象。

merchant_id
integer

商户ID。

project_id
integer

项目编号。您可以在您的发布商帐户项目名称旁边。

object

用户详情(对象)。

id
required
string

用户ID。

country
string

用户所在国家/地区。使用ISO 3166-1 alpha-2 标准规定的2字母组合表示国家/地区。

email
string

用户电子邮件。

ip
string

用户 IP 地址。

name
string

用户名。

phone
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 '{
    "notification_type":"user_validation",
    "settings": {
      "project_id": 18404,
      "merchant_id": 2340
    },
    "user": {
        "ip": "127.0.0.1",
        "phone": "18777976552",
        "email": "email@example.com",
        "id": "1234567",
        "name": "John Smith",
        "country": "US"
    }
}'
Response samples
application/json
{
  • "error": {
    }
}