Shopify sales order to AX - part 1

Introduction

This blog post describes how we set up a workflow in Synia to support creating a sales order that originates in Shopify to Dynamics AX 2012 an on premise legacy ERP system. It involves a few steps, handles things like return orders and exhange orders, does lookups to Shopify since the original payload from Shopify doesn't contain all necessary information. It shows how we leverage secrets in Synia, how we store contact information both as entities within Synia and synchronize that information to AX, gather payment information from Shopify and finally send this to Dynamics AX using an on-premise Synia Gateway solution that works behind a firewall, so no ports need to be opened to complete this process.

Web hook

The first part of the process is to listen to a web-hook from Shopify. We start by creating the endpoint in Synia:

Set up web hook endpoint in Synia

The endpoint is then registered in Shopify where we monitor the order/create event.

Check for return order logic

The first part of the flow checks if the sales order in question is a return order. Synia supports nested workflows, the "Resolve Return Specific logic" is a FlowNode that has associated logic of return orders as a nested flow. This improves clarity for the overall workflow, allowing us to break down steps into more defined and isolated actions.

Return Specific logic

The purpose of the sub-workflow is to gather return information into corresponding variables for furhter decisions in the workflow.

Normalize Shopify Order Context

Initial steps involve resolving return flow and payment details gathering. After gathering that information we have a step where we normalize the order to a specific contract in a Javascript step (which could be done in c#, Liquid, Python or another scripting language).

Raw order context

The purpose of the step is to return a "raw" order as a variable.

Normalize Shopify Order Context

The next step is to resolve the information about the contact and the detailed content of the order payload, which will be outlined in the next part of the blog...