Understanding the API First Approach

Are you curious about building of sturdy, adaptable, and expandable online commerce systems? There are, of course, many methods to build them, but it's impossible to overemphasise the significance of the API First approach, guiding the design and architecture of many such platforms. 

Let's rewind a little and reflect upon the realm of online commerce, a world where virtual shops, transaction gateways, delivery services, and customer relationship management tools must all interact flawlessly. How do you create an ecosystem that connects all these different services, ensures they work in harmony and facilitates easy integration of new features and channels? Instead of focusing on user-facing features, we need to put at the forefront of software development the connectors between systems, fundamentally redefining how e-commerce platforms are designed and built.

This article will take you into the heart of API First, investigating its merits, its utilisation in top-tier online commerce platforms, and its capacity to noticeably improve your business operations. We aim to equip you with the understanding needed to fully appreciate this paradigm shift and harness its potential in your own organisation.

Understanding the API First Approach

To fully grasp the concept of the API First approach, we must first comprehend the role APIs (Application Programming Interfaces) play in today's digital landscape. APIs can be thought of as the glue that connects different software applications together. From the technical point of view they are sets of rules and protocols that define how different software applications communicate and interact with each other. They provide a standardised way for software components to share data and functionality, effectively acting as a kind of contract between different software modules. By abstracting the underlying implementation and exposing only the necessary objects or actions, APIs facilitate modular programming, which leads to more scalable, maintainable, and reusable code.

In the traditional software development paradigm, APIs were frequently treated as ancillary elements, developed and integrated as an afterthought once the primary software systems were already in place. This approach often resulted in APIs being retrofitted into existing systems, potentially leading to compatibility issues and less efficient communication between software components. However, with the API First approach, the development of APIs is put at the forefront of the design process. 

The API First approach entails designing APIs as the first step in the software development process, before diving into the creation of the software itself. This implies defining the contract for the API (its methods, data formats, and endpoints) before anything else, thereby ensuring that the resulting API serves as a stable foundation upon which the software is built. This approach becomes particularly beneficial when constructing robust, scalable e-commerce platforms that need to accommodate various integrations and interaction models.

So why exactly does the API First approach shine brightly in the e-commerce domain? It does so by allowing the decoupling of the frontend and backend of an e-commerce system. With APIs acting as intermediaries, the frontend can be designed to deliver a rich user experience while the backend focuses on business logic and data storage. This separation leads to modular, loosely coupled systems that can evolve independently over time, thereby ensuring long-term sustainability.

Furthermore, this decoupling facilitates the seamless integration of various components of the e-commerce ecosystem, such as payment gateways, CRM systems, logistics providers, and other third-party services. This capability to work smoothly with other services adds to the versatility and robustness of the e-commerce platform. In addition, it opens up the possibility of leveraging multiple channels of interaction, like mobile apps, social media platforms, and even IoT devices.

Looking into real-world applications, we find several leading e-commerce platforms that have embraced the API First approach. These include Saleor, Reaction Commerce (now known as Mailchimp Open Commerce), and Magento. Each of these platforms illustrates how designing with an API First mindset leads to extensible and scalable e-commerce solutions.

Saleor is a Python-based, open-source e-commerce platform that incorporates GraphQL APIs. Reaction Commerce is another open-source platform built on modern JavaScript technologies, with a strong emphasis on enabling custom e-commerce experiences via its GraphQL APIs. Magento, on the other hand, is a globally recognised e-commerce platform that offers an extensive set of APIs for integration and customisation, catering to a diverse range of business needs. In the next section you will learn more about them.

Reaction Commerce: Powering Custom E-commerce Experiences

In the arena of open-source e-commerce platforms, Reaction Commerce is a name that carries substantial weight. It's a robust platform, renowned for its commitment to the API First approach. Reaction Commerce is designed to be a reactive, real-time platform built entirely with JavaScript, which makes it a preferred choice for developers seeking to create highly reactive, customizable e-commerce experiences.

