Xsolla-logoXsolla Developers
or
To Publisher Account

User balance: Redeem couponWebhook POST

Sent when a user redeems a coupon to receive virtual items or virtual currency.

Request
Request Body schema: application/json
notification_type
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.

operation_type
string

Type of operation.

id_operation
integer

Operation ID in Xsolla database.

object

User details (object).

id
required
string

User ID.

name
string

Username.

email
string

User email.

object

User balance data (object).

old_value
string

Balance before transaction.

new_value
string

Balance after transaction.

diff
string

Quantity of virtual currency in the purchase.

items_operation_type
string

Type of operation made with virtual items.

items
Array of objects

Virtual items within the purchase.

object

Coupon details (object).

coupon_code
string

Coupon code.

campaign_code
string

Campaign code.

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 13342703ccaca5064ad33ba451d800c5e823db8f' \
-d '{
        "settings": {
            "project_id": 18404,
            "merchant_id": 2340
        },
        "virtual_currency_balance": {
            "old_value": "0",
            "new_value": "0",
            "diff": "0"
        },
        "user": {
            "name": "Xsolla User",
            "id": "1234567",
            "email": "email@example.com"
        },
        "operation_type": "coupon",
        "notification_type": "user_balance_operation",
        "items_operation_type": "add",
            "items": [{
                "sku": "com.xsolla.item_1468",
                "amount": "2"
            }],
        "id_operation": "66989",
        "coupon": {
            "coupon_code": "test123",
            "campaign_code": "Xsolla Campaign"
        }
    }'
Response samples
application/json
{
  • "error": {
    }
}