Integrating with Amazon: How We Bridged Two Different Commerce Domain Models

Brad Sokol
7 min readintermediate
--
View Original

Overview

The article discusses the challenges and solutions encountered while integrating Shopify with Amazon's marketplace, focusing on bridging different commerce domain models and communication protocols. It highlights the importance of understanding architectural patterns and the need for flexibility in design decisions.

What You'll Learn

1

How to bridge different commerce domain models when integrating systems

2

Why understanding API design differences is crucial for successful integration

3

When to revisit design assumptions in software projects

Prerequisites & Requirements

  • Understanding of REST and RPC messaging styles
  • Experience with API integration

Key Questions Answered

What are the key differences between Shopify and Amazon's API design?
Shopify uses a REST API with synchronous data write requests and webhooks for event notification, while Amazon's Marketplace Web Server (MWS) API employs an RPC messaging style with asynchronous data write requests and polling for event discovery. These differences necessitate careful handling during integration.
How does the integration process between Shopify and Amazon work?
The integration process involves several steps: requesting new orders from Amazon, creating orders on Shopify, acknowledging orders back to Amazon, and handling fulfillments. Each step must be executed in a specific sequence to ensure data consistency.
What lessons were learned from integrating Shopify with Amazon?
Key lessons include the importance of revisiting initial design assumptions, understanding the architectural patterns of integrated systems, and recognizing common integration issues like message ordering and data granularity, which can be mitigated through persistence mechanisms.

Technologies & Tools

Backend
Shopify API
Used for managing product listings and order synchronization.
Backend
Amazon Marketplace Web Server (mws) API
Used for processing orders and fulfilling requests in the Amazon marketplace.

Key Actionable Insights

1
Revisit initial design constraints when facing integration challenges to find better solutions.
Flexibility in design can lead to improved outcomes, especially when unexpected issues arise during implementation.
2
Understand the messaging protocols of both systems to avoid common pitfalls in integration.
Being aware of how each system communicates can help in planning the integration process more effectively.
3
Consider persisting order data to manage integration complexities more effectively.
Storing relevant data can simplify the handling of asynchronous operations and improve overall system reliability.

Common Pitfalls

1
Failing to account for differences in messaging protocols can lead to integration errors.
This often happens when developers assume similar behaviors between systems without understanding their specific API designs.
2
Not persisting order data can complicate the integration process and lead to data inconsistencies.
This occurs when teams prioritize minimizing storage over ensuring reliable data handling, which can backfire during high-volume operations.