At the heart of Reaction Commerce's customization capabilities lies its GraphQL-based API. GraphQL is a modern data query and manipulation language for APIs that provides an efficient, powerful, and flexible alternative to REST. Reaction Commerce's choice of GraphQL as the backbone of its API infrastructure is strategic. By allowing clients to specify exactly what data they need, GraphQL avoids unnecessary data transfers, making APIs more efficient and faster. Furthermore, it provides developers with the ability to request complex, nested data structures with a single API call, which can significantly simplify client-side code.

Reaction Commerce's use of modern JavaScript technologies takes it a step further. JavaScript, being one of the most widely used languages in web development, ensures that developers are working with a language they are likely familiar with. By leveraging JavaScript's asynchronous nature and its vast ecosystem of libraries and frameworks, Reaction Commerce offers a highly productive and flexible environment for developers. This not only improves the development speed but also contributes to the creation of highly interactive, real-time e-commerce experiences.

Now, let's talk about real-world applications. Reaction Commerce has been adopted by a number of businesses, but some of them stand out:

  • Stephen Kenn, an LA-based design studio, provides an intriguing case study of Reaction Commerce's for end customer. Their e-commerce platform, stephenkenn.com, leverages Reaction Commerce's real-time, API First capabilities to manage their unique inventory. The real-time feature ensures immediate reflection of inventory changes, enhancing customer experience by providing accurate product availability information. The API First approach, on the other hand, facilitates seamless integration with other systems such as CRM tools or logistics management systems. This integration is crucial for efficient order processing and customer service, enabling a streamlined workflow from product selection to order fulfillment.
  • Project Ricochet, a full-service digital agency, provides a compelling case study of Reaction Commerce's capabilities. They implemented Reaction Commerce for a Fortune 10 company's internal software provisioning and subscription tool. The tool allows employees to request software, track internal chargebacks for payment, and manage the multi-step provisioning process. Reaction Commerce's real-time, API First capabilities were leveraged to create a modern, efficient, and automated system. The platform's extendibility allowed for seamless integration with the company's Microsoft Active Directory service for user authentication. Additionally, Reaction Commerce's MongoDB database was directly connected to the custom app, ensuring real-time synchronization of software product information. This eliminated the need for duplicate data management across multiple databases. The checkout experience was also heavily customized to collect specific information for software provisioning and internal billing. This case study exemplifies the technical adaptability of Reaction Commerce in a corporate setting.
  • DemandCluster, a digital marketing agency, has also adopted Reaction Commerce. Ron W. van Etten, the Head of Development at DemandCluster, has praised Reaction Commerce for its easy integration with their existing API and its modular architecture. DemandCluster has even created a boilerplate example plugin for Reaction Commerce, demonstrating how internal plugins can be moved to their own NPM packages for the Reaction API. This shows how Reaction Commerce can be extended and customized to fit specific needs.

Finally the value of API First approach has been demonstrate by strategic decistion of Mailchimp, the all-in-one marketing platform, which acquired Reaction Commerce in April 2020. The $16.1 million deal has led to the integration and enhancement of Reaction Commerce, now known as Mailchimp Open Commerce, as part of Mailchimp's developer-focused products.

Magento: The Enterprise API First E-commerce Solution

When it comes to enterprise-level e-commerce solutions, Magento stands tall among its peers. A cornerstone of the online retail industry, Magento is widely recognized for its robustness, flexibility, and rich feature set. Built primarily on PHP, Magento employs the Zend Framework and Symfony components, providing a foundation that is widely understood and accessible to a large number of developers. Magento's ownership under Adobe since 2018 further extended its capabilities, enabling integration with a host of Adobe's business tools, helping companies creating exceptional e-commerce experiences.

This open-source e-commerce platform has become in 2021 a global leader in Gartner Magic Quadrant for Digital Commerce. API First  was one of the reason for this success. One of the defining characteristics of Magento is its extensive set of APIs, built with the API First approach in mind. This architecture allows developers to integrate other systems seamlessly, be it CRM tools, ERP systems, or any other third-party applications, which are crucial for the smooth functioning of an e-commerce business. The APIs allow businesses to customize the platform to suit their unique needs, whether it's integrating new payment gateways, managing products and orders, or manipulating customer data.

