Shopify Integration Tool Introduction
What is the Shopify Integration Tool?
The Shopify Integration tool allows communication between BPA Platform and Shopify. All communication uses XML. You use the Integration tool to map BPA Platform data to Shopify objects and operations. Operations such as, ADD
, UPDATE
, GET
, and DELETE
, are supported for a variety of business objects, such as, Product
, Customer
, and Order
.
The XML responses received back from the Shopify API can be saved to file or passed to another BPA Platform tool for further processing. The responses can include details of the object requested, any errors from the provider, or the values of any automatically generated ID fields. For example, you can use Shopify Integration to provide an indirect link between systems that do not typically synchronise data with each other, such as synchronising contacts from a CRM platform as Shopify customers, importing Shopify sales orders into an ERP, or even to provide reports containing data from both systems.
The Shopify Integration Tool Pack
The tool pack consists of:
- Shopify Integration — The Integration tool must be installed on the BPA Platform server, and on any BPA Platform client machines. It is this that provides the translation between BPA Platform data and the Shopify object and operation.
Video Overview
White Paper - Shopify Integration Tool
Shopify Integration System Requirements
The Shopify Integration tool requires BPA Platform 4.6 (build 1944) or above.
Architecture
The diagram below provides a high-level system architecture overview of the Shopify Integration tool pack, with BPA Platform and the Shopify REST API:
Figure 1 — High-level system architecture of the Shopify Integration
About the Shopify Integration Tool
Global Configuration
The global configuration for this tool is used to create connections to Shopify.
Figure 2 — Shopify Integration – Global Configuration dialog
Click Add to create a connection to Shopify.
Use Extended Logging
Enabling this option exposes the XML parsed between Shopify Integration and the Shopify API. You can view the log from the BPA Platform Event Log (Manage > Event Log).
Without extended logging, the Event Log only contains start and end of transaction messages, plus any error messages encountered at runtime.
Shopify Connection Tab
You configure the connection to Shopify here.
Figure 3 — Shopify Integration – Shopify Connection Tab
Configure a meaningful Connection Name for this connection; this is the name displayed when adding tasks for Shopify.
Within Domain Name, specify the domain name of the URL to Shopify. For example, if the Shopify webshop is running on https://www.we-sell-clothes.co.uk, the corresponding domain name is www.we-sell-clothes.co.uk
.
Configuring Connection Retries
Number of retries – Specifies the number of retries that will be attempted to establish a connection to the Shopify webshop on a failure to connect.
Wait time (seconds) – On connection failure, the pause period, in seconds, before a further attempt is made to establish a connection to the Shopify webshop.
Authentication Tab
You can configure the Shopify credentials here that allow access to Shopify.
Figure 4 — Shopify Integration – Authentication Tab
Selection of the App Type determines the authentication method to be used:
- Private – Enter the API Key and Password created in Shopify.
- Custom – Enter the Access Tokenstrong> created in Shopify.
Options Tab
Optionally, choose a Module to show only objects from that module on the mapping tab.
Figure 5 — Shopify Integration – Options tab
Specifying the API Version to Use
Use the API version pane to specify the API version this instance of the Shopify Integration tool uses. Either specify the API version number or enable Use the latest tested API version to use the latest version the release of Shopify Integration tool was tested with (which may no longer be the latest).
Objects, Operations and Properties that are not available in the API version for which the connection is configured, will not be shown in the Shopify Integration tool.
Test Connection
Using the Test Connection button allows you to test the connection to the Shopify API.
Skip SSL Certificate Check
Communication to the Shopify API is over HTTPS, which typically involves an SSL certificate. If required, enable Skip SSL certificate check to ignore the SSL certificate — this is particularly useful if using a test environment (sandbox) on an internal server that doesn’t have a valid SSL certificate.
Update Objects and Operations
Enabling the Update objects and operations option, allows the Shopify Integration schema within BPA Platform to be refreshed.
Step Configuration
When creating new tasks, the Shopify Integration tool is located under Data Connectors of the Task Browser.
General Tab
Figure 6 — Shopify Integration – General tab
Provide a meaningful Name and Description for this step.
Choose your Data source. This can either be:
- No data source — If you don’t make use of a dedicated XML input source, select this option to use BPA Platform variables in place of the XML objects’ fields. These can then be mapped to operational fields.
For example, you can extract various bits of information from an email and store them in BPA Platform variables. Then, having mapped them to Shopify objects and operations, these can be stored in Shopify for later use. - Task step — The data source can be set to an available BPA Platform XML data source. Only those steps that are capable of natively exposing an XML document at runtime are listed. These may be another Shopify integration step, or a tool, such as Convert Recordset to XML.
- Custom schema — An XML schema defines the structure of the parsed XML: what tags are present, and the nesting of the tags. You Define the schema of the XML that will be used as the input data source for this step. The industry standard XSD format is used by the Shopify Integration tool. Any XML processed by this step must conform to this schema else an error will be reported.
If the XSD schema is available, either import it into the Custom Schema Configuration (use the Import XSD/XML File button) or copy and paste it into the configuration box.
If the XSD schema is not available, you can import an example of the runtime XML (Import XSD/XML File) or copy and paste it into the configuration box. Use the Parse button to create the schema. - Input source variable — As well as defining the schema, you must specify the BPA Platform variable that contains the XML data at runtime.
Connection Tab
You specify the Shopify Connection this step must use.
Figure 7 — Shopify Integration – Connection tab
All connections created in GLOBAL CONFIGURATION are presented here.
Alternatively, you can use a BPA Platform variable to create a dynamic connection, where the connection used is determined by runtime circumstances. At runtime, the contents of the variable must match the name of one of the GLOBAL CONFIGURATION connections — this is case-sensitive.
Mapping Tab
Here you define links between the incoming XML and the outgoing data that is sent to the Shopify API. This defines how, at runtime, the incoming XML is to be translated into the XML required for the relevant object and operation.
Figure 8 — Shopify Integration – Mapping tab
The Object drop-down shows the available objects. The Operation drop-down shows the operations available for the selected Object.
You create the links by clicking and dragging an object field onto its corresponding operation field. Note that only linked fields are used in the output XML. BPA Platform formulas and variables can be included in the source data — drag them from the BPA Platform Browser to the object’s XML tree control. These can then be linked to operation fields. Note that BPA Platform recordsets must first be converted to XML using either the Convert Recordset to XML or Transform Data tool before they can be used here.
Each operation has an additional field, SupplementaryReference
, which allows for traceability when transferring data from one place to another. When mapped, the data resides locally at runtime. It is added to the output and creates a record for reference purposes only — you can choose to map any field to SupplementaryReference
to assist with checking where the data originated from or at what time the data transfer occurred, for example.
The Shopify Integration tool uses eXtensible Stylesheet Language Transformations (XSLT) to translate the received XML. The Advanced Translations (XSLT) tab shows the XSLT generated for the links created for the object and operation. Use Enable Free Type Mode to directly edit the XSLT — this is particularly useful when translating a nonstandard requirement.
Options Tab
The Options tab allows you to define how errors in this step are handled at task runtime.
Figure 9 — Shopify Integration – Options tab
If an error occurs, you can decide whether the step should Continue processing, or terminate the step immediately (Abort Step).
If the step is aborted, you can choose to Continue processing onto the next step in the task or terminate the whole task immediately (Abort Task).
Allowing the task to continue allows you to use the error XML received back from Shopify Integration in a Save as File step for investigation purposes, for example.
All errors are recorded to the BPA Platform Event Log (Manage > Event Log).
Working with Other Tools
Shopify Integration can directly interact with the following tools:
Consuming XML from Other Tools
The Shopify Integration tool can consume XML outputted by the following tools:
Step Icon | Name | Step Type |
---|---|---|
Import Flat File | Input | |
Import XML Document | Input | |
Convert Recordset to XML | Format | |
Transform Data | Format | |
Call Task | Execute | |
Web Service Connector Tool | Data Connectors | |
Shopify Integration | Data Connectors |
Exposing XML to Other Tools
The XML outputted by the Shopify Integration tool can be used by the following tools:
Step Icon | Name | Step Type |
---|---|---|
Convert XML to Recordset | Format | |
Run Microsoft Reporting Services | Format | |
Transform Data | Format | |
Save File | Output | |
Call Task | Execute | |
Web Service Connector Tool | Data Connectors | |
Shopify Integration | Data Connectors |
XML Output
The Shopify Integration tool outputs two documents:
OutputData
ErrorData
Figure 10 – Shopify Integration tool outputs
Both outputs can be used:
- Directly by subsequent tool steps which consume XML data inputs
- If required, use the Convert XML to Recordset tool to convert the XML to a BPA Platform recordset
- Accessed using the output or error objects for response data (
XmlString
), or the output or error schema (XmlSchema
) present in the Task Browser
OutputData XML Document
The OutputData
document contains:
- Data returned from Shopify Integration, for instance the created, updated or retrieved entity instances
SupplementaryReference
ErrorData XML Document
The ErrorData document is structured as follows:
<Error>
— All errors are created as an<Error>
node, with the following sub-nodes:<Object>
— The name of the requested object, such as, Product<CODE>
— The error code returned by Shopify<MESSAGE>
— The corresponding error message<EXTENDEDINFO>
— A string containing additional information about the error<INPUTDATA>
— The input data mapped for the object, plus all data contained in the SupplementaryReference field
Supported Objects
At the time of writing, the following objects and operations are supported:
Module | Shopify Object | Standard Operations | Comment | ||||
---|---|---|---|---|---|---|---|
Get | Add | Update | Delete | Other | |||
Customers | Customer | ||||||
Customer address | |||||||
Customer invite | Additional supported operations: Send Customer Invite | ||||||
Customer metafield | |||||||
Discounts | Discount code | ||||||
Price rule | |||||||
Events | Event | ||||||
Order event | |||||||
Product event | |||||||
Inventory | Inventory item | ||||||
Inventory level | Additional supported operations: Adjust, Connect, Set | ||||||
Location | |||||||
Orders | Order | Additional supported operations: Close, Re-open, Cancel | |||||
Draft Order | Additional supported operations: Complete Draft Order | ||||||
Fulfillment | Additional supported operations: Cancel Fulfillment, Update Fulfillment Tracking Information | ||||||
Fulfillment Order | Additional supported operations: Cancel Fulfillment Order, Close Fulfillment Order, Hold Fulfillment Order, Move Fulfillment Order, Open Fulfillment Order, Release Hold Fulfillment Order, Set Fulfillment Order Deadline | ||||||
Order metafield | |||||||
Order risk | |||||||
Refund | Additional supported operations: Calculate | ||||||
Order transaction | |||||||
Payments | Payment balance | ||||||
Payment dispute | |||||||
Payment payout | |||||||
Payment transaction | |||||||
Products | Collect | ||||||
Custom collection | |||||||
Product | |||||||
Product image | |||||||
Product metafield | |||||||
Product variant | |||||||
Product variant metafield | |||||||
Store Properties | Shop | ||||||
Shop metafield |
Runtime
The incoming XML is translated into the XML format for the object and operation selected in the configuration. The data for the linked fields is brought across into the output XML — only those fields that were linked are brought across. The XML is passed to the connector tool, which then:
- Processes the data
- Performs the operation requested
- Sends back an XML document containing the response
The XML can then be used by other BPA Platform steps.
Error Handling
Errors are written to the BPA Platform Event Log (Manage > Event Log). You define how errors are handled in the Options tab of the Shopify Integration tool
Reasons for the errors could include:
- Web service connection errors
- User privilege errors
- Errors from the Shopify API
- Warnings and messages from the Shopify API
Shopify Account Security
The Shopify API is the only method used to connect to Shopify and perform read / write tasks — all security present in the API is used.