Overview
SalesPad Desktop now integrates with Shopify!
Shopify is an eCommerce platform that, combined with SalesPad Desktop's inventory prowess, allows you to manage your sales more effectively. With the automated integration between Shopify and Dynamics GP, you can match GP Customers to Shopify Customers, create Customers and Contacts, and create Sales Documents within GP.
The integration settings allow you to define how to match the Shopify Customers and Contacts to GP Customers and Contacts. Additionally, the settings allow you to define exactly how to import the Shopify Order when creating a GP Sales Document.
Note: Licensed DLLs files are required to access this functionality. These can be installed by extracting the files into your SalesPad install folder. Please reach out to your Account Manager for more information on licensing.
Settings
Number Of Orders To Import - Specify the number of orders to import at one time. (Shopify only allows a maximum of 250 orders to be imported at one time).
This will be the page size for each API call when retrieving orders to be imported at each step of the Automation Agent job cycle. The API will be called until the last page returns less than the page size, at which point, all orders retrieved from each page will be processed.
Multiple Potential Customers Scenario - Review Queue - Queue that contains orders where a definitive customer match couldn't be found due to multiple possibilities being present. By default, the order will take the customer created first, then the order will be moved to the Workflow Queue designated by this setting to be reviewed.
When multiple Customers, Ship To’s and/or Bill To’s could satisfy the Matching criteria, the order will still be created for the customer that was first created in GP. This is helpful for identifying duplicated Customers or Contacts within GP.
Forward Document After Import - If Enabled, the imported order will be forwarded in workflow after being saved.
Named Notes Tab for Shopify Order Comments - Specify which tab to import Shopify order comments to on the Sales Document.
Fulfillment Status Filter - Specify the fulfillment status which orders must have for the order import to import them.
Expressions Overview
Several settings allow using expressions in order to match external and internal entities or to assign values from external to internal entities.
Each settings expression editor can have different source objects, depending on usage. Here is an example of our default expression for "Customer Bill To Address Assignment Mapping - Contact_Person"
We use the 'Cont' function to append the Shopify Customer First and Last name together to be written into the GP Customer Address Field Contact_Person.
These editors are designed to be flexible enough so that users can change the expression to accommodate their needs.
In addition to using the source object fields to assign values, we can also hardcode values to be assigned during object creation.
Here is an example from Customer Assignment Mapping - Currency_ID
In this case, all customers will be created with the Currency ID "Z-US$"
We can also write expressions that have IIF conditionals in them, as well as comments to help keep things nice and organized.
For more information on different expressions, take a look at this DevExpress article.
Matching Settings
These settings use Expression Editors to allow you to create custom matching criteria to determine how you would like to match a Shopify entity to a GP entity (Customer, Contact, or Item).
Each Matching setting can run one or more SQL queries to attempt to find a match in the GP database. These queries are executed one at a time, in order of Priority (lowest to highest). If an earlier priority query returns a result, that result will be returned to be used in the import, and the subsequent priorities will not execute (see default examples of Customer Ship To Matching and Customer Bill To Matching).
This diagram illustrates the sequence in which we attempt to match a GP Customer, Ship To, and Bill To each time a Shopify Order is imported.
The entire flow for an order import can be viewed in the Automation Agent Customer and Order Import Process diagram.
Customer Matching
This setting allows you to define the mappings for looking up the Customer, and it is used as the first attempt to match a GP Customer to the Shopify Customer. If a customer is found in this step, their Customer Number will be used as part of the search criteria for looking up the Ship To and Bill To Addresses.
The default settings attempt to match a GP Customer based on the email of the Shopify Order (these matching criteria are "OR’d" together).
This Setting can be modified, and does not even need to be populated since we can also match the customer indirectly via Customer Ship To Matching or Customer Bill To Matching.
For example, if you want to match your Shopify Orders by shipping addresses instead, we can clear out the Customer Matching setting, and use the Customer Ship To Matching or Customer Bill To Matching settings to attempt to load the Ship To / Bill To and the Customer.
Customer Ship To Matching
This settings allows you to define the mappings for looking up the Customer Ship To Address when attempting to lookup a Customer Ship To Address. If we have matched a GP Customer via Customer Matching, that customer's "Customer_Num" will be injected into the query for looking up the Ship To Address. Otherwise, we will attempt to match the Shipping Address across all GP Customers. If a Shipping Address match is found, and we did not yet have a customer, we will load that customer to be used for the import.
The default settings attempt to match a GP Shipping Address in three different steps:
Priority 1
Address: Attempt to find a match based on Address Line 1, City, State, and Zip (this criteria is all "ANDed" together).
Priority 2
Contact: Attempt to find a match based on the First and Last Name of the Shopify Customer or Shopify Shipping Address.
Priority 3
Primary Address: Attempt to find a match based on the Primary Address for the Customer (this assumes that the Customer was matched via Customer Matching).
Customer Bill To Matching
This setting allows you to define the mappings for looking up the Customer Ship To Address while attempting to lookup a Customer Bill To Address. If we have matched a GP Customer via Setting Customer Matching or Customer Ship To Matching, that customer's Customer_Num will be injected into the query for looking up the Bill To Address. Otherwise, we will attempt to match the Billing Address across all GP Customers. If a Billing Address match is found, and we did not yet have a customer, we will load that customer to be used for the import.
The default settings attempt to match a GP Billing Address in three different steps:
Priority 1
Address: Attempt to find a match based on Address Line 1, City, State, and Zip (this criteria is all "ANDed" together).
Priority 2
Contact: Attempt to find a match based on the First and Last Name of the Shopify Customer or Shopify Shipping Address.
Priority 3
Primary Address: Attempt to find a match based on the Primary Address for the Customer (this assumes that the Customer was matched via Customer Matching).
Item Master Matching
This setting allows you to define the mappings for matching Shopify items to a GP Item Master. Each Shopify Line Item will use this Setting to find the corresponding GP Item.
The default settings attempt to match a Shopify Sku directly to a GP Item Number:
Mapping Settings
These settings use Expression Editors to allow the user to define how Customers, Orders, and Sales Lines will be created.
Our target objects will be GP Customers, Contacts, Sales Documents, or Sales Lines. Our source objects will be Shopify Customers, Contacts, Orders, and Line Items.
Each Mapping contains a grid of all the target fields and an expression for each that will set the field. There are many fields that have default expressions in the Suggested categories.
Customer Assignment Mapping
This setting allows you to define the mappings to be used when creating a new Customer. If we were unable to match an existing GP Customer with our Matching Settings, we will create a new GP Customer using the values in Customer Assignment Mapping.
Some necessary fields for creating a GP Customer are Currency_ID, Payment_Terms, Sales_Person_ID, and Sales_Territory.
Once these fields are set, the integration should be able to create new GP Customers.
Customer Ship To Assignment Mapping
This setting allows you to define the mappings to be used when creating a new Customer Ship To Address. If we were unable to match an existing GP Customer Address with our Matching Settings, we will create a new GP Customer Address using the values in Customer Ship To Assignment Mapping.
Customer Bill To Assignment Mapping
This setting allows you to define the mappings to be used when creating a new Customer Bill To Address. If we were unable to match an existing GP Customer Address with our Matching Settings, we will create a new GP Customer Address using the values in Customer Bill To Assignment Mapping.
Sales Document Assignment Mapping
This setting allows you to define the mappings to be used when creating a new Sales Document. When the Shopify Order is imported, this setting will be used to set each of the Sales Document fields.
Some necessary fields for creating a GP Sales Document are Sales_Batch and Sales_Doc_ID
Sales Line Assignment Mapping
This setting allows you to define the mappings to be used when creating a new Sales Line Item. There are not any default expressions within this setting, we are setting the Item from Item Master Matching if a valid item was found. If an item was not found, an expression such as this could bring in the Sales Line Item as a non-inventory item (where ZZ- is the Non-Inventory Prefix).
We are setting some of these line items fields in the core code of the integration, though these assignments can be overridden with this setting: Unit_Price, Markdown_Amount, Tax_Amount, Funct_Tax_Amount.
Scripts
Sales Document Pre Import Script
A C# Script that runs before a Sales Document is imported.
Parameters: System.ComponentModel.CancelEventArgs ce, Object sourceDoc, SalesPad.Bus.SalesDocument sd
This script is the first thing to run when importing a Shopify Order. At the time of execution, no assignments have been done in code or expression editors. This script can be used to cancel the import early via setting ce.Cancel = true, or do some preliminary assignments to the SalesPad.Bus.SalesDocument sd.
New Customer Creation Script
A C# Script that runs after a new customer is created and before it is saved.
System.ComponentModel.CancelEventArgs ce, Object sourceDoc, SalesPad.Bus.SalesDocument sd, SalesPad.Bus.Customer customer
This script will run before a new customer is saved for the first time. This script runs after the assignments from Customer Assignment Mapping, but before the assignments from Customer Ship To Assignment Mapping and Customer Bill To Assignment Mapping.
The script can be used to do more complex assignments, or cancel the import under certain conditions (by setting ce.Cancel = true;)
Sales Document Pre Save
A C# Script that runs just before a Sales Document is saved.
System.ComponentModel.CancelEventArgs ce, Object sourceDoc, SalesPad.Bus.SalesDocument sd
After this script runs, the document is saved. This script is the last opportunity to adjust values, or cancel the import (by setting ce.Cancel = true)
Order Export Overview
GP Orders that were created via the Shopify Order Import integration can export their tracking numbers and fulfillments back to Shopify with the Shopify Order Export component.
This component will target a certain GP batch of documents. Each document will use the link that was created during the order import to call the Shopify API and update the appropriate document.
Standard Settings
Export Queue - Queue that contains orders ready to be exported to Shopify.
Orders that were imported from Shopify will need to be directed into this queue, where they will wait to be processed before being forwarded in workflow.
Export Failure Queue - In the event of an unsuccessful export, the document will be placed into this queue.
If for any reason there is an exception during the order export process, the document will be moved to this queue, and the error will be logged to the Automation Agent Action Center.
Item Master Matching
This setting allows you to define the mappings for matching Shopify items to a GP Item Master. Each Shopify Line Item will use this Setting to find the corresponding GP Item.
The default settings attempt to match a Shopify Sku directly to a GP Item Number.
Order Export Location Matching
This setting allows you to define the criteria for matching a Shopify location to a GP location when doing Order Export.
The order export process first begins by calling the Shopify API to get a list of all Locations, and attempting to create a mapping for each of them to a GP Location.
By default, the match is done on Location Name between the two systems.
We recommend using a dev store in Shopfy when implementing our integration. For more information on creating a dev store in Shopify, follow these instructions.
Christian Hartford
Comments