The scalability and flexibility of Magento are key features that make it a favorite among enterprises. The platform is built to scale, supporting businesses as they grow from small startups to international operations. Its flexible architecture allows developers to add, modify, and expand the platform's functionalities as required. The platform also offers a rich feature set, including product management, customer service, business intelligence, marketing tools, and more, all of which can be customized and managed via the APIs.

The use of Magento's API First approach in real-world scenarios is widespread and diverse. 

  • One of the most significant examples of Magento's real-world application is the Ford Motor Company. Ford, an American automaker with an annual global revenue of $127 billion as of 2020, uses Magento to power its website and supply original accessories across its global dealer network. Ford's website offers personalization features, allowing visitors to select the model of their vehicle to view products specific to their needs. It also uses Magento's advanced search engine effectively to recommend suggestions when customers cannot find the products they need.
  • Another prominent user of Magento is the Coca-Cola Company. Coca-Cola runs a Magento 2 website retailing everything from Coca-Cola bottles to apparel, accessories, and collectibles. Magento helps Coca-Cola provide its customers with the option to personalize products by adding their names on apparel and soft drink bottles. It also allows Coca-Cola to integrate its website with its dealer network and offer a rewards program, where customers can earn a free soft drink after a certain number of purchases through Coca-Cola vending machines.
  • Procter and Gamble (P&G), a multinational consumer goods corporation with reported annual revenue of $71 billion in 2020, uses Magento to power its B2B client portal for its suppliers. This portal helps suppliers manage their accounts and orders online. Magento's unique B2B functionality like company accounts, shared catalogs, custom pricing, and private sales, along with support for integrations with ERP systems and multi-source inventory, make it an ideal choice for a globally distributed business like P&G.
  • In the tech sector, HP Inc., the world's second-largest computer vendor by sales as of January 2021, turned to Magento when it needed an upgrade and wanted a future-ready e-commerce solution for its Asia-Pacific division. With the help of Magento, HP now offers click & collect shopping across several stores in India and delivers an attractive omnichannel shopping experience to its customers in China and Hong Kong. It also provides rewards programs on its Magento 2 website, allowing customers to gather and redeem points with their purchases.

In each of these scenarios, Magento's API First approach has played a crucial role in delivering the customization required to meet specific business needs, driving growth and innovation in the e-commerce landscape.

Saleor: Empowering E-commerce with an API First Mindset

As we delve into the world of API First e-commerce platforms, one name stands out due to its robustness and innovative design: Saleor. A prime example of the API First approach in action, Saleor is an open-source e-commerce platform that has been designed with extensibility, scalability, and customization at its core. Crafted using Python and Django, Saleor embodies the ethos of open-source development, allowing developers from across the globe to contribute to its continual evolution and improvement.

The API First approach is deeply embedded in Saleor's architecture. It employs GraphQL, a modern data query and manipulation language for APIs, which provides a more efficient, powerful, and flexible alternative to REST. The choice of GraphQL is strategic, given its capability to facilitate rapid feature development and enable easy integration with other systems. It also offers clients the flexibility to request exactly what they need, thereby reducing the amount of data that needs to be transferred over the network and improving performance.

One of Saleor's distinguishing features is its modularity. This architecture essentially breaks down the platform into smaller, manageable components, each responsible for a specific functionality. Such an arrangement allows for easy extensibility and scalability through plugins, making it a breeze to add new features or services.

Building modules of Saleor are independent of each other and communicate via its own well-defined interfaces. This approach makes API robust, with extensive capabilities that facilitate customisation, as it is easy to selectively define for each module how other modules or external services can interact with it. 

