Checkout 3.0
Email known callback

Email known callback

Optional callback that allows a partner to get notified about the latest known email inside Checkout 3.

The callback is triggered when a valid email is entered into Checkout3 and whenever the email is updated during the checkout session.

  • The callback is triggered only when a change in the invoicing address email is detected.
  • The callback is not triggered if the Checkout is set to skip theEmailZipEntry step (configured in Checkout Setup) and the beforeSubmit callback is not enabled. This is because the verified data becomes available only after the user completes the purchase.

Registering callback

To use this optional callback, a partner has to pass an additional flag emailKnownCallback to avardaCheckoutInit. Please refer to Showing the checkout form for additional info about Checkout 3 Form initialisation.

Callback payload

Callback payload is object with email property as the first parameter and checkoutInstance as the second parameter (it is not necessary to use it). The email property contains the latest validated email. Below you can see a code example.

<script>
  var emailKnownCallback = function ({ email }, checkoutInstance) {
    console.log('Current Email: ', email);
 
    // Use data for your business logic
  };
</script>