> ## Documentation Index
> Fetch the complete documentation index at: https://www.integrate.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ETL: Connecting to Shopify

> How to create a Shopify connection in Integrate.io ETL and build a pipeline to read orders, products, customers, and other store data using API tokens.

Integrate.io ETL can read your Shopify data. This article details creating the Shopify connection and the process of building a data pipeline to read Shopify data in Integrate.io ETL. There are also pre-built templates to read data from Shopify. Please see [Create a package from a template](/etl/create-a-package-from-a-template) for instructions on using a template.

## To create a Shopify connection in Integrate.io ETL

<Steps>
  <Step>
    Click the **Connections** icon (lightning bolt) on the top left menu.
  </Step>

  <Step>
    To create a connection, click **New connection**.

    <Frame>
      <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-254.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=dadb97b9c19847ece84b566549284e09" alt="New connection button in the Connections menu" width="1200" height="828" data-path="images/connectivity-and-security/image-254.webp" />
    </Frame>
  </Step>

  <Step>
    Choose Shopify.

    <Frame>
      <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-255.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=3760a58b8ecaf88b41d5d7219abb9d0a" alt="Selecting Shopify from the connection type list" width="1200" height="828" data-path="images/connectivity-and-security/image-255.webp" />
    </Frame>
  </Step>

  <Step>
    Enter the Shopify store name you'd like to connect to and click **Authenticate**.
  </Step>

  <Step>
    (If required, sign in to Shopify)
  </Step>

  <Step>
    Click **Connect** to authorize Integrate.io ETL access to your Shopify account.
  </Step>

  <Step>
    In the new Shopify connection window, name the connection and click **Create Shopify connection.**
  </Step>
</Steps>

## To modify Shopify connections in Integrate.io ETL

<Steps>
  <Step>
    Click the Connections icon (lightning bolt) on the top left menu.
  </Step>

  <Step>
    Click a connection to open it. Make any necessary changes, then click Reconnect, and Save changes. To exit the Shopify connection window without changes, click Back to connections (grey tab on the left side) on the Shopify connection window.
  </Step>

  <Step>
    To delete a Shopify connection, click on the three vertical dots on the far right of the connection listing and select the Delete connection option.
  </Step>
</Steps>

## To build a data pipeline to read Shopify customer data in Integrate.io ETL

<Frame>
  <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-256.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=8c84ba974fa9be1c2fe13f8fdb4d68b4" alt="Shopify customer data pipeline overview in the package designer" width="1200" height="828" data-path="images/connectivity-and-security/image-256.webp" />
</Frame>

## REST API Component: shopify\_customers

* **Authentication** - Click **Connection** and then select your Shopify connection. If you haven't created your Shopify connection yet, click **+ New** and follow the instructions found above.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-257.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=88ed70dcdf28f60f4e89e2c5ac620e7c" alt="REST API component authentication with Shopify connection selected" width="2060" height="848" data-path="images/connectivity-and-security/image-257.webp" />
  </Frame>
* **URL** - Enter the URL for the Customers endpoint of the Shopify API: **`https://$shop_name/admin/api/2020-04/customers.json?limit=250&updated_at_min=$last_updated`**. Replace the variables `$shop_name` and `$last_updated` with your shop name and a timestamp for the minimum age of the updated data. Make sure the method is set to **GET.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-258.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=54114dcdadbc6a48f93eadf99c1a36eb" alt="Shopify Customers API endpoint URL configuration" width="2082" height="630" data-path="images/connectivity-and-security/image-258.webp" />
  </Frame>
* **Pagination** - Check the box **Use pagination** and select **Automatic** from the **Pagination scheme** drop down menu.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-259.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=264b1a71b0279afe3572145993be1b14" alt="Pagination settings with automatic scheme selected" width="1522" height="724" data-path="images/connectivity-and-security/image-259.webp" />
  </Frame>
* **Response** - Make sure the **JSON** response type is selected. Edit the **Base record JSONPath Expression** field like this: \$.customers\[\*].
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-260.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=18b29c64e752b4c289e6eb4d11cda6a6" alt="JSON response type with base record JSONPath expression" width="1860" height="694" data-path="images/connectivity-and-security/image-260.webp" />
  </Frame>
* **Input fields** - Click **Select all** to move all the Available fields over to the Selected fields or pick and choose which fields you would like by clicking on the + icon next to the field name in the Available Fields column. Then click **Save**.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-261.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=b5406cc96a7f94974cf85e44bcb2ce7c" alt="Input fields selection with available and selected fields" width="1092" height="840" data-path="images/connectivity-and-security/image-261.webp" />
  </Frame>

