Set customer's email in checkout process.

Ecwid.Cart.setCustomerEmail(email, successCallback, errorCallback);

Make sure to use it on pages, where the email is not shown so that it is always up-to-date. If a customer is logged in, your set email will overwrite the email for that customer's account (if possible).

Set customer email example:
Ecwid.Cart.setCustomerEmail('[email protected]');

Subscribe to the Ecwid.OnAPILoaded JS API event to ensure availability of this function.


emailstringCustomer email address to be set
successCallbackfunctionSuccess callback function
errorCallbackfunctionError callback function


Parameters in bold are mandatory

errorCallback structure is: errorCallback(errCode, errMsg)

errCodenumberError code
errMsgstringError message


Error codeError message
0Missing argument
100Incorrect data passed