Acumatica Integration with Shopify
Introduction
Integrating Acumatica ERP with Shopify enables businesses to synchronize inventory, products, orders, and customers between their e-commerce platform and back-office system. This guide provides a comprehensive approach to building a robust Shopify-Acumatica integration.
Whether you're running a small online store or an enterprise-level e-commerce operation, this integration automates manual data entry, reduces errors, and provides real-time visibility across all sales channels.
Prerequisites
Before you begin building your Shopify-Acumatica integration, ensure you have:
- Acumatica ERP instance (cloud or on-premises)
- Shopify store with API access credentials
- Acumatica REST API knowledge
- Shopify Admin API access token
- Development environment with Node.js or PHP
- Understanding of inventory management concepts
Integration Architecture
The integration follows a middleware pattern where a sync engine handles data transformation and synchronization between both platforms. Here's the high-level architecture:
┌─────────────┐ ┌──────────────┐ ┌─────────────┐
│ Shopify │────▶│ Sync Engine │────▶│ Acumatica │
│ Store │◀────│ (Middleware)│◀────│ ERP │
└─────────────┘ └──────────────┘ └─────────────┘
The sync engine handles:
- Product synchronization (bidirectional)
- Inventory level updates
- Order creation and status updates
- Customer data sync
- Webhook handling for real-time updates
Syncing Products
Product synchronization is bidirectional. When a product is updated in either system, the changes should reflect in the other. Here's how to implement product sync:
Fetching Products from Shopify
async function getShopifyProducts(shop, accessToken) {
const response = await fetch(
`https://${shop}/admin/api/2024-01/products.json`,
{
headers: {
'X-Shopify-Access-Token': accessToken,
'Content-Type': 'application/json'
}
}
);
return response.json();
}
Creating Products in Acumatica
async function createAcumaticaProduct(baseUrl, token, product) {
const response = await fetch(`${baseUrl}/api/data/IN202500`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
InventoryCD: { value: product.sku },
Descr: { value: product.title },
ItemStatus: { value: 'Active' }
})
});
return response.json();
}
Syncing Orders
Order synchronization is critical for maintaining accurate sales records and inventory levels. Orders created in Shopify should automatically create sales orders in Acumatica.
Handling Shopify Webhooks
app.post('/webhooks/orders/create', async (req, res) => {
const order = req.body;
// Transform Shopify order to Acumatica sales order
const acumaticaOrder = {
CustomerID: { value: order.customer.email },
OrderType: { value: 'SO' },
Details: order.line_items.map(item => ({
InventoryCD: { value: item.sku },
Quantity: { value: item.quantity },
UnitPrice: { value: item.price }
}))
};
// Create order in Acumatica
await createAcumaticaSalesOrder(baseUrl, token, acumaticaOrder);
res.status(200).send('OK');
});
Complete Integration Example
Here's a complete Node.js implementation for the Shopify-Acumatica sync engine:
class ShopifyAcumaticaSync {
constructor(shopifyConfig, acumaticaConfig) {
this.shopify = shopifyConfig;
this.acumatica = acumaticaConfig;
}
async syncInventory(productId, quantity) {
// Update Shopify inventory
await this.updateShopifyInventory(productId, quantity);
// Update Acumatica stock item
await this.updateAcumaticaStock(productId, quantity);
}
async processNewOrder(shopifyOrder) {
// Validate order data
if (!this.validateOrder(shopifyOrder)) {
throw new Error('Invalid order data');
}
// Create customer if not exists
await this.syncCustomer(shopifyOrder.customer);
// Create sales order in Acumatica
const soNbr = await this.createSalesOrder(shopifyOrder);
// Update Shopify order with Acumatica reference
await this.updateShopifyOrder(shopifyOrder.id, soNbr);
return soNbr;
}
async runFullSync() {
console.log('Starting full sync...');
// Sync products
const shopifyProducts = await this.getShopifyProducts();
for (const product of shopifyProducts) {
await this.syncProduct(product);
}
// Sync inventory levels
await this.syncAllInventory();
console.log('Full sync completed');
}
}
Best Practices
- Use webhooks for real-time updates - Configure Shopify webhooks for instant notification of changes
- Implement idempotency - Handle duplicate webhook events gracefully
- Schedule inventory sync - Run periodic full inventory reconciliation
- Handle errors gracefully - Implement retry logic and error logging
- Use mapping tables - Maintain SKU and customer ID mappings between systems
- Monitor sync status - Create dashboards to track sync health
Summary
Integrating Acumatica with Shopify creates a seamless flow of data between your e-commerce platform and ERP system. By following the architecture and code examples in can build a robust this guide, you integration that automates order processing, inventory management, and customer synchronization.
For more information, check out our other tutorials on Acumatica REST API Integration and Payment Gateway Integration.