This modular design, combined with an API First approach, ensures that Saleor can grow with your business, adapting to your changing needs while minimizing the need for substantial code changes. Such architecture allows businesses to tailor the platform to their specific needs, whether it's adding new payment options, integrating with third-party services, or even changing the core business logic. Furthermore, developers have the liberty to manipulate data and experiment with different use-cases without worrying about disrupting the underlying system.

Another notable feature of Saleor is its comprehensive and well-structured documentation. This resource helps developers effectively utilize Saleor's APIs and build integrations with ease. Clear, detailed API documentation is a hallmark of the API First approach, and Saleor certainly delivers on this front. Developers can easily find details about data types, mutations, queries, and endpoints, significantly reducing the learning curve associated with adopting a new platform.

But what does Saleor's API First approach look like in the real world? Let's examine some companies that have put Saleor to work.

  • Mirumee Software, the creators of Saleor, use their own platform for their e-commerce needs. It's a clear case of eating their own dog food. Their website, serves as a testament to the capabilities of Saleor. The site is shockingly responsive, user-friendly, and showcases their services and projects effectively. Moreover, they have successfully integrated their e-commerce platform with a wide range of products and services, demonstrating Saleor's flexibility and adaptability.
  • Lush Labs, a part of Lush Cosmetics, has adopted Saleor for their e-commerce platform – they have relaunched their website and app with Saleor, placing digital ethics at the core. This collaboration with Saleor showcases the power of open-source solutions in creating a customer-centric shopping experience, providing real-time updates, manage complex product data, and offer a seamless user experience. This case study exemplifies how Saleor can be used to create a highly customized, efficient, and user-friendly e-commerce platform, even in a large-scale retail environment like Lush.
  • Hofkorb, Swiss/Liechtentstein online marketplace for regional products, uses Saleor to connect farmers, artisans, and small businesses with customers. It's a practical application of Saleor's capabilities in a niche market.
  • Wecre8, Saudi Arabian e-commerce platform that connects local fashion designers, celebrities, and buyers, and allows them to list, promote, sell, buy, and earn through affiliate marketing capabilities, has used Saleor to create websites and online stores. They've capitalized on Saleor's flexibility to deliver visually appealing and functional digital solutions.
  • Colophon Foundry, a renowned international type foundry, showcases an interesting application of Saleor. Their website leverages Saleor's robust GraphQL API for real-time inventory management and seamless user experience. The website's smooth navigation, real-time updates, and efficient handling of complex product data (such as different typeface options) show the potential of Saleor infrastructure for  a niche market like typeface design and sales.

These use cases demonstrate the power of Saleor's API First approach. The versatility of its APIs, the modularity of its architecture, and the extensibility of its platform enable businesses to create tailor-made e-commerce solutions. Whether you're an established business or a startup, Saleor offers a flexible, scalable e-commerce solution that can be customized to suit your specific needs.

Comparing API First E-commerce Solutions

The API First approach serves as the common denominator between Saleor, Reaction Commerce, and Magento. Yet, each platform employs distinct technical frameworks and provides unique capabilities, leading to differences in scalability, customization, and developer experience. Let's dig deeper into these. 

Saleor, engineered on Python and Django, embraces the robustness and simplicity of Python syntax. By leveraging the Django framework, it inherits Django's benefits such as the Don't Repeat Yourself (DRY) principle, and its built-in administrative interface. The GraphQL API gives Saleor a data-centric edge, reducing over-fetching and under-fetching of data, thus increasing efficiency. Additionally, its modular architecture that leverages plugins provides a scalable environment that can evolve with growing business requirements. If your business domain requires handling complex product variants or a high degree of UI customization, Saleor's API flexibility and Python's readability can be beneficial.

On the other hand, Reaction Commerce employs a full-stack JavaScript model, featuring a real-time reactive architecture built on Node.js, and a front-end designed with React. These allow Reaction Commerce to provide highly interactive user experiences. Similar to Saleor, Reaction Commerce also employs GraphQL, promoting data efficiency and tailored data fetches. A notable advantage of Reaction Commerce is its suitability for applications that demand real-time updates, made possible by the non-blocking and event-driven nature of Node.js. If your e-commerce solution requires real-time interactions, such as stock updates during high-volume sales, the JavaScript-centric ecosystem of Reaction Commerce could be your match.

