---
title: Shopify
description: Shopifyを接続して同期の動作を把握し、書き込まれるすべてのテーブルと列をクエリします。
species: reference
---
# Shopify

ショップのドメインと Admin API トークンを使って Shopify を接続します。このソースは `titan.shopify` に 19 個の固定テーブルを書き込みます。
```sql
select
  id,
  email,
  created_at
from titan.shopify.customers
limit 10
```

## Shopifyを接続する

1. **アプリ**を開き、**アプリを接続**を選択してから、**Shopify**を選択します。
2. ショップのドメインと Admin API トークンを入力します。
3. テーブルを確認してからソースを保存します。
4. 初回の実行が完了するまで**同期履歴**を確認します。

認証情報はシークレットとして保存されます。レイクの列になったり、クエリ結果に表示されたりすることはありません。

## 同期の動作

Shopify のデータは、再開可能な GraphQL の一括処理で取得します。一括処理の ID を保存するため、次回の実行では最初からやり直さずに再開できます。

新しいソースは接続時に同期し、その後はスケジュールに従います。デフォルトの繰り返し間隔は 4 時間です。実行が中断しても、完了した進捗を保持して安全に再試行します。

すべてのレイクのテーブルには[システム列](/docs/concepts/your-lake#システム列) `_synced_at` と `_deleted` もあります。以下の列リファレンスにはソースの列のみを記載しています。

## テーブルリファレンス

### `customers`

`titan.shopify.customers` には 17 個のソース列があります。

```columns table=shopify.customers
id                                      integer pk          ソースのフィールド `id`。
email                                   string              ソースのフィールド `email`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
first_name                              string              ソースのフィールド `firstName`。
last_name                               string              ソースのフィールド `lastName`。
phone                                   string              ソースのフィールド `phone`。
number_of_orders                        integer             ソースのフィールド `numberOfOrders`。
multipass_identifier                    string              ソースのフィールド `multipassIdentifier`。
note                                    string              ソースのフィールド `note`。
state                                   string              ソースのフィールド `state`。
tax_exempt                              boolean             ソースのフィールド `taxExempt`。
amount_spent                            json                ソースのフィールド `amountSpent`。
verified_email                          boolean             ソースのフィールド `verifiedEmail`。
email_marketing_consent                 json                ソースのフィールド `emailMarketingConsent`。
currency_code                           string              ソースのフィールド `currencyCode`。
tags                                    json                ソースのフィールド `tags`。
```

### `mailing_addresses`

`titan.shopify.mailing_addresses` には 17 個のソース列があります。

```columns table=shopify.mailing_addresses
id                                      integer pk          ソースのフィールド `id`。
customer_id                             integer             ソースのフィールド `customerId`。
first_name                              string              ソースのフィールド `firstName`。
last_name                               string              ソースのフィールド `lastName`。
address1                                string              ソースのフィールド `address1`。
address2                                string              ソースのフィールド `address2`。
city                                    string              ソースのフィールド `city`。
company                                 string              ソースのフィールド `company`。
coordinates_validated                   boolean             ソースのフィールド `coordinatesValidated`。
phone                                   string              ソースのフィールド `phone`。
country                                 string              ソースのフィールド `country`。
country_code                            string              ソースのフィールド `countryCode`。
province                                string              ソースのフィールド `province`。
province_code                           string              ソースのフィールド `provinceCode`。
zip                                     string              ソースのフィールド `zip`。
latitude                                float               ソースのフィールド `latitude`。
longitude                               float               ソースのフィールド `longitude`。
```

### `orders`

`titan.shopify.orders` には 42 個のソース列があります。

```columns table=shopify.orders
id                                      integer pk          ソースのフィールド `id`。
note                                    string              ソースのフィールド `note`。
email                                   string              ソースのフィールド `email`。
taxes_included                          boolean             ソースのフィールド `taxesIncluded`。
currency_code                           string              ソースのフィールド `currencyCode`。
name                                    string              ソースのフィールド `name`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
subtotal_price_set                      json                ソースのフィールド `subtotalPriceSet`。
total_tax_set                           json                ソースのフィールド `totalTaxSet`。
total_price_set                         json                ソースのフィールド `totalPriceSet`。
total_discounts_set                     json                ソースのフィールド `totalDiscountsSet`。
total_tip_received_set                  json                ソースのフィールド `totalTipReceivedSet`。
total_shipping_price_set                json                ソースのフィールド `totalShippingPriceSet`。
current_total_price_set                 json                ソースのフィールド `currentTotalPriceSet`。
current_total_discounts_set             json                ソースのフィールド `currentTotalDiscountsSet`。
current_subtotal_price_set              json                ソースのフィールド `currentSubtotalPriceSet`。
current_total_tax_set                   json                ソースのフィールド `currentTotalTaxSet`。
original_total_duties_set               json                ソースのフィールド `originalTotalDutiesSet`。
total_weight                            integer             ソースのフィールド `totalWeight`。
source_name                             string              ソースのフィールド `sourceName`。
client_ip                               string              ソースのフィールド `clientIp`。
shipping_address                        json                ソースのフィールド `shippingAddress`。
billing_address                         json                ソースのフィールド `billingAddress`。
customer_id                             integer             ソースのフィールド `customerId`。
retail_location                         json                ソースのフィールド `retailLocation`。
app_id                                  integer             ソースのフィールド `appId`。
po_number                               string              ソースのフィールド `poNumber`。
display_financial_status                string              ソースのフィールド `displayFinancialStatus`。
display_fulfillment_status              string              ソースのフィールド `displayFulfillmentStatus`。
processed_at                            datetime            ソースのフィールド `processedAt`。
customer_journey_summary                json                ソースのフィールド `customerJourneySummary`。
cancel_reason                           string              ソースのフィールド `cancelReason`。
cancelled_at                            datetime            ソースのフィールド `cancelledAt`。
closed_at                               datetime            ソースのフィールド `closedAt`。
customer_accepts_marketing              boolean             ソースのフィールド `customerAcceptsMarketing`。
confirmed                               boolean             ソースのフィールド `confirmed`。
presentment_currency_code               string              ソースのフィールド `presentmentCurrencyCode`。
status_page_url                         string              ソースのフィールド `statusPageUrl`。
tags                                    json                ソースのフィールド `tags`。
transactions                            json                ソースのフィールド `transactions`。
custom_attributes                       json                ソースのフィールド `customAttributes`。
```

### `order_line_items`

`titan.shopify.order_line_items` には 23 個のソース列があります。

```columns table=shopify.order_line_items
id                                      integer pk          ソースのフィールド `id`。
order_id                                integer             ソースのフィールド `orderId`。
product_id                              integer             ソースのフィールド `productId`。
variant_id                              integer             ソースのフィールド `variantId`。
title                                   string              ソースのフィールド `title`。
name                                    string              ソースのフィールド `name`。
quantity                                integer             ソースのフィールド `quantity`。
current_quantity                        integer             ソースのフィールド `currentQuantity`。
variant                                 json                ソースのフィールド `variant`。
tax_lines                               json                ソースのフィールド `taxLines`。
vendor                                  string              ソースのフィールド `vendor`。
sku                                     string              ソースのフィールド `sku`。
custom_attributes                       json                ソースのフィールド `customAttributes`。
discounted_unit_price_after_all_discounts_set  json                ソースのフィールド `discountedUnitPriceAfterAllDiscountsSet`。
discounted_total_set                    json                ソースのフィールド `discountedTotalSet`。
discounted_unit_price_set               json                ソースのフィールド `discountedUnitPriceSet`。
original_total_set                      json                ソースのフィールド `originalTotalSet`。
original_unit_price_set                 json                ソースのフィールド `originalUnitPriceSet`。
taxable                                 boolean             ソースのフィールド `taxable`。
total_discount_set                      json                ソースのフィールド `totalDiscountSet`。
unfulfilled_original_total_set          json                ソースのフィールド `unfulfilledOriginalTotalSet`。
unfulfilled_quantity                    integer             ソースのフィールド `unfulfilledQuantity`。
variant_title                           string              ソースのフィールド `variantTitle`。
```

### `discount_applications`

`titan.shopify.discount_applications` には 8 個のソース列があります。

```columns table=shopify.discount_applications
order_id                                integer pk          ソースのフィールド `orderId`。
index                                   integer pk          ソースのフィールド `index`。
target_selection                        string              ソースのフィールド `targetSelection`。
target_type                             string              ソースのフィールド `targetType`。
value                                   json                ソースのフィールド `value`。
code                                    string              ソースのフィールド `code`。
type                                    string              ソースのフィールド `type`。
allocation_method                       string              ソースのフィールド `allocationMethod`。
```

### `refunds`

`titan.shopify.refunds` には 6 個のソース列があります。

```columns table=shopify.refunds
id                                      integer pk          ソースのフィールド `id`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
note                                    string              ソースのフィールド `note`。
restock                                 boolean             ソースのフィールド `restock`。
order_id                                integer             ソースのフィールド `orderId`。
```

### `order_adjustments`

`titan.shopify.order_adjustments` には 6 個のソース列があります。

```columns table=shopify.order_adjustments
id                                      integer pk          ソースのフィールド `id`。
order_id                                integer             ソースのフィールド `orderId`。
refund_id                               integer             ソースのフィールド `refundId`。
amount_set                              json                ソースのフィールド `amountSet`。
tax_amount_set                          json                ソースのフィールド `taxAmountSet`。
reason                                  string              ソースのフィールド `reason`。
```

### `refund_line_items`

`titan.shopify.refund_line_items` には 10 個のソース列があります。

```columns table=shopify.refund_line_items
id                                      integer pk          ソースのフィールド `id`。
refund_id                               integer             ソースのフィールド `refundId`。
location_id                             integer             ソースのフィールド `locationId`。
line_item_id                            integer             ソースのフィールド `lineItemId`。
subtotal_set                            json                ソースのフィールド `subtotalSet`。
price_set                               json                ソースのフィールド `priceSet`。
total_tax_set                           json                ソースのフィールド `totalTaxSet`。
quantity                                integer             ソースのフィールド `quantity`。
restocked                               boolean             ソースのフィールド `restocked`。
restock_type                            string              ソースのフィールド `restockType`。
```

### `inventory_items`

`titan.shopify.inventory_items` には 16 個のソース列があります。

```columns table=shopify.inventory_items
id                                      integer pk          ソースのフィールド `id`。
sku                                     string              ソースのフィールド `sku`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
requires_shipping                       boolean             ソースのフィールド `requiresShipping`。
unit_cost                               json                ソースのフィールド `unitCost`。
country_code_of_origin                  string              ソースのフィールド `countryCodeOfOrigin`。
province_code_of_origin                 string              ソースのフィールド `provinceCodeOfOrigin`。
tracked                                 boolean             ソースのフィールド `tracked`。
tracked_editable                        json                ソースのフィールド `trackedEditable`。
inventory_history_url                   string              ソースのフィールド `inventoryHistoryUrl`。
duplicate_sku_count                     integer             ソースのフィールド `duplicateSkuCount`。
measurement                             json                ソースのフィールド `measurement`。
harmonized_system_code                  string              ソースのフィールド `harmonizedSystemCode`。
legacy_resource_id                      integer             ソースのフィールド `legacyResourceId`。
variant_id                              integer             ソースのフィールド `variantId`。
```

### `inventory_levels`

`titan.shopify.inventory_levels` には 5 個のソース列があります。

```columns table=shopify.inventory_levels
id                                      integer pk          ソースのフィールド `id`。
inventory_item_id                       integer pk          ソースのフィールド `inventoryItemId`。
location_id                             integer pk          ソースのフィールド `locationId`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
quantities                              json                ソースのフィールド `quantities`。
```

### `locations`

`titan.shopify.locations` には 6 個のソース列があります。

```columns table=shopify.locations
id                                      integer pk          ソースのフィールド `id`。
address                                 json                ソースのフィールド `address`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
is_active                               boolean             ソースのフィールド `isActive`。
name                                    string              ソースのフィールド `name`。
```

### `products`

`titan.shopify.products` には 14 個のソース列があります。

```columns table=shopify.products
id                                      integer pk          ソースのフィールド `id`。
title                                   string              ソースのフィールド `title`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
published_at                            datetime            ソースのフィールド `publishedAt`。
handle                                  string              ソースのフィールド `handle`。
product_type                            string              ソースのフィールド `productType`。
vendor                                  string              ソースのフィールド `vendor`。
status                                  string              ソースのフィールド `status`。
template_suffix                         string              ソースのフィールド `templateSuffix`。
tags                                    json                ソースのフィールド `tags`。
description                             string              ソースのフィールド `description`。
description_html                        string              ソースのフィールド `descriptionHtml`。
featured_image                          json                ソースのフィールド `featuredImage`。
```

### `product_variants`

`titan.shopify.product_variants` には 23 個のソース列があります。

```columns table=shopify.product_variants
id                                      integer pk          ソースのフィールド `id`。
barcode                                 string              ソースのフィールド `barcode`。
compare_at_price                        float               ソースのフィールド `compareAtPrice`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
display_name                            string              ソースのフィールド `displayName`。
inventory_item_id                       integer             ソースのフィールド `inventoryItemId`。
inventory_quantity                      integer             ソースのフィールド `inventoryQuantity`。
legacy_resource_id                      integer             ソースのフィールド `legacyResourceId`。
position                                integer             ソースのフィールド `position`。
price                                   float               ソースのフィールド `price`。
product_id                              integer             ソースのフィールド `productId`。
requires_components                     boolean             ソースのフィールド `requiresComponents`。
selected_options                        json                ソースのフィールド `selectedOptions`。
sellable_online_quantity                integer             ソースのフィールド `sellableOnlineQuantity`。
show_unit_price                         boolean             ソースのフィールド `showUnitPrice`。
sku                                     string              ソースのフィールド `sku`。
taxable                                 boolean             ソースのフィールド `taxable`。
tax_code                                string              ソースのフィールド `taxCode`。
title                                   string              ソースのフィールド `title`。
unit_price                              json                ソースのフィールド `unitPrice`。
unit_price_measurement                  json                ソースのフィールド `unitPriceMeasurement`。
image                                   json                ソースのフィールド `image`。
```

### `tender_transactions`

`titan.shopify.tender_transactions` には 7 個のソース列があります。

```columns table=shopify.tender_transactions
id                                      integer pk          ソースのフィールド `id`。
order_id                                integer             ソースのフィールド `orderId`。
amount                                  json                ソースのフィールド `amount`。
processed_at                            datetime            ソースのフィールド `processedAt`。
payment_method                          string              ソースのフィールド `paymentMethod`。
remote_reference                        string              ソースのフィールド `remoteReference`。
test                                    boolean             ソースのフィールド `test`。
```

### `order_transactions`

`titan.shopify.order_transactions` には 22 個のソース列があります。

```columns table=shopify.order_transactions
id                                      integer pk          ソースのフィールド `id`。
order_id                                integer             ソースのフィールド `orderId`。
created_at                              datetime            ソースのフィールド `createdAt`。
processed_at                            datetime            ソースのフィールド `processedAt`。
amount_rounding_set                     json                ソースのフィールド `amountRoundingSet`。
amount_set                              json                ソースのフィールド `amountSet`。
currency_exchange_adjustment            json                ソースのフィールド `currencyExchangeAdjustment`。
error_code                              string              ソースのフィールド `errorCode`。
formatted_gateway                       string              ソースのフィールド `formattedGateway`。
gateway                                 string              ソースのフィールド `gateway`。
kind                                    string              ソースのフィールド `kind`。
location_id                             integer             ソースのフィールド `locationId`。
parent_transaction_id                   integer             ソースのフィールド `parentTransactionId`。
payment_id                              string              ソースのフィールド `paymentId`。
receipt_json                            json                ソースのフィールド `receiptJson`。
settlement_currency                     string              ソースのフィールド `settlementCurrency`。
settlement_currency_rate                float               ソースのフィールド `settlementCurrencyRate`。
status                                  string              ソースのフィールド `status`。
test                                    boolean             ソースのフィールド `test`。
total_unsettled_set                     json                ソースのフィールド `totalUnsettledSet`。
user_id                                 integer             ソースのフィールド `userId`。
amount                                  float               ソースのフィールド `amount`。
```

### `fulfillments`

`titan.shopify.fulfillments` には 16 個のソース列があります。

```columns table=shopify.fulfillments
id                                      integer pk          ソースのフィールド `id`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
delivered_at                            datetime            ソースのフィールド `deliveredAt`。
display_status                          string              ソースのフィールド `displayStatus`。
estimated_delivery_at                   datetime            ソースのフィールド `estimatedDeliveryAt`。
in_transit_at                           datetime            ソースのフィールド `inTransitAt`。
legacy_resource_id                      integer             ソースのフィールド `legacyResourceId`。
location_id                             integer             ソースのフィールド `locationId`。
order_id                                integer             ソースのフィールド `orderId`。
name                                    string              ソースのフィールド `name`。
requires_shipping                       boolean             ソースのフィールド `requiresShipping`。
service                                 json                ソースのフィールド `service`。
status                                  string              ソースのフィールド `status`。
total_quantity                          integer             ソースのフィールド `totalQuantity`。
tracking_info                           json                ソースのフィールド `trackingInfo`。
```

### `metafields`

`titan.shopify.metafields` には 11 個のソース列があります。

```columns table=shopify.metafields
id                                      integer pk          ソースのフィールド `id`。
created_at                              datetime            ソースのフィールド `createdAt`。
updated_at                              datetime            ソースのフィールド `updatedAt`。
type                                    string              ソースのフィールド `type`。
key                                     string              ソースのフィールド `key`。
value                                   string              ソースのフィールド `value`。
json_value                              json                ソースのフィールド `jsonValue`。
namespace                               string              ソースのフィールド `namespace`。
owner_id                                integer             ソースのフィールド `ownerId`。
owner_type                              string              ソースのフィールド `ownerType`。
legacy_resource_id                      integer             ソースのフィールド `legacyResourceId`。
```

### `staff_members`

`titan.shopify.staff_members` には 13 個のソース列があります。

```columns table=shopify.staff_members
id                                      integer pk          ソースのフィールド `id`。
account_type                            string              ソースのフィールド `accountType`。
active                                  boolean             ソースのフィールド `active`。
avatar                                  json                ソースのフィールド `avatar`。
email                                   string              ソースのフィールド `email`。
exists                                  boolean             ソースのフィールド `exists`。
first_name                              string              ソースのフィールド `firstName`。
last_name                               string              ソースのフィールド `lastName`。
name                                    string              ソースのフィールド `name`。
initials                                json                ソースのフィールド `initials`。
is_shop_owner                           boolean             ソースのフィールド `isShopOwner`。
locale                                  string              ソースのフィールド `locale`。
phone                                   string              ソースのフィールド `phone`。
```

### `product_images`

`titan.shopify.product_images` には 6 個のソース列があります。

```columns table=shopify.product_images
id                                      integer pk          ソースのフィールド `id`。
product_id                              integer             ソースのフィールド `productId`。
url                                     string              ソースのフィールド `url`。
width                                   integer             ソースのフィールド `width`。
height                                  integer             ソースのフィールド `height`。
alt_text                                string              ソースのフィールド `altText`。
```

## 削除と履歴

行はソースのキーでマージされます。ソース側で行の削除を確認できた場合、Supernova は行を残して `_deleted` を設定します。クエリで履歴を含めるかどうかを選べます。現在の状態だけを取得するには `where not _deleted` で絞り込んでください。
