# Shopify

While we get the Shopify OAuth App ready to use on Daton, we request you create **a Private Custom App** and **Generate a New Access Token from your Shopify Store.**

If you are facing any issues with the Shopify OAuth flow, please [click here](https://daton-sarasanalytics.gitbook.io/daton/integrations/data-sources/ecommerce/shopify/access-tokens-for-shopify) to **Generate a New Shopify Access Token.**&#x20;

### Snapshot

| Features                        | Details                                                         |
| ------------------------------- | --------------------------------------------------------------- |
| Release Status                  | Released                                                        |
| Table Selection                 | Yes                                                             |
| Column Selection                | Yes                                                             |
| Edit Integration                | Yes                                                             |
| Replication Type Selection      | No                                                              |
| Authentication Parameters       | <p>Shopify Shopname<br>Shopify Username<br>Shopify Password</p> |
| Replication Type                | Key Based Incremental                                           |
| Replication Key                 | Date                                                            |
| Suggested Replication Frequency | 1hr                                                             |

| Tables/APIs Supported |           |
| --------------------- | --------- |
| Orders                | Customers |
| Products              |           |

### Integrate Shopify with Daton

1. [Sign in](https://daton.sarasanalytics.com/login) to your existing Daton account.&#x20;
2. Search for Shopify in the list of Connectors and click on the **'Configure'** button.

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2FpYIAhHu0UhCm3LTLkkwb%2Fshopify%20integration1.png?alt=media&#x26;token=9e257cdc-5e49-453e-8646-879bb70a023e" alt=""><figcaption></figcaption></figure>
3. Provide the necessary **Integration Name**, **Replication Frequency**, and **Replication Start Date** data and click on the **'Authenticate'** button.\
   \&#xNAN;*Please Note, the **Integration Name** would be used in creating tables for the integration and cannot be changed later.*&#x20;

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2FBy3xEG2YpROtDFAqTMeO%2Fshopify%20integration2.png?alt=media&#x26;token=ff838911-8322-466d-af04-7b9f91391c99" alt=""><figcaption></figcaption></figure>
4. Provide your Shopify **'Shop Name'** and the generated **'Access Token'** and click on **'Next.'**\
   ([*Click here*](https://daton-sarasanalytics.gitbook.io/daton/integrations/data-sources/ecommerce/access-tokens-for-shopify#steps-to-generate-a-new-shopify-access-token) *to read how to generate an Access Token in Shopify.)*

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2FnQCqxXeQU63KUMjT3gj2%2Fshopify%20integration3.png?alt=media&#x26;token=d3e58260-eb52-423c-9d79-494265bd0019" alt=""><figcaption></figcaption></figure>
5. Post successful authentication, you will be prompted to choose from the list of available tables. **Add** the required Tables and click on **'Next.'**

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2FH4xac16BsZLzzg1fA5Y4%2Fshopify%20integration4.png?alt=media&#x26;token=ffe77baf-37e6-4140-a2d8-726835db689d" alt=""><figcaption></figcaption></figure>
6. Select all the fields you require for each table and **Submit** the integration.&#x20;

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2Fit7GxcTca7qBjaLqd4qx%2Fshopify%20integration6-1.png?alt=media&#x26;token=9d6442ac-4880-4614-9801-04127dbbc505" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2FKCfBb52EfnxLVqHjTH9R%2Fshopify%20integration5.png?alt=media&#x26;token=24d05bc6-0ed3-468c-82fc-4d54f4fa4150" alt=""><figcaption></figcaption></figure>
7. Once submitted, you will be prompted to select the destination for your Shop. Select your favorite destination and click on **'Confirm.'**

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2Fecj04yjI0bYma0JNDXTa%2Fshopify%20integration6.png?alt=media&#x26;token=4013057c-f7f9-4b84-81dd-dadffa5b08ce" alt=""><figcaption></figcaption></figure>

   You will now receive a popup saying **'Integration Successful.'**

   <figure><img src="https://15515196-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LbJ1eMq5M51cIpU163R%2Fuploads%2FkozzzqfZP3p5gXAXVaWh%2Fshopify%20integration7.png?alt=media&#x26;token=c748597f-0a9c-412d-a709-6fa8cc6e6355" alt=""><figcaption></figcaption></figure>

   Congrats! Your Shop has been integrated with Daton.

### Workflow

1. Integrations would be in the Pending state initially and will be moved to the Active state as soon as the first job loads data successfully onto the configured warehouse.
2. Users would be able to edit/pause/re-activate/delete integration anytime
3. Users can view job status and process logs from the integration details page by clicking on the integration name from the active list

### Shopify Data

**Orders**

Purpose: An order is a customer's completed request to purchase one or more products from a shop. An order is created when a customer completes the checkout process, during which time they provide an email address or phone number, billing address and payment information. This Retrieves a list of orders.

Source API Documentation  <https://help.shopify.com/en/api/reference/orders/order#index>

**Fields**

| Name                      | Target Datatype |
| ------------------------- | --------------- |
| admin\_graphql\_api\_id   | STRING          |
| id                        | NUMERIC         |
| email                     | STRING          |
| closed\_at                | STRING          |
| created\_at               | TIMESTAMP       |
| updated\_at               | TIMESTAMP       |
| number                    | INTEGER         |
| note                      | STRING          |
| token                     | STRING          |
| gateway                   | STRING          |
| test                      | BOOLEAN         |
| total\_price              | FLOAT           |
| subtotal\_price           | FLOAT           |
| total\_weight             | INTEGER         |
| total\_tax                | STRING          |
| taxes\_included           | BOOLEAN         |
| currency                  | STRING          |
| financial\_status         | STRING          |
| confirmed                 | BOOLEAN         |
| total\_discounts          | STRING          |
| total\_line\_items\_price | FLOAT           |
| cart\_token               | STRING          |
| buyer\_accepts\_marketing | BOOLEAN         |
| name                      | STRING          |
| referring\_site           | STRING          |
| landing\_site             | STRING          |
| cancelled\_at             | STRING          |
| cancel\_reason            | STRING          |
| total\_price\_usd         | FLOAT           |
| checkout\_token           | STRING          |
| reference                 | STRING          |
| user\_id                  | FLOAT           |
| location\_id              | FLOAT           |
| source\_identifier        | STRING          |
| source\_url               | STRING          |
| processed\_at             | TIMESTAMP       |
| device\_id                | FLOAT           |
| phone                     | STRING          |
| customer\_locale          | STRING          |
| app\_id                   | INTEGER         |
| browser\_ip               | STRING          |
| landing\_site\_ref        | STRING          |
| order\_number             | INTEGER         |
| discount\_codes           | RECORD          |
| note\_attributes          | RECORD          |
| payment\_gateway\_names   | STRING          |
| processing\_method        | STRING          |
| checkout\_id              | FLOAT           |
| source\_name              | STRING          |
| fulfillment\_status       | STRING          |
| tax\_lines                | RECORD          |
| tags                      | STRING          |
| contact\_email            | STRING          |
| order\_status\_url        | STRING          |
| line\_items               | RECORD          |
| shipping\_lines           | RECORD          |
| billing\_address          | RECORD          |
| shipping\_address         | RECORD          |
| fulfillments              | RECORD          |
| client\_details           | RECORD          |
| refunds                   | RECORD          |
| payment\_details          | RECORD          |
| customer                  | RECORD          |

**Customers**

Purpose: The Customer resource stores information about a shop's customers, such as their contact details, their order history, and whether they've agreed to receive email marketing. The Customer resource also holds information on the status of a customer's account. Customers with accounts save time at checkout when they're logged in because they don't need to enter their contact information. This Retrieves a list of customers

Source API Documentation  <https://help.shopify.com/en/api/reference/customers/customer#index>

**Fields**

| Name                    | Target Datatype |
| ----------------------- | --------------- |
| tags                    | STRING          |
| phone                   | STRING          |
| orders\_count           | INTEGER         |
| total\_spent            | FLOAT           |
| multipass\_identifier   | STRING          |
| accepts\_marketing      | BOOLEAN         |
| addresses               | RECORD          |
| verified\_email         | BOOLEAN         |
| state                   | STRING          |
| created\_at             | TIMESTAMP       |
| default\_address        | RECORD          |
| note                    | STRING          |
| email                   | STRING          |
| first\_name             | STRING          |
| updated\_at             | TIMESTAMP       |
| last\_order\_id         | FLOAT           |
| id                      | NUMERIC         |
| last\_name              | STRING          |
| tax\_exempt             | BOOLEAN         |
| last\_order\_name       | STRING          |
| admin\_graphql\_api\_id | STRING          |

**Products**

Purpose: Retrieves a list of products

Source API Documentation  <https://help.shopify.com/en/api/reference/products/product#index>

**Fields**

| Name             | Target Datatype |
| ---------------- | --------------- |
| vendor           | STRING          |
| tags             | STRING          |
| body\_html       | STRING          |
| title            | STRING          |
| created\_at      | TIMESTAMP       |
| handle           | STRING          |
| id               | NUMERIC         |
| image            | RECORD          |
| template\_suffix | STRING          |
| published\_at    | TIMESTAMP       |
| variants         | RECORD          |
| images           | RECORD          |
| published\_scope | STRING          |
| options          | RECORD          |
| updated\_at      | TIMESTAMP       |
| product\_type    | STRING          |

[Click here](https://daton-sarasanalytics.gitbook.io/daton/integrations/data-sources/ecommerce/shopify/access-tokens-for-shopify) if you are facing troubles in the OAuth flow.
