# JS API calls

Check out the [Storefront customization options #Custom JavaScript code and Ecwid JS API](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/get-started/storefront-customization-options#custom-javascript-code-and-ecwid-js-api "mention") article to get started with Ecwid JS API.

### Auto event triggers

| [**Ecwid.OnAPILoaded.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/get-started/quickstart-customize-storefront-with-ecwid-js-api#step-3-initialize-ecwid-js-api-in-the-file) | [**Ecwid.OnCartChanged.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events/cart-details-are-changed-event) |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- |
| [**Ecwid.OnConsentChanged.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-customers-on-the-storefront/manage-customers-cookie-consent#track-changes-in-consent-value)   | [**Ecwid.OnOrderPlaced.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events/new-order-is-placed-event)      |
| [**Ecwid.OnPageLoad.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events/page-is-loaded-events)                                                             | [**Ecwid.OnPageLoaded.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events/page-is-loaded-events)           |
| [**Ecwid.OnPageSwitch.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events)                                                                                 | [**Ecwid.OnSetProfile.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events/customer-logged-in-event)        |
| [**onTileLoaded.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events/instant-site-section-load-events)                                                      | [**onTileUnloaded.add()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/track-storefront-events/instant-site-section-load-events)    |

### Storefront and customers

| [**Ecwid.getOwnerId()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/get-storefront-details/get-ecwid-store-id)                                                           | [**Ecwid.getStorefrontLang()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/get-storefront-details/get-storefront-language-and-currency)                                            |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Ecwid.formatCurrency()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/get-storefront-details/get-storefront-language-and-currency)                                     | [**Ecwid.getVisitorLocation()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/get-storefront-details/get-visitor-location)                                                           |
| [**Ecwid.Customer.get()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-customers-on-the-storefront/get-logged-in-customers-details)                                | [**Ecwid.Customer.signout()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-customers-on-the-storefront/log-out-customer)                                                     |
| [**Ecwid.getTrackingConsent()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-customers-on-the-storefront/manage-customers-cookie-consent#get-users-cookie-consent) | [**Ecwid.setTrackingConsent()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-customers-on-the-storefront/manage-customers-cookie-consent#set-cookie-consent-with-javascript) |
| [**Ecwid.openPage()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/open-page-on-the-storefront)                                                                           |                                                                                                                                                                                        |

### Cart and checkout

| [**Ecwid.Cart.get()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/get-cart-details)                                    | [**Ecwid.Cart.addProduct()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/add-product-to-the-cart)                             |
| --------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [**Ecwid.Cart.removeProduct()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/remove-products-from-the-cart)             | [**Ecwid.Cart.removeProducts(\[\])**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/remove-products-from-the-cart)               |
| [**Ecwid.Cart.clear()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/fully-clear-the-cart)                              | [**Ecwid.Cart.calculateTotal()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/calculate-cart-details)                          |
| [**Ecwid.Cart.gotoCheckout()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/send-customer-to-the-checkout)              | [**Ecwid.Cart.canGotoCheckout()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/send-customer-to-the-checkout)                  |
| [**Ecwid.Cart.setOrderComments()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/set-customers-comments-for-order)       | [**Ecwid.Cart.setCustomerEmail()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/set-customers-email-for-the-checkout)          |
| [**Ecwid.Cart.setAddress()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/set-customers-shipping-and-billing-addresses) | [**Ecwid.Cart.setBillingAddress()**](https://app.gitbook.com/s/aRJpOy0U8IpbjUfcox4D/manage-cart-and-checkout/set-customers-shipping-and-billing-addresses) |
