Errors

To receive information about errors that appear during the payment process:

  1. Add the handling of the show_errors event for displaying errors.

Example:

Copy
Full screen
Small screen
headlessCheckout.form.onNextAction((nextAction) => {
      switch (nextAction.type) {
        case 'show_errors': {
          this.errors = nextAction.data.errors;
        }
      }
});
  1. Add the error display to the HTML markup of the payment UI.

Example:

Copy
Full screen
Small screen
@if (errors.length) {
  Errors:
  @for (error of errors) {
    <div>{{error.message}}</div>
  }
}

List of errors
Refer to the list of errors and their troubleshooting.
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: March 5, 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!
We couldn't send your feedback
Try again later or contact us at doc_feedback@xsolla.com.