Use checkout.warning to run actions when a warning occurs on a checkout. Warnings occur when something is wrong with data passed to Paddle.js, but it doesn't prevent Paddle from opening a checkout.
For example, if you prefill customer details but the details you passed aren't valid, you can use checkout.warning to display a custom error message to the customer or log the warning to your analytics tool.
If data passed to Paddle.js prevents Paddle from opening a checkout, a checkout.error event is emitted instead.
typestring
Type of error encountered.
Values
front-end_errorTypically means there's a problem with Paddle.js or your integration.api_errorTypically means there's a problem with the Paddle API.checkout.warningTypically means that the data passed to checkout is invalid or incomplete.
codestring
A short string that identifies the warning.
detailstring
A human-readable string summarizing what went wrong, useful for logging and debugging. The exact wording can change, so don't rely on it in conditional logic. Per-field details are in the
errors array.documentation_urlstring
Link to documentation related to this error.
errorsarray
List of errors.
fieldstring
Field where validation error occurred.
messagestring
Information about how the field failed validation.
{ "type": "checkout.warning", "code": "checkout_creation_invalid_field", "detail": "Invalid values for fields in request", "documentation_url": "https://developer.paddle.com/errors/shared/invalid_field", "errors": [ { "field": "/data/customer", "message": "Either id or email is required when customer is present." } ]}