> For the complete documentation index, see [llms.txt](https://developer.paddle.com/llms.txt).

# checkout.warning

Emitted when a warning occurs on a checkout.

---

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.

{% callout type="note" %}
If data passed to Paddle.js prevents Paddle from opening a checkout, a `checkout.error` event is emitted instead.
{% /callout %}
## Schema

```yaml
title: Checkout warning
type: object
properties:
  type:
    type: string
    description: Type of error encountered.
    enum:
      - front-end_error
      - api_error
      - checkout.warning
    x-enum-descriptions:
      front-end_error:
        description: Typically means there's a problem with Paddle.js or your integration.
      api_error:
        description: Typically means there's a problem with the Paddle API.
      checkout.warning:
        description: Typically means that the data passed to checkout is invalid or incomplete.
  code:
    type: string
    description: Short snake case string that describes this error.
  detail:
    type: string
    description: Some information about what went wrong as a human-readable string.
  documentation_url:
    type: string
    description: Link to a page in the error reference for this specific error.
  errors:
    type: array
    description: List of errors.
    items:
      type: object
      properties:
        field:
          type: string
          description: Field where validation error occurred.
        message:
          type: string
          description: Information about how the field failed validation.
```

## Example

```json
{
  "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."
    }
  ]
}
```
