Companies want to engage more customers, in more ways, and in more environments. But with all the new digital experiences available, consistency is proving difficult. Customers shouldn’t notice the technology but must remember the experience. That’s a tall order for ecommerce systems. We talked with Matt Bishop, Elastic Path’s principal architect, to understand more about how an API-based commerce system works and why hypermedia makes ecommerce easier.
“When we designed our ecommerce system based on an API, the chief problem we needed to solve was complexity,” says Matt Bishop. Getting the combinations right considering all the factors that have to click into place is like solving a Rubik’s cube with hundreds of squares and a different color for every customer. We recognized three major layers of complexity:
- Complex state and data. Hundreds of elements including products, pricing, currency, tax regimes, preferences for currency and shipping, and more all interact with each other and impact other pieces of many different systems.
- Complex integrations. Commerce sits between customer touchpoints (CMS, web browsers, mobile apps and internet of things) and systems (tax, inventory, ERP, billing engines and rule engines). Any given digital customer experience can comprise 15 plus different pieces of technologies all working together.
- Complex customizations. Booking shore excursions while on a cruise is very different from buying cosmetics. Different purchases require different kinds of state at varying times in the customer journey – all published through different touchpoints. Allowing developers to “understand” complex customizations was important for us to solve.
“Taking these three layers of complexity together, we realized we shouldn’t make it more complex. So, we took the opposite approach. We decided to make ecommerce radically simpler,” says Bishop. “We set two goals for the Elastic Path API. It had to be easy to use and simple to extend.”
Hypermedia: a simple and elegant e-commerce solution
Elastic Path tried several API styles – SOAP, RDF from the Semantic Web, templated REST – and rejected each before looking at level three REST, then known as HATEOAS (or Hypermedia as the Engine of Application State) and recently renamed Hypermedia.
“We finally settled on using a REST level three hypermedia API because it alone could provide the simplicity of use and extension that we needed to solve the complexity problem,” says Bishop.
Hypermedia uses two concepts: resources and relationships. “Resources are things or the nouns of the system: carts, items, profiles, purchases. They have relationships to each other that are named. For example, an item has a relationship to price.”
To access a hypermedia API, simply go to the "home page" or root, which gives a list of links to start your navigation. Each link leads to a new link, or controls like “Add to Cart.” You can add, change or delete links completely.
“Understanding resources and relationships as well as how to access the API provides everything you need to successfully use a hypermedia API,” says Bishop. It’s that simple.
Advantages of a hypermedia API
- Discoverability. Hypermedia allows you to follow links to discover related content and links – just like browsing a website. “Developers really like this experience,” says Bishop. “They don’t have to read documentation, study a book, or ask a lot of questions.” They can jump in, figure it out, and quickly use the API.
- Contextuality. Hypermedia allows you to personalize content for every customer. “You can shape the API based on their profile, and get them to do what you want, based on their role. You can add links, and remove links. This contextuality gives us a lot of power over the presentation layer. Clients consume the API without understanding the context because they don’t need to. Simple.
- Reactivity. As the name implies, reactive clients can recognize and react to resources (cart, price, item, etc.) but do not have intrinsic business logic. “Decisions are made by the server and provided as links in the API,” explains Bishop. “Instead of coding up a client, the API presents the link or chooses not to. This model allows us to reach all touch points simply and quickly.”
- Extendability. Just add resources and link to an existing resource to personalize the user experience. You can push a product on sale, select content based on a user profile, and filter recommendations. Similarly, to remove capabilities (like hiding the price) just remove the link. “The system never reacts to render it, and the price disappears without having to modify the item itself.”
- Stability. “Stability is important when the number of customer touchpoints increases. When you have dozens of touch points and many versions of an application, some may live in hardware that cannot be updated. Some of it may live in mobile devices that the client doesn't want you to update or the vendor can't provide updates for. Connected cars, connected homes, mPOS, clienteling apps, augmented and virtual reality all represent new touchpoints. You need a way for the API to be resilient, given the number of different clients and their varying abilities to access it over time. Hypermedia provides the right level of stability along with simplicity.
“Our decision five years ago to build a simpler way to create complex ecommerce systems was a good one,” says Bishop. “At the time, we were way ahead of the market. But today, Hypermedia APIs are now starting to lead the way in many other forms of complex systems, not just ecommerce, for all the same reasons.”
A hypermedia ecommerce API isn’t like other APIs; some are less sophisticated and come with significant overhead. Brands using hypermedia APIs can innovate faster and deliver consistent customer experiences. How is your company handling ecommerce complexity? Learn more about hypermedia APIs in 10 Ways A Hypermedia Ecommerce API Leads to Developer Nirvana.