# Integration Specifications

## Integration Overview

Shopify is a leading e-commerce platform that empowers businesses to easily create and manage online stores, offering built-in analytics and seamless integration with third-party tools for data-driven insights.

This document provides context on what kind of data is being gathered through this extractor, which endpoints that data is coming from, and how the extracted tables relate to each other.

## Integration Availability

This integration is available for:

* Enterprise
* Growth

## API Endpoints

The Daasity Shopify extractor is based on the [Shopify REST API](https://shopify.dev/api/admin-rest) and [Shopify GraphQL](https://shopify.dev/api/admin-graphql) documentation.&#x20;

Daasity is currently using the 2022-04 version of the REST and GraphQL APIs.

The following endpoints are used by Daasity to replicate data from Shopify:

* Customers
  * [Customer](https://shopify.dev/api/admin-rest/2022-04/resources/customer)
* Discounts
  * [Price Rules](https://shopify.dev/api/admin-rest/2022-04/resources/pricerule)
  * [Discount Codes](https://shopify.dev/api/admin-rest/2022-04/resources/discountcode)
* Inventory
  * [Inventory Items](https://shopify.dev/api/admin-graphql/2022-04/queries/inventoryItems)
  * [Inventory Levels](https://shopify.dev/api/admin-rest/2022-04/resources/inventoryitem)
  * [Locations](https://shopify.dev/api/admin-rest/2022-04/resources/location)
* Orders
  * [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
  * [Order (GraphQL)](https://shopify.dev/api/admin-graphql/2022-04/queries/orders)
  * [Refund](https://shopify.dev/api/admin-rest/2022-04/resources/refund)
  * [Transaction](https://shopify.dev/api/admin-rest/2022-04/resources/transaction)
* Plus (Available only with the Daasity Shopify Plus extractor)
  * [Gift Card](https://shopify.dev/api/admin-rest/2022-04/resources/gift-card)
  * [User](https://shopify.dev/api/admin-rest/2022-04/resources/user) (Please contact <support@daasity.com> to enable this endpoint.)
* Products
  * [Collect](https://shopify.dev/api/admin-rest/2022-04/resources/collect)
  * [Custom Collection](https://shopify.dev/api/admin-rest/2022-04/resources/customcollection)
  * [Product](https://shopify.dev/api/admin-rest/2022-04/resources/product)
* Shopify Payments
  * [Payouts](https://shopify.dev/api/admin-rest/2022-04/resources/payouts)
  * [Dispute](https://shopify.dev/api/admin-rest/2022-04/resources/dispute)
  * [Transactions](https://shopify.dev/api/admin-rest/2022-04/resources/transactions#resource-object) (Please contact <support@daasity.com> to enable this endpoint.)
* Store Properties
  * [Shop](https://shopify.dev/api/admin-rest/2022-04/resources/shop)
* Tender Transaction
  * [Tender Transaction](https://shopify.dev/api/admin-rest/2022-04/resources/tendertransaction) (Please contact <support@daasity.com> to enable this endpoint.)

The Orders endpoint runs each hour and all other endpoints are updated daily unless requested otherwise.

## Entity Relationship Diagram (ERD)

[Click here to view the ERD for the Daasity Shopify integration](https://lucid.app/documents/embedded/968ad877-c977-400a-b810-00f1bfaa0d1b) illustrating the different tables and keys to join across tables.

## Shopify & Shopify Plus Schema

The Daasity Shopify extractor creates these tables using the endpoints and replication methods listed. The data is mapped from the source API endpoint to the table based on the mapping logic outlined in each table.

* [Collects](#collects)
* [Custom Collections](#custom-collections)
* [Customer Addresses](#customer-addresses)
* [Customers](#customers)
* [Discount Codes](#discount-codes)
* [Disputes](#disputes)
* [Fulfillment Order Items](#fulfillment-order-items)
* [Gift Cards](#gift-cards)
* [Gift Cards Adjustments](#gift-card-adjustments)
* [Inventory Items](#inventory-items)
* [Inventory Items Country Harmonized System Codes](#inventory-items-country-harmonized-system-codes)
* [Inventory Levels](#inventory-levels)
* [Locations](#locations)
* [Orders](#orders)
* [Order Discount Applications](#order-discount-applications)
* [Order Discount Codes](#order-discount-codes)
* [Order Fulfillments](#order-fulfillments)
* [Order Line Items](#order-line-items)
* [Order Line Duties](#order-line-duties)
* [Order Line Duty Tax Lines](#order-line-duty-tax-lines)
* [Order Line Item Discount Allocations](#order-line-item-discount-allocations)
* [Order Line Item Properties](#order-line-item-properties)
* [Order Note Attributes](#order-note-attributes)
* [Order Payment Gateway Names](#order-payment-gateway-names)
* [Order Refund Transactions](#order-refund-transactions)
* [Order Sales Agreements](#order-sales-agreements)
* [Order Shipping Lines](#order-shipping-lines)
* [Order Shipping Line Tax Lines](#order-shipping-line-tax-lines)
* [Order Tax Lines](#order-tax-lines)
* [Payment Transactions](#payment-transactions)
* [Payouts](#payouts)
* [Price Rules](#price-rules)
* [Products](#products)
* [Product Images](#product-images)
* [Product Variants](#product-variants)
* [Refunds](#refunds)
* [Refund Line Items](#refund-line-items)
* [Refund Order Adjustments](#refund-order-adjustments)
* [Shops](#shops)
* [Tender Transactions](#tender-transactions)
* [Transaction Fee](#transaction-fee)
* [Transactions](#transactions)
* [Transactions Receipt](#transactions-receipt)
* [Users](#users)
* [User Permissions](#user-permissions)

### **Collects**

* Endpoint: [Collect](https://shopify.dev/api/admin-rest/2022-04/resources/collect)
* Update Method: UPSERT
* Table Name: \[`shopify.collects`]

| JSON Element   | Database Column |
| -------------- | --------------- |
| id             | collect\_id     |
| collection\_id | collection\_id  |
| product\_id    | product\_id     |
| position       | position        |
| created\_at    | created\_at     |
| updated\_at    | updated\_at     |
| shop::id       | shop\_id        |

### **Custom Collections**

* Endpoint: [Custom Collection](https://shopify.dev/api/admin-rest/2022-04/resources/customcollection)
* Update Method: UPSERT
* Table Name: \[`shopify.custom_collections`]

| JSON Element     | Database Column        |
| ---------------- | ---------------------- |
| id               | custom\_collection\_id |
| handle           | handle                 |
| title            | title                  |
| sort\_order      | sort\_order            |
| published\_at    | published\_at          |
| published\_scope | published\_scope       |
| updated\_at      | updated\_at            |
| shop::id         | shop\_id               |

### **Customer Addresses**

* Endpoint: [Customer](https://shopify.dev/api/admin-rest/2022-04/resources/customer)
* Update Method: UPSERT
* Table Name: \[`shopify.customer_addresses`]

| JSON Element   | Database Column |
| -------------- | --------------- |
| id             | address\_id     |
| customer\_id   | customer\_id    |
| first\_name    | first\_name     |
| last\_name     | last\_name      |
| company        | company         |
| address1       | address1        |
| address2       | address2        |
| city           | city            |
| province       | state           |
| country        | country         |
| zip            | zipcode         |
| phone          | phone\_number   |
| province\_code | state\_code     |
| country\_code  | country\_code   |
| country\_name  | country\_name   |
| shop::id       | shop\_id        |

### **Customers**

* Endpoint: [Customer](https://shopify.dev/api/admin-rest/2022-04/resources/customer)
* Update Method: UPSERT
* Table Name: \[`shopify.customers`]

| JSON Element                     | Database Column    |
| -------------------------------- | ------------------ |
| id                               | customer\_id       |
| accepts\_marketing               | accepts\_marketing |
| default\_address::id             | address\_id        |
| default\_address::company        | company            |
| default\_address::address1       | address1           |
| default\_address::address2       | address2           |
| default\_address::city           | city               |
| default\_address::province       | state              |
| default\_address::country        | country            |
| default\_address::zip            | zipcode            |
| default\_address::phone          | phone\_number      |
| default\_address::province\_code | state\_code        |
| default\_address::country\_code  | country\_code      |
| default\_address::country\_name  | country\_name      |
| email                            | email              |
| first\_name                      | first\_name        |
| last\_name                       | last\_name         |
| note                             | note               |
| state                            | account\_status    |
| tags                             | tags               |
| verified\_email                  | verified\_email    |
| created\_at                      | created\_at        |
| updated\_at                      | updated\_at        |
| shop::id                         | shop\_id           |

### **Discount Codes**

* Endpoint: [Discount Codes](https://shopify.dev/api/admin-rest/2022-04/resources/discountcode)
* Update Method: UPSERT
* Table Name: \[`shopify.discount_codes`]

| JSON Element    | Database Column    |
| --------------- | ------------------ |
| id              | discount\_code\_id |
| code            | discount\_code     |
| price\_rule\_id | price\_rule\_id    |
| created\_at     | created\_at        |
| updated\_at     | updated\_at        |
| shop::id        | shop\_id           |

### **Disputes**

* Endpoint: [Dispute](https://shopify.dev/api/admin-rest/2022-04/resources/dispute)
* Update Method: UPSERT
* Table Name: \[`shopify.disputes`]

| JSON Element          | Database Column       |
| --------------------- | --------------------- |
| id                    | dispute\_id           |
| order\_id             | order\_id             |
| type                  | type                  |
| currency              | currency              |
| amount                | amount                |
| reason                | reason                |
| network\_reason\_code | network\_reason\_code |
| status                | status                |
| initiated\_at         | initiated\_at         |
| evidence\_due\_by     | evidence\_due\_by     |
| evidence\_sent\_on    | evidence\_sent\_on    |
| finalized\_on         | finalized\_on         |

### **Fulfillment Order Items**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.fulfillment_order_items`]

| JSON Element                                       | Database Column       |
| -------------------------------------------------- | --------------------- |
| id                                                 | fulfillment\_id       |
| order\_id                                          | order\_id             |
| line\_item::id                                     | order\_line\_id       |
| line\_item::variant\_id                            | variant\_id           |
| line\_item::sku                                    | sku                   |
| line\_item::quantity                               | quantity              |
| line\_item::fulfillable\_quantity                  | fulfillable\_quantity |
| line\_item::fulfillment\_status                    | fulfillment\_status   |
| created\_at                                        | created\_at           |
| updated\_at                                        | updated\_at           |
| shop::id                                           | shop\_id              |
| MD5(fulfillment\_id + order\_line\_id + order\_id) | \_\_sync\_key         |

### **Gift Cards**

* Endpoint: [Gift Card](https://shopify.dev/api/admin-rest/2022-04/resources/gift-card)
* Update Method: UPSERT
* Table Name: \[`shopify.gift_cards`]

{% hint style="warning" %}
**NOTE:** This table is only available for merchants on Shopify Plus.&#x20;

Please contact <support@daasity.com> to enable this table, if you are a Shopify Plus merchant.
{% endhint %}

| JSON Element     | Database Column  |
| ---------------- | ---------------- |
| id               | id               |
| balance          | balance          |
| created\_at      | created\_at      |
| updated\_at      | updated\_at      |
| currency         | currency         |
| initial\_value   | initial\_value   |
| disabled\_at     | disabled\_at     |
| line\_item\_id   | line\_item\_id   |
| api\_client\_id  | api\_client\_id  |
| user\_id         | user\_id         |
| customer\_id     | customer\_id     |
| note             | note             |
| expires\_on      | expires\_on      |
| template\_suffix | template\_suffix |
| last\_characters | last\_characters |
| order\_id        | order\_id        |
| shop::id         | shop\_id         |

### **Gift Card Adjustments**

* Endpoint: [Gift Card](https://shopify.dev/api/admin-rest/2022-04/resources/gift-card)
* Update Method: UPSERT
* Table Name: \[`shopify.gift_card_adjustments`]

{% hint style="warning" %}
**NOTE:** This table is only available for merchants on Shopify Plus.&#x20;

Please contact <support@daasity.com> to enable this table, if you are a Shopify Plus merchant.
{% endhint %}

| JSON Element                          | Database Column          |
| ------------------------------------- | ------------------------ |
| id                                    | id                       |
| gift\_card\_id                        | gift\_card\_id           |
| number                                | number                   |
| amount                                | amount                   |
| note                                  | note                     |
| remote\_transaction\_ref              | remote\_transaction\_ref |
| remote\_transaction\_url              | remote\_transaction\_url |
| api\_client\_id                       | api\_client\_id          |
| user\_id                              | user\_id                 |
| order\_transaction\_id                | order\_transaction\_id   |
| created\_at                           | created\_at              |
| updated\_at                           | updated\_at              |
| processed\_at                         | processed\_at            |
| shop::id                              | shop\_id                 |
| MD5(shop\_id + order\_id + tax\_type) | \_\_sync\_key            |

### **Inventory Items**

* Endpoint: [Inventory Items](https://shopify.dev/api/admin-graphql/2022-04/queries/inventoryItems)
* Update Method: UPSERT
* Table Name: \[`shopify.inventory_items`]

| JSON Element              | Database Column     |
| ------------------------- | ------------------- |
| id                        | inventory\_item\_id |
| variant\_id               | variant\_id         |
| sku                       | sku                 |
| cost                      | sku\_cost           |
| requires\_shipping        | required\_shipping  |
| tracked                   | tracked             |
| country\_code\_of\_origin | country\_of\_origin |
| created\_at               | created\_at         |
| updated\_at               | updated\_at         |

### **Inventory Items Country Harmonized System Codes**

* Endpoint: [Inventory Items](https://shopify.dev/api/admin-graphql/2022-04/queries/inventoryItems)
* Update Method: UPSERT
* Table Name: \[`shopify.inventory_items_country_harmonized_system_codes`]

| JSON Element                      | Database Column                   |
| --------------------------------- | --------------------------------- |
| inventory\_item\_id               | inventory\_item\_id               |
| harmonized\_system\_code          | harmonized\_system\_code          |
| country\_code                     | country-code                      |
| country\_harmonized\_system\_code | country\_harmonized\_system\_code |

### **Inventory Levels**

* Endpoint: [Inventory Levels](https://shopify.dev/api/admin-rest/2022-04/resources/inventoryitem)
* Update Method: UPSERT
* Table Name: \[`shopify.inventory_levels`]

| JSON Element                        | Database Column     |
| ----------------------------------- | ------------------- |
| inventory\_item\_id                 | inventory\_item\_id |
| location\_id                        | location\_id        |
| available                           | inventory\_quantity |
| updated\_at                         | updated\_at         |
| shop::id                            | shop\_id            |
| MD5(shop\_id + inventory\_item\_id) | \_key               |

### **Locations**

* Endpoint: [Locations](https://shopify.dev/api/admin-rest/2022-04/resources/location)
* Update Method: UPSERT
* Table Name: \[`shopify.locations`]

| JSON Element | Database Column |
| ------------ | --------------- |
| id           | location\_id    |
| name         | location\_name  |
| address1     | address1        |
| address2     | address2        |
| city         | city            |
| province     | state           |
| country      | country         |
| zip          | zipcode         |
| phone        | phone\_number   |
| deleted\_at  | deleted\_at     |
| created\_at  | created\_at     |
| updated\_at  | updated\_at     |
| shop::id     | shop\_id        |

### **Orders**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.orders`]

| JSON Element                      | Database Column           |
| --------------------------------- | ------------------------- |
| id                                | order\_id                 |
| app\_id                           | app\_id                   |
| browser\_ip                       | browser\_ip               |
| cancel\_reason                    | cancel\_reason            |
| cancelled\_at                     | cancelled\_at             |
| cart\_token                       | cart\_token               |
| currency                          | currency                  |
| customer.id                       | customer\_id              |
| customer\_locale                  | customer\_locale          |
| email                             | email                     |
| financial\_status                 | financial\_status         |
| fulfillment\_status               | fulfillment\_status       |
| tags                              | tags                      |
| name                              | order\_code               |
| note                              | note                      |
| phone                             | phone\_number             |
| referring\_site                   | referring\_site           |
| source\_name                      | source\_name              |
| subtotal\_price                   | subtotal\_price           |
| total\_discounts                  | total\_discounts          |
| total\_line\_items\_price         | total\_line\_items\_price |
| total\_price                      | amount\_charged           |
| total\_tax                        | total\_tax                |
| total\_weight                     | total\_weight             |
| location\_id                      | location\_id              |
| billing\_address::name            | billing\_name             |
| billing\_address::company         | billing\_company          |
| billing\_address::address1        | billing\_address1         |
| billing\_address::address2        | billing\_address2         |
| billing\_address::city            | billing\_city             |
| billing\_address::province        | billing\_state            |
| billing\_address::country         | billing\_country          |
| billing\_address::zip             | billing\_zipcode          |
| billing\_address::phone           | billing\_phone            |
| billing\_address::province\_code  | billing\_state\_code      |
| billing\_address::country\_code   | billing\_country\_code    |
| billing\_address::first\_name     | billing\_first\_name      |
| billing\_address::last\_name      | billing\_last\_name       |
| billing\_address::latitude        | billing\_latitude         |
| billing\_address::longitude       | billing\_longitude        |
| shipping\_address::name           | shipping\_name            |
| shipping\_address::company        | shipping\_company         |
| shipping\_address::address1       | shipping\_address1        |
| shipping\_address::address2       | shipping\_address2        |
| shipping\_address::city           | shipping\_city            |
| shipping\_address::province       | shipping\_state           |
| shipping\_address::country        | shipping\_country         |
| shipping\_address::zip            | shipping\_zipcode         |
| shipping\_address::phone          | shipping\_phone           |
| shipping\_address::province\_code | shipping\_state\_code     |
| shipping\_address::country\_code  | shipping\_country\_code   |
| shipping\_address::first\_name    | shipping\_first\_name     |
| shipping\_address::last\_name     | shipping\_last\_name      |
| shipping\_address::latitude       | shipping\_latitude        |
| shipping\_address::longitude      | shipping\_longitude       |
| processed\_at                     | processed\_at             |
| created\_at                       | created\_at               |
| updated\_at                       | updated\_at               |
| shop::id                          | shop\_id                  |

### **Order Discount Applications**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_discount_applications`]

| JSON Element                 | Database Column              |
| ---------------------------- | ---------------------------- |
| order\_id                    | order\_id                    |
| shop::id                     | shop\_id                     |
| discount\_application\_index | discount\_application\_index |
| value                        | value                        |
| value\_type                  | value\_type                  |
| allocation\_method           | allocation\_method           |
| target\_selection            | target\_selection            |
| target\_type                 | target\_type                 |
| title                        | title                        |
| description                  | description                  |

### **Order Discount Codes**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_discount_codes`]

| JSON Element                     | Database Column |
| -------------------------------- | --------------- |
| order\_id                        | order\_id       |
| amount                           | amount          |
| code                             | code            |
| type                             | type            |
| shop::id                         | shop\_id        |
| MD5(shop\_id + order\_id + code) | \_\_sync\_key   |

### **Order Fulfillments**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_fulfillments`]

| JSON Element      | Database Column        |
| ----------------- | ---------------------- |
| id                | order\_fulfillment\_id |
| order\_id         | order\_id              |
| location\_id      | location\_id           |
| status            | fulfillment\_status    |
| shipment\_status  | shipment\_status       |
| tracking\_company | tracking\_company      |
| tracking\_number  | tracking\_number       |
| created\_at       | created\_at            |
| updated\_at       | updated\_at            |
| shop::id          | shop\_id               |

### **Order Line Items**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_line_items`]

| JSON Element        | Database Column     |
| ------------------- | ------------------- |
| id                  | order\_line\_id     |
| order\_id           | order\_id           |
| fulfillment\_status | fulfillment\_status |
| fulfillment\_id     | fulfillment\_id     |
| price               | price               |
| product\_id         | product\_id         |
| quantity            | quantity            |
| sku                 | sku                 |
| requires\_shipping  | requires\_shipping  |
| title               | product\_title      |
| variant\_id         | variant\_id         |
| vendor              | vendor              |
| name                | product\_name       |
| taxable             | taxable\_flag       |
| total\_discount     | discount\_amount    |
| gift\_card          | gift\_card          |
| \_tax\_lines\_total | tax\_lines\_total   |
| shop::id            | shop\_id            |

### **Order Line Duties**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_line_duties`]

| JSON Element              | Database Column           |
| ------------------------- | ------------------------- |
| id                        | id                        |
| order\_id                 | order\_id                 |
| order\_line\_id           | order\_line\_id           |
| admin\_graphql\_api\_id   | admin\_graphql\_api\_id   |
| country\_code\_of\_origin | country\_code\_of\_origin |
| harmonized\_system\_code  | harmonized\_system\_code  |
| amount                    | amount                    |
| shop::id                  | shop\_id                  |

### **Order Line Duty Tax Lines**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_line_duty_tax_lines`]

| JSON Element          | Database Column       |
| --------------------- | --------------------- |
| order\_id             | order\_id             |
| order\_line\_id       | order\_line\_id       |
| order\_line\_duty\_id | order\_line\_duty\_id |
| price                 | price                 |
| rate                  | rate                  |
| title                 | title                 |
| shop::id              | shop\_id              |

### **Order Line Item Discount Allocations**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_line_item_discount_allocations`]

| JSON Element                                                              | Database Column              |
| ------------------------------------------------------------------------- | ---------------------------- |
| order\_id                                                                 | order\_id                    |
| order\_line\_id                                                           | order\_line\_id              |
| amount                                                                    | amount                       |
| discount\_application\_index                                              | discount\_application\_index |
| shop::id                                                                  | shop\_id                     |
| MD5(shop\_id + order\_id + order\_line\_id + discount\_applicaton\_index) | \_\_sync\_key                |

### **Order Line Item Properties**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_line_item_properties`]

| JSON Element                                       | Database Column |
| -------------------------------------------------- | --------------- |
| id                                                 | order\_line\_id |
| order\_id                                          | order\_id       |
| name                                               | name            |
| value                                              | value           |
| MD5(shop\_id + order\_id + order\_line\_id + name) | \_key           |

### **Order Metafields**

* Endpoint: [Metafield](https://shopify.dev/docs/api/admin-graphql/2024-07/objects/Metafield) (filtered for `ownerType` is `ORDER)`
* Update Method: UPSERT
* Table Name: `[shopify.order_metafields]`

{% hint style="danger" %}
If you set up your Shopify integration before July 2024, you need to contact <support@daasity.com> to enable extraction to this table.
{% endhint %}

| JSON Element | Database Column |
| ------------ | --------------- |
| id           | metafield\_id   |
| owner        | order\_id       |
| namespace    | namespace       |
| key          | key             |
| value        | value           |
| description  | description     |
| type         | \_type          |
| shop::id     | shop\_id        |

### **Order Note Attributes**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_note_attributes`]

| JSON Element                     | Database Column |
| -------------------------------- | --------------- |
| order\_id                        | order\_id       |
| name                             | name            |
| value                            | value           |
| shop::id                         | shop\_id        |
| MD5(shop\_id + order\_id + name) | \_key           |

### **Order Payment Gateway Names**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_payment_gateway_names`]

| JSON Element                      | Database Column |
| --------------------------------- | --------------- |
| order\_id                         | order\_id       |
| value                             | value           |
| shop::id                          | shop\_id        |
| MD5(shop\_id + order\_id + value) | \_\_sync\_key   |

### **Order Refund Transactions**

* Endpoint: [Refund](https://shopify.dev/api/admin-rest/2022-04/resources/refund)
* Update Method: UPSERT
* Table Name: \[`shopify.order_refund_transactions`]

| JSON Element                          | Database Column |
| ------------------------------------- | --------------- |
| order\_id                             | order\_id       |
| refund\_id                            | refund\_id      |
| amount                                | refund\_amount  |
| currency                              | currency\_code  |
| gateway                               | gateway         |
| source\_name                          | source\_name    |
| status                                | status          |
| created\_at                           | created\_at     |
| updated\_at                           | updated\_at     |
| shop::id                              | shop\_id        |
| MD5(shop\_id + order\_id + tax\_type) | \_\_sync\_key   |

### **Order Sales Agreements**

* Endpoint: [Order (GraphQL)](https://shopify.dev/api/admin-graphql/2022-04/queries/orders)
* Update Method: UPSERT
* Table Name: \[`shopify.order_sales_agreements`]

| JSON Element                                | Database Column            |
| ------------------------------------------- | -------------------------- |
| id                                          | id                         |
| happened\_at                                | happened\_at               |
| order\_id                                   | order\_id                  |
| sale\_id                                    | sale\_id                   |
| action\_type                                | action\_type               |
| line\_type                                  | line\_type                 |
| quantity                                    | quantity                   |
| sale::totalAmount::shopMoney::amount        | shop\_money\_amount        |
| sale::totalAmount::presentmentMoney::amount | presentment\_money\_amount |
| sale::lineItem::id                          | line\_id                   |
| sale::lineItem::name                        | line\_name                 |
| shop::id                                    | shop\_id                   |

### **Order Shipping Lines**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_shipping_lines`]

| JSON Element                       | Database Column              |
| ---------------------------------- | ---------------------------- |
| id                                 | shipping\_line\_id           |
| order\_id                          | order\_id                    |
| code                               | shipping\_code               |
| price                              | shipping\_amount             |
| source                             | source                       |
| title                              | shipping\_title              |
| carrier\_identifier                | carrier\_identifier          |
| SUM(tax\_line::amount)             | tax\_lines\_total            |
| SUM(discount\_allocations::amount) | discount\_allocations\_total |
| shop::id                           | shop\_id                     |

### **Order Shipping Line Tax Lines**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_shipping_line_tax_lines`]

| JSON Element                       | Database Column                    |
| ---------------------------------- | ---------------------------------- |
| order\_id                          | order\_id                          |
| shipping\_line\_id                 | shipping\_line\_id                 |
| channel\_liable                    | channel\_liable                    |
| price                              | price                              |
| presentment\_money\_amount         | presentment\_money\_amount         |
| presentment\_money\_currency\_code | presentment\_money\_currency\_code |
| shop\_money\_amount                | shop\_money\_amount                |
| shop\_money\_currency\_code        | shop\_money\_currency\_code        |
| rate                               | rate                               |
| title                              | title                              |
| shop::id                           | shop\_id                           |

### **Order Tax Lines**

* Endpoint: [Order](https://shopify.dev/api/admin-rest/2022-04/resources/order)
* Update Method: UPSERT
* Table Name: \[`shopify.order_tax_lines`]

| JSON Element                          | Database Column |
| ------------------------------------- | --------------- |
| order\_id                             | order\_id       |
| price                                 | tax\_amount     |
| rate                                  | tax\_rate       |
| title                                 | tax\_type       |
| shop::id                              | shop\_id        |
| MD5(shop\_id + order\_id + tax\_type) | \_\_sync\_key   |

### **Payment Transactions**

* Endpoint: [Transaction](https://shopify.dev/api/admin-rest/2022-04/resources/transactions)
* Update Method: UPSERT
* Table Name: \[`shopify.payment_transactions`]

| JSON Element                   | Database Column                |
| ------------------------------ | ------------------------------ |
| id                             | id                             |
| type                           | type                           |
| test                           | test                           |
| payout\_id                     | payout\_id                     |
| payout\_status                 | payout\_status                 |
| currency                       | currency                       |
| amount                         | amount                         |
| fee                            | fee                            |
| net                            | net                            |
| source\_id                     | source\_id                     |
| source\_type                   | source\_type                   |
| source\_order\_transaction\_id | source\_order\_transaction\_id |
| source\_order\_id              | source\_order\_id              |
| processed\_at                  | processed\_at                  |
| shop::id                       | shop\_id                       |

### **Payouts**

* Endpoint: [Payouts](https://shopify.dev/api/admin-rest/2022-04/resources/payouts)
* Update Method: UPSERT
* Table Name: \[`shopify.payouts`]

| JSON Element                             | Database Column                 |
| ---------------------------------------- | ------------------------------- |
| id                                       | payout\_id                      |
| status                                   | status                          |
| date                                     | payout\_date                    |
| currency                                 | currency                        |
| amount                                   | amount                          |
| summary::adjustments\_fee\_amount        | adjustments\_fee\_amount        |
| summary::adjustments\_gross\_amount      | adjustments\_gross\_amount      |
| summary::charges\_fee\_amount            | charges\_fee\_amount            |
| summary::refunds\_fee\_amount            | refunds\_fee\_amount            |
| summary::refunds\_gross\_amount          | refunds\_gross\_amount          |
| summary::reserved\_funds\_fee\_amount    | reserved\_fee\_amount           |
| summary::reserved\_funds\_gross\_amount  | reserved\_gross\_amount         |
| summary::retried\_payouts\_fee\_amount   | retried\_payouts\_fee\_amount   |
| summary::retried\_payouts\_gross\_amount | retried\_payouts\_gross\_amount |

### **Price Rules**

* Endpoint: [Price Rules](https://shopify.dev/api/admin-rest/2022-04/resources/pricerule)
* Update Method: UPSERT
* Table Name: \[`shopify.price_rules`]

| JSON Element        | Database Column         |
| ------------------- | ----------------------- |
| id                  | price\_rule\_id         |
| title               | title                   |
| target\_type        | target\_type            |
| target\_selection   | target\_selection       |
| allocation\_method  | allocation\_method      |
| value\_type         | value\_type             |
| value               | value                   |
| once\_per\_customer | once\_per\_customer     |
| usage\_limit        | usage\_limit            |
| customer\_selection | customer\_selection     |
| starts\_at          | price\_rule\_starts\_at |
| ends\_at            | price\_rule\_ends\_at   |
| created\_at         | created\_at             |
| updated\_at         | updated\_at             |
| shop::id            | shop\_id                |

### **Products**

* Endpoint: [Product](https://shopify.dev/api/admin-rest/2022-04/resources/product)
* Update Method: UPSERT
* Table Name: \[`shopify.products`]

| JSON Element     | Database Column  |
| ---------------- | ---------------- |
| id               | product\_id      |
| handle           | product\_handle  |
| product\_type    | product\_type    |
| tags             | tags             |
| title            | product\_name    |
| vendor           | vendor\_name     |
| published\_scope | published\_scope |
| published\_at    | published\_at    |
| created\_at      | created\_at      |
| updated\_at      | updated\_at      |
| shop::id         | shop\_id         |

### **Product Images**

* Endpoint: [Product](https://shopify.dev/api/admin-rest/2022-04/resources/product)
* Update Method: UPSERT
* Table Name: \[`shopify.product_images`]

| JSON Element | Database Column    |
| ------------ | ------------------ |
| id           | product\_image\_id |
| product\_id  | product\_id        |
| position     | position           |
| src          | image\_url         |
| width        | image\_width       |
| height       | image\_height      |
| created\_at  | created\_at        |
| updated\_at  | updated\_at        |

### **Product Metafields**

* Endpoint: [Metafield](https://shopify.dev/docs/api/admin-graphql/2024-07/objects/Metafield) (filtered for `ownerType` is `PRODUCT)`
* Update Method: UPSERT
* Table Name: `[shopify.product_metafields]`

{% hint style="danger" %}
If you set up your Shopify integration before July 2024, you need to contact <support@daasity.com> to enable extraction to this table.
{% endhint %}

| JSON Element | Database Column |
| ------------ | --------------- |
| id           | metafield\_id   |
| owner        | product\_id     |
| namespace    | namespace       |
| key          | key             |
| value        | value           |
| description  | description     |
| type         | \_type          |
| shop::id     | shop\_id        |

### **Product Variant Metafields**

* Endpoint: [Metafield](https://shopify.dev/docs/api/admin-graphql/2024-07/objects/Metafield) (filtered for `ownerType` is `PRODUCTVARIANT)`
* Update Method: UPSERT
* Table Name: `[shopify.product_variant_metafields]`

{% hint style="danger" %}
If you set up your Shopify integration before July 2024, you need to contact <support@daasity.com> to enable extraction to this table.
{% endhint %}

| JSON Element | Database Column      |
| ------------ | -------------------- |
| id           | metafield\_id        |
| owner        | product\_variant\_id |
| namespace    | namespace            |
| key          | key                  |
| value        | value                |
| description  | description          |
| type         | \_type               |
| shop::id     | shop\_id             |

### **Product Variants**

* Endpoint: [Product](https://shopify.dev/api/admin-rest/2022-04/resources/product)
* Update Method: UPSERT
* Table Name: \[`shopify.product_variants`]

### **Refunds**

* Endpoint: [Refund](https://shopify.dev/api/admin-rest/2022-04/resources/refund)
* Update Method: UPSERT
* Table Name: \[`shopify.refunds`]

| JSON Element  | Database Column |
| ------------- | --------------- |
| id            | refund\_id      |
| order\_id     | order\_id       |
| note          | note            |
| restock       | restock         |
| processed\_at | processed\_at   |
| created\_at   | created\_at     |
| shop::id      | shop\_id        |

### **Refund Line Items**

* Endpoint: [Refund](https://shopify.dev/api/admin-rest/2022-04/resources/refund)
* Update Method: UPSERT
* Table Name: \[`shopify.refund_line_items`]

| JSON Element                     | Database Column                  |
| -------------------------------- | -------------------------------- |
| id                               | refund\_line\_item\_id           |
| refund::order\_id                | order\_id                        |
| refund::id                       | refund\_id                       |
| line\_item\_id                   | line\_item\_id                   |
| quantity                         | quantity                         |
| refund::created\_at              | created\_at                      |
| subtotal                         | subtotal                         |
| total\_tax                       | total\_tax                       |
| line\_item::fulfillment\_service | line\_item\_fulfillment\_service |
| shop::id                         | shop\_id                         |

### **Refund Order Adjustments**

* Endpoint: [Refund](https://shopify.dev/api/admin-rest/2022-04/resources/refund)
* Update Method: UPSERT
* Table Name: \[`shopify.refund_order_adjustments`]

| JSON Element | Database Column               |
| ------------ | ----------------------------- |
| id           | refund\_order\_adjustment\_id |
| order\_id    | order\_id                     |
| refund\_id   | refund\_id                    |
| amount       | amount                        |
| kind         | kind                          |
| reason       | reason                        |
| tax\_amount  | tax\_amount                   |
| shop::id     | shop\_id                      |

### **Shops**

* Endpoint: [Shop](https://shopify.dev/api/admin-rest/2022-04/resources/shop)
* Update Method: UPSERT
* Table Name: \[`shopify.shops`]

| JSON Element             | Database Column          |
| ------------------------ | ------------------------ |
| id                       | id                       |
| name                     | name                     |
| email                    | email                    |
| customer\_email          | customer\_email          |
| domain                   | domain                   |
| myshopify\_domain        | myshopify\_domain        |
| address1                 | address1                 |
| city                     | city                     |
| province                 | state                    |
| country                  | country                  |
| zip                      | zipcode                  |
| phone                    | phone\_number            |
| country\_code            | country\_code            |
| latitude                 | latitude                 |
| longitude                | longitude                |
| currency                 | currency                 |
| iana\_timezone           | timezone\_name           |
| shop\_owner              | shop\_owner              |
| multi\_location\_enabled | multi\_location\_enabled |
| created\_at              | created\_at              |
| updated\_at              | updated\_at              |
| shop::id                 | shop\_id                 |

### **Tender Transactions**

* Endpoint: [Tender Transaction](https://shopify.dev/api/admin-rest/2022-04/resources/tendertransaction)
* Update Method: UPSERT
* Table Name: \[`shopify.tender_transactions`]

{% hint style="info" %}
**NOTE:** Please contact <support@daasity.com> to enable this table.
{% endhint %}

| JSON Element                            | Database Column                         |
| --------------------------------------- | --------------------------------------- |
| id                                      | id                                      |
| order\_id                               | order\_id                               |
| amount                                  | amount                                  |
| currency                                | currency                                |
| user\_id                                | user\_id                                |
| test                                    | test                                    |
| processed\_at                           | processed\_at                           |
| remote\_reference                       | remote\_reference                       |
| payment\_details::credit\_card\_number  | payment\_details\_credit\_card\_number  |
| payment\_details::credit\_card\_company | payment\_details\_credit\_card\_company |
| payment\_method                         | payment\_method                         |
| shop::id                                | shop::id                                |

### **Transaction Fee**

* Endpoint: [Transactions](https://shopify.dev/api/admin-rest/2022-04/resources/transactions#resource-object)
* Update Method: UPSERT
* Table Name: \[`shopify.transaction_fee`]

{% hint style="info" %}
**NOTE:** Please contact <support@daasity.com> to enable this table.
{% endhint %}

| JSON Element                | Database Column             |
| --------------------------- | --------------------------- |
| id                          | id                          |
| order\_id                   | order\_id                   |
| fee:amount                  | amount                      |
| fee:amount::currencyCode    | amount\_currency\_code      |
| fee:flatFee::amount         | flat\_fee\_amount           |
| fee:flatFee::currencyCode   | flat\_fee\_currency\_code   |
| fee:flatFeeName             | flat\_fee\_name             |
| fee:rate                    | rate                        |
| fee::rateName               | rate\_name                  |
| fee:taxAmount::amount       | tax\_amount                 |
| fee:taxAmount::currencyCode | tax\_amount\_currency\_code |
| fee:type                    | type                        |
| shop::id                    | shop\_id                    |

### **Transactions**

* Endpoint: [Transactions](https://shopify.dev/api/admin-rest/2022-04/resources/transactions#resource-object)
* Update Method: UPSERT
* Table Name: \[`shopify.transactions`]

| JSON Element                            | Database Column         |
| --------------------------------------- | ----------------------- |
| id                                      | transaction\_id         |
| order\_id                               | order\_id               |
| amount                                  | transaction\_amount     |
| authorization                           | authorization           |
| currency                                | currency\_code          |
| error\_code                             | error\_code             |
| gateway                                 | gateway                 |
| kind                                    | transaction\_type       |
| payment\_details::avs\_result\_code     | avs\_result\_code       |
| payment\_details::credit\_card\_bin     | credit\_card\_bin       |
| payment\_details::credit\_card\_company | credit\_card\_company   |
| payment\_details::cvv\_result\_code     | cvv\_result\_code       |
| receipt::gift\_card\_id                 | receipt\_gift\_card\_id |
| source\_name                            | source\_name            |
| status                                  | status                  |
| test                                    | test\_transaction       |
| processed\_at                           | processed\_at           |
| created\_at                             | created\_at             |
| shop::id                                | shop\_id                |

### **Transactions Receipt**

* Endpoint: [Transactions](https://shopify.dev/api/admin-rest/2022-04/resources/transactions#resource-object)
* Update Method: UPSERT
* Table Name: \[`shopify.transactions_receipt`]

{% hint style="info" %}
**NOTE:** Please contact <support@daasity.com> to enable this table.
{% endhint %}

| JSON Element    | Database Column |
| --------------- | --------------- |
| transaction\_id | transaction\_id |
| order\_id       | order\_id       |
| name            | name            |
| value           | value           |

### **Users**

* Endpoint: [User](https://shopify.dev/api/admin-rest/2022-04/resources/user)
* Update Method: UPSERT
* Table Name: \[`shopify.users`]

{% hint style="warning" %}
**NOTE:** This table is only available for merchants on Shopify Plus. &#x20;

Please contact <support@daasity.com> to enable this table, if you are a Shopify Plus merchant.
{% endhint %}

| JSON Element           | Database Column        |
| ---------------------- | ---------------------- |
| id                     | id                     |
| account\_number        | account\_number        |
| bio                    | bio                    |
| email                  | email                  |
| first\_name            | first\_name            |
| im                     | im                     |
| last\_name             | last\_name             |
| phone                  | phone                  |
| receive\_announcements | receive\_announcements |
| screen\_name           | screen\_name           |
| url                    | url                    |
| locale                 | locale                 |
| user\_type             | user\_type             |
| store                  | store                  |
| shop::id               | shop\_id               |

### **User Permissions**

* Endpoint: [User](https://shopify.dev/api/admin-rest/2022-04/resources/user)
* Update Method: UPSERT
* Table Name: \[`shopify.users`]

{% hint style="warning" %}
**NOTE:** This table is only available for merchants on Shopify Plus.&#x20;

Please contact <support@daasity.com> to enable this table, if you are a Shopify Plus merchant.
{% endhint %}

| JSON Element | Database Column |
| ------------ | --------------- |
| user\_id     | user\_id        |
| permission   | value           |
| shop::id     | shop\_id        |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.daasity.com/core-concepts/data-integrations/setup-guides/digital-integrations/shopify/integration-specifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
