Sent when a user purchases something inside the game. Specifies the change in the user’s balance.
notification_type | string Notification type. | ||||
object Custom project settings (object). | |||||
| |||||
operation_type | string Type of operation. | ||||
id_operation | integer Operation ID in Xsolla database. | ||||
object User details (object). | |||||
object User balance data (object). | |||||
items_operation_type | string Type of operation made with virtual items. | ||||
Array of objects Virtual items within the purchase. | |||||
Return to indicate successful processing.
Return in case of an error in the provided information (e.g., a required parameter missing, failed authorization, etc.).
Return to indicate temporary errors with your servers.
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" }'
{- "error": {
- "code": "INVALID_USER",
- "message": "Invalid user"
}
}