Xsolla-logo

Add payment accountWebhook POST

Xsolla sends a webhook with the payment_account_add type to the webhook URL whenever a user adds a payment account or saves a payment account when purchasing something inside the game. To receive this webhook, contact your Customer Success Manager or email csm@xsolla.com.

Request
Request Body schema: application/json
notification_type
required
string

Notification type.

object

Custom project settings (object).

project_id
integer

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

merchant_id
integer

Merchant ID.

object

User details (object).

id
required
string

User ID.

ip
string

User IP.

email
string

User email.

name
string

Username.

country
string

User’s country. Two-letter uppercase ISO 3166-1 alpha-2 country code.

zip
string

User’s ZIP or postal code.

object

Payment account details (object).

id
required
string

Payment account ID.

name
string

The payment account name in the payment system (e.g., payment card number, email).

payment_method
integer

Payment method ID.

country
string

Country of the payment account. For example, the country of the bank issuing the card or the country specified when creating a PayPal account. Two-letter uppercase ISO 3166-1 alpha-2 country code.

type
string

Type of payment account (e.g., card, PayPal).

Responses
204

Return to indicate successful processing.

400

Return in case of an error in the provided information (e.g., a required parameter missing, failed authorization, etc.).

500

Return to indicate temporary errors with your servers.

Request samples
curl -v 'https://your.hostname/your/uri' \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Signature d09695066c52c1b8bdae92f2d6eb59f5b5f89843' \
-d '{
    "notification_type":"payment_account_add",
    "settings": {
      "project_id": 18404,
      "merchant_id": 2340
    },
    "user": {
        "ip": "127.0.0.1",
        "email": "email@example.com",
        "id": "1234567",
        "name": "John Smith",
        "country": "US",
        "zip": "12345"
    },
    "payment_account": {
        "id": "12345678",
        "name": "email@example.com",
        "payment_method": "24",
        "country": "US",
        "type": "paypal"
    }
}'
Response samples
application/json
{
  • "error": {
    }
}