## Clone Component

* No setup required. The clone component allows you to perform multiple transformations on the same input data.

## Select Component: flatten\_customer\_addresses (left-hand pipeline)

* This section of the pipeline will pass through the customer id and addresses field in order to flatten the array of addresses and build out a customer address table. Click in the first text field in the **Expression** column. Select "id" from the list of fields (#1). Type "id" in the **Alias** column (#2) (or click on the magic wand icon \[#3].) Then click on the plus icon to the right of the Alias value to add another field (#4). In the **Expression** column for the second field select "addresses" (#5). Pass the addresses field into the Flatten function like this: **Flatten(addresses)** (#6) Type "address" in the **Alias** column (#7). For more information on the Flatten function see [this](/etl/flatten/) article. Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-262.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=75e8f26467d2492d628491497a179ff3" alt="Select component flattening customer addresses with Flatten function" width="2140" height="966" data-path="images/connectivity-and-security/image-262.webp" />
  </Frame>

## Select Component: map\_customer\_addresses (left-hand pipeline)

* Click Autofill to bring in all the fields from the previous component. Pass the address field into the JsonStringToMap function like this: **JsonStringToMap(address)** Type "address" in the **Alias** column. For more information on the JsonStringToMap function see [this](/etl/jsonstringtomap/) article. Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-263.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=44f74ab1e3bc7fa44cf4dee4524ae2d6" alt="Select component mapping addresses with JsonStringToMap function" width="2150" height="978" data-path="images/connectivity-and-security/image-263.webp" />
  </Frame>

## Select Component: parse\_customer\_address (left-hand pipeline)

* Click **Autofill** to bring in all the fields from the previous component. Parse the nested address fields using this syntax: field\_name#'key'. For example, **address#'first\_name'.** For any of the non-string fields, explicitly cast them to the appropriate data type. For example, **(long)address#'id'.** For more information on parsing JSON data see [this](/etl/how-do-i-process-json-data/) article. Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-264.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=8466618c07d09872089afa46bcbcee16" alt="Select component parsing nested address fields" width="1072" height="871" data-path="images/connectivity-and-security/image-264.webp" />
  </Frame>

## Destination Component: customers\_addresses\_destination

* The template shows a Redshift destination component; however, if you'd prefer to use a different destination, delete the Redshift component and select a destination component of your choice.
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-265.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=8367c669d9012d9cf22ac442df8b3328" alt="Redshift destination component in the pipeline designer" width="736" height="818" data-path="images/connectivity-and-security/image-265.webp" />
  </Frame>
* **Choose target connection** - Select your target connection. If you haven't created your connection yet, click **+ New.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-266.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=a5911bb3d03f3b185b88fd09c23309b3" alt="Target connection selection dropdown" width="2018" height="676" data-path="images/connectivity-and-security/image-266.webp" />
  </Frame>
* **Destination properties** - Fill in the values for target schema and table, select an operation type, pre or post-action SQL, and advanced options.
* **Schema mapping** - Click **Auto-fill** to bring in all of the fields. If you've selected a Merge operation type, click the **Key** box next to the merge key field(s). Click **Save.**
  <Frame>
    <img src="https://mintcdn.com/integrateio/V1Ns1A4dfxUcZVN3/images/connectivity-and-security/image-267.webp?fit=max&auto=format&n=V1Ns1A4dfxUcZVN3&q=85&s=4f57991e900ca5252c4009fb6853b38d" alt="Schema mapping with auto-filled fields and merge key selection" width="2144" height="1308" data-path="images/connectivity-and-security/image-267.webp" />
  </Frame>

## Select Component: parse\_customer\_address (right-hand pipeline)

* This section of the pipeline will pass through all of the fields except for the addresses field and builds out a customers table. Add another Select component after the Clone component. Click **Autofill** to bring in all the fields from the previous component. Then click the x icon next to the addresses field to remove it. Parse the nested fields inside the default\_address field using this syntax: field\_name#'key'. For example, **default\_address#'first\_name'.** Setting up this component is very similar to setting up the parse\_customer\_address component on the left-hand pipeline. For more information on parsing JSON data see [this](/etl/how-do-i-process-json-data/) article. Click **Save.**

## Destination Component: customers\_destination (right-hand pipeline)

* Follow the same steps to set up this component that you did to set up the customer\_address\_destination component on the left-hand pipeline.
