Set up order status tracking

Note
Use test web applications as an implementation example:

To grant items to the user, you need to make sure that the payment was successful.

To track the status of created orders and validate them, you will need to configure webhooks processing on the server side of your application.

Note

2 webhook receiving options have been set up on Xsolla’s side when purchasing and returning items — information with payment and transaction data and information about purchased items can come separately or can be combined into one webhook.

More information on webhook receiving options

Receiving information in combined webhooks:

If you registered in Publisher Account after January 22, 2025, you receive all the information in the Successful payment for order (order_paid) and Order cancellation (order_canceled) webhooks. In this case, you do not need to process the Payment (payment) and Refund (refund) webhooks.

Receiving information in separate webhooks:

If you registered in Publisher Account on or before January 22, 2025, you receive the following webhooks:

You need to process all incoming webhooks.

To switch to the new option with receiving combined webhooks, contact your Customer Success Managers or email to csm@xsolla.com.

For the full operation of the in-game store and payment management, it is necessary to implement the processing of the main webhooks:

If item catalog personalization is implemented on your application’s side, set up processing of Catalog personalization on the partner’s side.

Note
To receive real payments, you only need to sign the licensing agreement and implement processing of the webhooks:

For the full list of webhooks and general information about working with them, refer to the webhooks documentation.

PHP SDK
Use ready classes for processing webhooks.

Set up webhooks sending

To configure webhooks on the Xsolla side:

  1. Open your project in Publisher Account.
  2. Click Project settings in the side menu and go to the Webhooks section.
  3. In the Webhook URL field, specify the URL to which Xsolla will send webhooks.
Notice
To receive webhooks, specify the URL of your server in https://example.com format. HTTPS protocol is required to transfer data; HTTP protocol is not supported.
Note
To test webhooks, you can also choose any dedicated site, such as webhook.site, or a platform, such as ngrok. For a real project, you need to add purchase validation logic.
  1. Click Enable webhooks.

Add webhook listener

Webhook listener is program code that allows receiving incoming webhooks at a specified URL address, generating a signature, and sending a response to the Xsolla webhook server.

Generation of signature

When receiving a webhook, you should ensure the security of data transmission. To achieve this, a signature must be generated from the webhook data and verified that it matches the signature sent in the HTTP request header.

To generate a signature:

  1. Concatenate the JSON from the request body and the project’s secret key.
  2. Apply the SHA-1 cryptographic hash function to the string obtained in the first step.

Sending responses to webhook

To confirm receipt of the webhook, your server must return:

  • 200, 201, or 204 HTTP code in case of a successful response.
  • 400 HTTP-code with description of the problem if the specified user was not found or an invalid signature was passed.

Your webhook handler may also return a 5xx code in case of temporary issues on your server.

If the Xsolla server doesn’t receive a response to the Successful payment for order and Order cancellation webhooks or receives a response with a 5xx code, the webhooks are resent according to the following schedule:

  • 2 attempts with a 5-minute interval
  • 7 attempts with a 15-minute interval
  • 10 attempts with a 60-minute interval

Maximum of 20 attempts to send webhooks are made within 12 hours from the first attempt.

If the Xsolla server doesn’t receive a response to Payment webhook or Refund webhook, or receives a response with a 5xx code, webhooks are also resent with an increased time interval. A maximum of 12 attempts are made within 12 hours.

If the Xsolla server doesn’t receive a response to the User validation webhook or receives a response with a code of 400 or 5xx, the User validation webhook is not resent.

In this case, an error is shown to the user and the Payment and Successful payment for order webhooks are not sent.

Note
The complete list and mechanism of webhooks, along with detailed examples of their processing, are described in the webhooks documentation.
Was this article helpful?
Thank you!
Is there anything we can improve? Message
We’re sorry to hear that
Please explain why this article wasn’t helpful to you. Message
Thank you for your feedback!
We’ll review your message and use it to help us improve your experience.
Last updated: January 23, 2025

Found a typo or other text error? Select the text and press Ctrl+Enter.

Report a problem
We always review our content. Your feedback helps us improve it.
Provide an email so we can follow up
Thank you for your feedback!