In contrast, Magento, a PHP-based platform, utilizes the Zend 1 and 2 Framework and incorporates Symfony components. This combination provides Magento with a mature, enterprise-level technology stack. Its extensive feature set ranges from catalog management to customer service, from business intelligence to marketing tools. This comprehensive feature set, coupled with availability of commercial support, robust APIs and Adobe integrations, make Magento an attractive solution for businesses of all sizes, particularly those needing advanced B2B features. Furthermore, Magento's extensive set of APIs supports seamless integration with numerous third-party systems, providing flexibility and expansibility. 

When considering developer experience, the technology stack and language of choice play a significant role. Python's simplicity and readability may stand for development in Saleor, while JavaScript's ubiquity and the vast ecosystem of libraries can benefit developers working with Reaction Commerce. Magento, built on PHP and using large parts of Zend 1, Zend 2 and Symfony frameworks, has a steep learning curve due to its complex system architecture but offers a mature and comprehensive solution for senior PHP developers.

Overcoming Challenges and Future Considerations

The API First approach, while offering significant advantages in terms of scalability and customization, does present certain challenges that need to be addressed for successful implementation in an e-commerce context.

Security is a paramount concern when dealing with APIs, as they are the gateways to sensitive customer and business data. Implementing robust security measures such as OAuth or JWT for authentication, role-based access control for authorization, and SSL/TLS for data encryption is crucial. Regular security audits and penetration testing can further ensure the integrity of your APIs.

Versioning is another critical aspect. As your APIs evolve, maintaining backward compatibility becomes essential to prevent disruption to dependent services. Semantic versioning can be a useful strategy here, allowing you to communicate changes in your API effectively. Additionally, using versioning strategies like URI versioning or media type versioning can help manage different versions of your API.

The need for comprehensive, up-to-date API documentation is another challenge. Tools like Swagger or Postman can be used to auto-generate API documentation, ensuring that developers have the information they need to effectively use your APIs.

Looking forward, emerging trends like headless commerce and microservices architecture are set to shape the future of e-commerce. Headless commerce, where the front-end presentation layer is decoupled from the back-end logic, relies heavily on APIs for data exchange. This allows for greater flexibility in delivering interesting customer experiences across various touchpoints.

Similarly, microservices architecture, where an application is broken down into loosely coupled services, leverages APIs for inter-service communication. This architecture promotes scalability and resilience, as each service can be developed, deployed, and scaled independently.

For CIOs and other IT leaders looking to embrace API First principles in their e-commerce strategies, the following recommendations can serve as a guide:

  • Prioritize Security: Implement robust security measures and conduct regular audits to protect your APIs.
  • Manage API Lifecycle: Have a clear strategy for API versioning and lifecycle management to ensure backward compatibility and minimize disruption.
  • Invest in Documentation: Use tools to auto-generate and maintain comprehensive API documentation.
  • Embrace Modern Architectural Trends: Consider adopting headless commerce and microservices architecture to complement your API First approach.
  • Continuous Learning: Stay abreast of emerging trends and learn from real-world implementations of API First approaches.

Stay connected

Don't miss out on gaining more insights – opt-in to our monthly newsletter, and stay ahead in the ever-evolving world of music technology!

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

By submitting this form, you confirm that you have read and agree to the Terms & Conditions.

Need help?

No matter if you are just getting started or have an advanced concept - reach out to us and let's discuss.

Maciej Dulski

Maciej Dulski
Senior Business Consultant

In need of software development?

At Brave we specialise in Web Software Development. We wiil help you to get your project done.

CONTACT

LET’S TALK

FILL IN THE FORM BELOW, OR REACH OUT TO US DIRECTLY — OFFICE@BRAVELAB.IO

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.