top of page

Copied

Introducing Wix Headless: use Wix business solutions on any platform


illustration of Wix Headless infrastructure

For years, Wix has been working on solutions and tools to help businesses enjoy creative freedom online. Whether you owned a restaurant and needed a sophisticated way to collect reservations, or you were a brand owner looking to launch your first eCommerce store—Wix had something for you.

Now, you can access any of Wix’s tools from anywhere on the web with Wix Headless, a cutting-edge API and convenience SDK(node), backed by enterprise-grade performance, security and reliable infrastructure.


True to our mission, Wix Headless lets you freely access the same business management platform and services that power businesses on Wix, from any app or website that you’re building.


For example, consider the Wix and Netlify integration. Netlify was our first design partner, making use of Wix Headless to give their users access to Wix’s powerful scheduling and booking services. Keep reading to discover how Wix Headless works.



menu of categories showing Wix's business solutions


How can Wix Headless benefit you?


While helpful for making a website, an all-in-one, no-code site-builder often comes with limitations that can hinder your business's growth. Wix Headless addresses these common pain points in the following ways:


  1. Future-proofing: Wix Headless offers a flexible and scalable solution that grows with your business, supported by Wix's comprehensive range of commerce, business and marketing tools. This ensures that as your business evolves or expands to new platforms, you won't need to spend time and money rebuilding critical infrastructure from scratch.

  2. Optimized frontend design: Traditional no-code or low-code site generators often limit your design choices, forcing you to conform to the decisions made by their developers. However, front-ends should not be "one-size-fits-all," as tailored optimizations may be necessary for specific use cases. Wix Headless empowers you to craft your unique frontend design, resulting in a cleaner and more optimized user experience, while still benefiting from the convenience of Wix's Business Services and robust management dashboard.

  3. Comprehensive business management dashboard: Wix Headless provides an all-inclusive back office system that enables businesses to manage and monitor their operations efficiently. The intuitive dashboard offers a centralized location for tracking key performance indicators, managing customer data and overseeing sales and marketing efforts. This powerful tool ensures that you have complete control over your business, allowing you to make data-driven decisions and streamline processes.

  4. Streamlined API integration: Wix Headless consolidates a wide range of backend services into a single, holistic API, simplifying the process of managing your business. This eliminates the need to rely on multiple APIs with varying billing cycles and integration complexities. The Wix Headless API includes powerful modules for essential business functions, such as eCommerce, Bookings, Events and Pricing Plans. By offering a comprehensive suite of services within a single API, Wix Headless simplifies your development process and streamlines your business operations. And, if your project requires additional APIs, you are free to integrate them as needed.



illustration of the Wix Headless API


Wix Headless in action: WhatsApp chatbot integration


Wix Headless can be used in a multitude of ways, from creating more engaging shopping experiences across multiple devices, to delivering different types of content to diverse user groups.


Here’s a more specific scenario: Imagine you own an online store and want to provide a unique shopping experience for your customers through a popular messaging platform like WhatsApp. Wix Headless allows you to build a chatbot that seamlessly integrates with your Wix store, enabling customers to browse products and add items to their cart directly within the WhatsApp platform.



example of how Wix Headless can help you integrate Wix stores with WhatsApp to enable chatbot shopping


To achieve this chatbot integration, you can refer to this code as an example. Here’s a brief overview of the key components of this chatbot integration:

  • wix_client.mjs: Sets up the Wix API client and handles OAuth authentication, enabling the chatbot to communicate with the Wix store through the Headless API.

  • message_handler.mjs: Handles incoming WhatsApp messages and user interactions, managing the chat flow.

  • products_api.mjs: Retrieves the available products from the Wix store.

  • token_management.mjs: Manages user tokens and authentication for the Wix API, allowing the chatbot to interact with the Wix store on behalf of individual users.


The chatbot guides customers through the entire shopping process, providing a product catalog view, individual product information (including images) and options to add items to the cart or proceed to the checkout.


Here’s a breakdown of the WhatsApp chatbot’s flow, demonstrating how the Wix Headless API is utilized:


  1. The chatbot displays the product catalog, allowing users to browse available products. This is made possible through the Wix Headless API, which retrieves the product information from the Wix store.

  2. Users can select a product by sending the corresponding number.

  3. The chatbot then displays detailed information and an image of the selected product.

  4. Users can add the selected product to their cart. This action uses the Wix Headless API to manage the user's cart within the Wix store.

  5. The chatbot confirms the product has been added to the cart and displays the current cart items.

  6. Customers can either proceed to checkout or return to the product list to continue shopping.

  7. When users are ready to check out, the chatbot provides a link to complete the payment process on the store's website. The Wix Headless API is used to create a checkout session and generate the corresponding payment URL.


Here's a bit more technical detail on how this all works:


  • The Wix Headless API is used to fetch the list of available products in the store. This is done using the getAvailableProducts() function in the products_api.mjs file, which calls the wixClient.products.queryProducts().find() method.

  • The chatbot maintains the state of each user's interaction with the store, such as their current stage in the shopping flow, the products they have viewed and the items they have added to their cart. This state management is implemented using the getUserState(), setUserState() and removeUserState() functions in the state_manager.mjs file.

  • The handleMessage() function in the message_handler.mjs file is the main entry point for processing incoming messages from WhatsApp users. It uses the user's current state to determine how to respond to their input, such as displaying a list of products, showing details about a specific product or adding an item to their cart.

  • To add items to the user's cart, the handleAddToCart() function calls the wixClient.currentCart.addToCurrentCart() method. When the user is ready to check out, the handleCheckout() function creates a checkout session using the wixClient.currentCart.createCheckoutFromCurrentCart() method and provides the user with a link to complete their purchase on the Wix store's website.


This example showcases the limitless potential of Wix's Business Solutions when combined with popular messaging platforms like WhatsApp. By allowing customers to complete the entire shopping experience within the familiar interface of WhatsApp, you could better drive user engagement and increase conversions.



Empower your business with Wix Headless


This innovative platform empowers you to craft exceptional, captivating experiences across diverse channels, leveraging the comprehensive capabilities, robustness and user-friendliness of Wix's Business Services. Simultaneously, Wix Headless ensures you retain complete authority over your brand identity, data management and customer relationships.



To get started with Wix Headless, check that you have a Wix premium plan and follow our guide for getting set up.

Was this article helpful?

bottom of page