Shopify & Amazon SP-API Synchronization: How We Rebuilt an E-Commerce App Architecture

How we reworked key parts of a legacy monolithic system and set up two-way synchronization of orders and inventory between Shopify and Amazon.

Jack Ananchenko

Reviewed by: Jack Ananchenko, Co-founder, CTO

Aug 13, 20265 min read
Shopify & Amazon SP-API Synchronization: How We Rebuilt an E-Commerce App Architecture

European E-Commerce App Developer

A Shopify app for integration with the Amazon marketplace via SP-API, enabling product data transfer, direct order imports, and automatic real-time synchronization of sales statuses.

The Essentials

European e-commerce apps for inventory & data sync

Custom Software Development & API Integration

Real-time two-way Shopify ↔ Amazon SP-API synchronization

Tech Stack

Laravel QueuePHPJS + ViteDocker / Docker ComposeMySQL / PostgreSQLAmazon SP-API / AWS SQS

Legacy Architecture and Frustrating Page Reloads

We partnered with a European company that develops plugins and modules designed to optimize e-commerce operations. Its core application for synchronizing inventory between Shopify and Amazon was built on an outdated, convoluted, and overly complex architecture.

The main problem was that whenever users wanted to update any data in the application, they had to manually reload the page. This placed a significant load on the servers, degraded the user experience, and slowed down sellers' workflows.

Any attempt to expand the application's functionality became a challenge. Due to the large amount of tangled legacy code, development was slow, the risk of regression bugs remained high, and scaling and maintaining the application became increasingly difficult.

Modernization Metrics in Action

2

E-Commerce Platforms

Shopify and Amazon were connected into a unified system with automatic two-way synchronization of products, inventory, and orders.

1 min

Queue Polling

A custom background worker polls the Amazon SQS notification queue every minute and reacts to status changes automatically.

0

Manual Reloads

Laravel Queue moved processing to asynchronous background jobs, allowing the interface to update automatically without manual page reloads.

The Anatomy of Tech Debt: What Stifled Product Growth

Our analysis of the codebase revealed several critical factors that were effectively blocking the product's growth:

Slow Processes

Low performance and frequent manual page refreshes reduced seller productivity and slowed operations with large product catalogs.

Legacy Monolith

The tightly coupled monolithic codebase made new functionality difficult to add without affecting adjacent modules.

Amazon Requirements

Amazon's strict code quality and marketplace requirements made new functionality more challenging to implement within the legacy codebase.

Our Approach: Extensive Refactoring and a Fully Asynchronous Architecture

Rather than applying simple "cosmetic" fixes, we carried out an extensive refactoring of the application's core using Laravel and React. Our key principle was to rebuild the architecture and introduce new features in parallel. This allowed the application to remain fully operational for active users throughout the entire modernization process.

We completely changed the application's approach to data processing by moving all resource-intensive tasks from synchronous execution to asynchronous background queues powered by Laravel Queue. The application was also designed to handle products irrespective of their assigned location. This allowed product handling to remain consistent without tying the processing logic to a specific location.

Together, these architectural changes reduced server load, improved interface responsiveness, and enabled sales statuses to update automatically without user action.

Engineering Deep Dive: Laravel Queue, Amazon SP-API & AWS SQS

1. Engineering Journey

Challenge (No Access to Real Amazon Data): during development, we did not have access to real Amazon production data. Testing synchronization under real-world conditions was therefore limited, as Amazon does not provide a fully featured sandbox environment with data representative of real production scenarios.

Solution (Designing with Mock Data): to address this limitation, we developed a system of mocked data and handlers based on assumptions, an in-depth analysis of the official Amazon SP-API documentation, and expected API responses. This allowed us to test and validate the two-way synchronization without relying on real production data.

2. Custom Solutions

Since there were no ready-made solutions for a complete integration between Shopify and Amazon SP-API, we built the architecture from scratch, developing a range of custom modules powered by Laravel Queue:

Asynchronous Amazon Feed Processing: a mechanism that assembles XML/JSON data for a specific feed type (listing updates, order cancellations, or refunds), sends it to Amazon, and regularly checks its processing status.

AWS SQS Queue Listener (AmazonSqsJob): a custom background worker that checks the Amazon notification queue in the required region every minute and dynamically routes incoming events based on the type of notification received.

Two-Way Inventory and Product Synchronization: a set of scheduled background jobs with custom logic for comparing and mapping products between the two platforms, including parsing CSV reports from Amazon.

Shopify Webhook Controller (ShopifyWebhooksOrderController): for example, when a fulfillment status in Shopify changes to "fulfilled" and a tracking number is added, our script automatically prepares the shipping data and notifies Amazon immediately. Similar logic is implemented for cancellations and refunds.

Database Hygiene: a dedicated utility clears outdated records every month from a custom job execution audit table that we created for internal monitoring of background processes.

3. Technology Stack and Specific Tools

Technology Stack: PHP / Laravel, JS + Vite, Docker / Docker Compose, MySQL / PostgreSQL, and Laravel Queue for the core stack; Shopify SDK and Amazon SP-API (SellingPartnerApi tools for feed processing and SQS notifications) as specialized tools.

Building a two-way asynchronous synchronization between Shopify and Amazon SP-API powered by Laravel Queue allowed us to reduce the load on both the server and the application by moving heavy operations to asynchronous processing.

Summary of Results

Before

  • Manual Page Reloads: users had to reload the page every time they needed updated data, resulting in a slower and less convenient experience.

  • Platform Switching: managing Amazon orders required sellers to switch between platforms.

  • Legacy Processing: resource-intensive operations added load to both the server and the application.

After

  • More Responsive Interface: queue-based asynchronous processing improved interface responsiveness and removed the need for explicit page reloads.

  • Centralized Order Management: Amazon orders now come directly into Shopify, allowing sellers to manage them without constantly switching between platforms.

  • Real-Time Status Updates: sales status updates are synchronized between sellers and customers in real time.

  • Reduced Application Load: Laravel Queue moved heavy operations to asynchronous processing, reducing the load on both the server and the application.

  • linkedin
  • x
  • facebook
  • Clutch
  • Upwork
  • Reddit

Is Your E-Commerce App Slowing Down Under the Weight of Legacy Code? Let's Fix That!

Are constant page reloads, slow requests, and unreliable marketplace synchronization preventing your product from scaling?


Vladimir Gubarev

CEO and Co-founder

Jack Ananchenko

CТO and Co-founder

By submitting this form, you agree to our Privacy Policy and Terms of Use.

How We Can Help You

See What Else We've Built