---
title: Shopify
description: Połącz Shopify, poznaj sposób synchronizacji i wysyłaj zapytania do wszystkich zapisywanych tabel i kolumn.
species: reference
---
# Shopify

Połącz Shopify za pomocą domeny sklepu i tokenu Admin API. Źródło zapisuje 19 stałych tabel w schemacie `titan.shopify`.
```sql
select
  id,
  email,
  created_at
from titan.shopify.customers
limit 10
```

## Połącz Shopify

1. Otwórz **Aplikacje**, wybierz **Połącz aplikację**, a następnie **Shopify**.
2. Podaj domenę sklepu i token Admin API.
3. Sprawdź tabele, a następnie zapisz źródło.
4. Obserwuj **Historię synchronizacji**, aż pierwsze uruchomienie się zakończy.

Dane uwierzytelniające są przechowywane jako sekrety. Nigdy nie stają się kolumnami jeziora ani nie pojawiają się w wynikach zapytań.

## Sposób synchronizacji

Dane Shopify są pobierane przez wznawialne operacje zbiorcze GraphQL. Zapisany identyfikator operacji pozwala kolejnemu uruchomieniu kontynuować pracę zamiast zaczynać od początku.

Nowe źródło synchronizuje się po połączeniu, a następnie zgodnie z harmonogramem. Domyślny interwał cykliczny wynosi 4 godziny. Przerwane uruchomienie zachowuje ukończone postępy i jest bezpiecznie ponawiane.

Każda tabela jeziora ma też [kolumny systemowe](/docs/concepts/your-lake#kolumny-systemowe) `_synced_at` i `_deleted`; poniższa dokumentacja kolumn obejmuje wyłącznie kolumny źródłowe.

## Dokumentacja tabel

### `customers`

`titan.shopify.customers` ma 17 kolumn źródłowych.

```columns table=shopify.customers
id                                      integer pk          Pole źródłowe `id`.
email                                   string              Pole źródłowe `email`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
first_name                              string              Pole źródłowe `firstName`.
last_name                               string              Pole źródłowe `lastName`.
phone                                   string              Pole źródłowe `phone`.
number_of_orders                        integer             Pole źródłowe `numberOfOrders`.
multipass_identifier                    string              Pole źródłowe `multipassIdentifier`.
note                                    string              Pole źródłowe `note`.
state                                   string              Pole źródłowe `state`.
tax_exempt                              boolean             Pole źródłowe `taxExempt`.
amount_spent                            json                Pole źródłowe `amountSpent`.
verified_email                          boolean             Pole źródłowe `verifiedEmail`.
email_marketing_consent                 json                Pole źródłowe `emailMarketingConsent`.
currency_code                           string              Pole źródłowe `currencyCode`.
tags                                    json                Pole źródłowe `tags`.
```

### `mailing_addresses`

`titan.shopify.mailing_addresses` ma 17 kolumn źródłowych.

```columns table=shopify.mailing_addresses
id                                      integer pk          Pole źródłowe `id`.
customer_id                             integer             Pole źródłowe `customerId`.
first_name                              string              Pole źródłowe `firstName`.
last_name                               string              Pole źródłowe `lastName`.
address1                                string              Pole źródłowe `address1`.
address2                                string              Pole źródłowe `address2`.
city                                    string              Pole źródłowe `city`.
company                                 string              Pole źródłowe `company`.
coordinates_validated                   boolean             Pole źródłowe `coordinatesValidated`.
phone                                   string              Pole źródłowe `phone`.
country                                 string              Pole źródłowe `country`.
country_code                            string              Pole źródłowe `countryCode`.
province                                string              Pole źródłowe `province`.
province_code                           string              Pole źródłowe `provinceCode`.
zip                                     string              Pole źródłowe `zip`.
latitude                                float               Pole źródłowe `latitude`.
longitude                               float               Pole źródłowe `longitude`.
```

### `orders`

`titan.shopify.orders` ma 42 kolumny źródłowe.

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

### `order_line_items`

`titan.shopify.order_line_items` ma 23 kolumny źródłowe.

```columns table=shopify.order_line_items
id                                      integer pk          Pole źródłowe `id`.
order_id                                integer             Pole źródłowe `orderId`.
product_id                              integer             Pole źródłowe `productId`.
variant_id                              integer             Pole źródłowe `variantId`.
title                                   string              Pole źródłowe `title`.
name                                    string              Pole źródłowe `name`.
quantity                                integer             Pole źródłowe `quantity`.
current_quantity                        integer             Pole źródłowe `currentQuantity`.
variant                                 json                Pole źródłowe `variant`.
tax_lines                               json                Pole źródłowe `taxLines`.
vendor                                  string              Pole źródłowe `vendor`.
sku                                     string              Pole źródłowe `sku`.
custom_attributes                       json                Pole źródłowe `customAttributes`.
discounted_unit_price_after_all_discounts_set  json                Pole źródłowe `discountedUnitPriceAfterAllDiscountsSet`.
discounted_total_set                    json                Pole źródłowe `discountedTotalSet`.
discounted_unit_price_set               json                Pole źródłowe `discountedUnitPriceSet`.
original_total_set                      json                Pole źródłowe `originalTotalSet`.
original_unit_price_set                 json                Pole źródłowe `originalUnitPriceSet`.
taxable                                 boolean             Pole źródłowe `taxable`.
total_discount_set                      json                Pole źródłowe `totalDiscountSet`.
unfulfilled_original_total_set          json                Pole źródłowe `unfulfilledOriginalTotalSet`.
unfulfilled_quantity                    integer             Pole źródłowe `unfulfilledQuantity`.
variant_title                           string              Pole źródłowe `variantTitle`.
```

### `discount_applications`

`titan.shopify.discount_applications` ma 8 kolumn źródłowych.

```columns table=shopify.discount_applications
order_id                                integer pk          Pole źródłowe `orderId`.
index                                   integer pk          Pole źródłowe `index`.
target_selection                        string              Pole źródłowe `targetSelection`.
target_type                             string              Pole źródłowe `targetType`.
value                                   json                Pole źródłowe `value`.
code                                    string              Pole źródłowe `code`.
type                                    string              Pole źródłowe `type`.
allocation_method                       string              Pole źródłowe `allocationMethod`.
```

### `refunds`

`titan.shopify.refunds` ma 6 kolumn źródłowych.

```columns table=shopify.refunds
id                                      integer pk          Pole źródłowe `id`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
note                                    string              Pole źródłowe `note`.
restock                                 boolean             Pole źródłowe `restock`.
order_id                                integer             Pole źródłowe `orderId`.
```

### `order_adjustments`

`titan.shopify.order_adjustments` ma 6 kolumn źródłowych.

```columns table=shopify.order_adjustments
id                                      integer pk          Pole źródłowe `id`.
order_id                                integer             Pole źródłowe `orderId`.
refund_id                               integer             Pole źródłowe `refundId`.
amount_set                              json                Pole źródłowe `amountSet`.
tax_amount_set                          json                Pole źródłowe `taxAmountSet`.
reason                                  string              Pole źródłowe `reason`.
```

### `refund_line_items`

`titan.shopify.refund_line_items` ma 10 kolumn źródłowych.

```columns table=shopify.refund_line_items
id                                      integer pk          Pole źródłowe `id`.
refund_id                               integer             Pole źródłowe `refundId`.
location_id                             integer             Pole źródłowe `locationId`.
line_item_id                            integer             Pole źródłowe `lineItemId`.
subtotal_set                            json                Pole źródłowe `subtotalSet`.
price_set                               json                Pole źródłowe `priceSet`.
total_tax_set                           json                Pole źródłowe `totalTaxSet`.
quantity                                integer             Pole źródłowe `quantity`.
restocked                               boolean             Pole źródłowe `restocked`.
restock_type                            string              Pole źródłowe `restockType`.
```

### `inventory_items`

`titan.shopify.inventory_items` ma 16 kolumn źródłowych.

```columns table=shopify.inventory_items
id                                      integer pk          Pole źródłowe `id`.
sku                                     string              Pole źródłowe `sku`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
requires_shipping                       boolean             Pole źródłowe `requiresShipping`.
unit_cost                               json                Pole źródłowe `unitCost`.
country_code_of_origin                  string              Pole źródłowe `countryCodeOfOrigin`.
province_code_of_origin                 string              Pole źródłowe `provinceCodeOfOrigin`.
tracked                                 boolean             Pole źródłowe `tracked`.
tracked_editable                        json                Pole źródłowe `trackedEditable`.
inventory_history_url                   string              Pole źródłowe `inventoryHistoryUrl`.
duplicate_sku_count                     integer             Pole źródłowe `duplicateSkuCount`.
measurement                             json                Pole źródłowe `measurement`.
harmonized_system_code                  string              Pole źródłowe `harmonizedSystemCode`.
legacy_resource_id                      integer             Pole źródłowe `legacyResourceId`.
variant_id                              integer             Pole źródłowe `variantId`.
```

### `inventory_levels`

`titan.shopify.inventory_levels` ma 5 kolumn źródłowych.

```columns table=shopify.inventory_levels
id                                      integer pk          Pole źródłowe `id`.
inventory_item_id                       integer pk          Pole źródłowe `inventoryItemId`.
location_id                             integer pk          Pole źródłowe `locationId`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
quantities                              json                Pole źródłowe `quantities`.
```

### `locations`

`titan.shopify.locations` ma 6 kolumn źródłowych.

```columns table=shopify.locations
id                                      integer pk          Pole źródłowe `id`.
address                                 json                Pole źródłowe `address`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
is_active                               boolean             Pole źródłowe `isActive`.
name                                    string              Pole źródłowe `name`.
```

### `products`

`titan.shopify.products` ma 14 kolumn źródłowych.

```columns table=shopify.products
id                                      integer pk          Pole źródłowe `id`.
title                                   string              Pole źródłowe `title`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
published_at                            datetime            Pole źródłowe `publishedAt`.
handle                                  string              Pole źródłowe `handle`.
product_type                            string              Pole źródłowe `productType`.
vendor                                  string              Pole źródłowe `vendor`.
status                                  string              Pole źródłowe `status`.
template_suffix                         string              Pole źródłowe `templateSuffix`.
tags                                    json                Pole źródłowe `tags`.
description                             string              Pole źródłowe `description`.
description_html                        string              Pole źródłowe `descriptionHtml`.
featured_image                          json                Pole źródłowe `featuredImage`.
```

### `product_variants`

`titan.shopify.product_variants` ma 23 kolumny źródłowe.

```columns table=shopify.product_variants
id                                      integer pk          Pole źródłowe `id`.
barcode                                 string              Pole źródłowe `barcode`.
compare_at_price                        float               Pole źródłowe `compareAtPrice`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
display_name                            string              Pole źródłowe `displayName`.
inventory_item_id                       integer             Pole źródłowe `inventoryItemId`.
inventory_quantity                      integer             Pole źródłowe `inventoryQuantity`.
legacy_resource_id                      integer             Pole źródłowe `legacyResourceId`.
position                                integer             Pole źródłowe `position`.
price                                   float               Pole źródłowe `price`.
product_id                              integer             Pole źródłowe `productId`.
requires_components                     boolean             Pole źródłowe `requiresComponents`.
selected_options                        json                Pole źródłowe `selectedOptions`.
sellable_online_quantity                integer             Pole źródłowe `sellableOnlineQuantity`.
show_unit_price                         boolean             Pole źródłowe `showUnitPrice`.
sku                                     string              Pole źródłowe `sku`.
taxable                                 boolean             Pole źródłowe `taxable`.
tax_code                                string              Pole źródłowe `taxCode`.
title                                   string              Pole źródłowe `title`.
unit_price                              json                Pole źródłowe `unitPrice`.
unit_price_measurement                  json                Pole źródłowe `unitPriceMeasurement`.
image                                   json                Pole źródłowe `image`.
```

### `tender_transactions`

`titan.shopify.tender_transactions` ma 7 kolumn źródłowych.

```columns table=shopify.tender_transactions
id                                      integer pk          Pole źródłowe `id`.
order_id                                integer             Pole źródłowe `orderId`.
amount                                  json                Pole źródłowe `amount`.
processed_at                            datetime            Pole źródłowe `processedAt`.
payment_method                          string              Pole źródłowe `paymentMethod`.
remote_reference                        string              Pole źródłowe `remoteReference`.
test                                    boolean             Pole źródłowe `test`.
```

### `order_transactions`

`titan.shopify.order_transactions` ma 22 kolumny źródłowe.

```columns table=shopify.order_transactions
id                                      integer pk          Pole źródłowe `id`.
order_id                                integer             Pole źródłowe `orderId`.
created_at                              datetime            Pole źródłowe `createdAt`.
processed_at                            datetime            Pole źródłowe `processedAt`.
amount_rounding_set                     json                Pole źródłowe `amountRoundingSet`.
amount_set                              json                Pole źródłowe `amountSet`.
currency_exchange_adjustment            json                Pole źródłowe `currencyExchangeAdjustment`.
error_code                              string              Pole źródłowe `errorCode`.
formatted_gateway                       string              Pole źródłowe `formattedGateway`.
gateway                                 string              Pole źródłowe `gateway`.
kind                                    string              Pole źródłowe `kind`.
location_id                             integer             Pole źródłowe `locationId`.
parent_transaction_id                   integer             Pole źródłowe `parentTransactionId`.
payment_id                              string              Pole źródłowe `paymentId`.
receipt_json                            json                Pole źródłowe `receiptJson`.
settlement_currency                     string              Pole źródłowe `settlementCurrency`.
settlement_currency_rate                float               Pole źródłowe `settlementCurrencyRate`.
status                                  string              Pole źródłowe `status`.
test                                    boolean             Pole źródłowe `test`.
total_unsettled_set                     json                Pole źródłowe `totalUnsettledSet`.
user_id                                 integer             Pole źródłowe `userId`.
amount                                  float               Pole źródłowe `amount`.
```

### `fulfillments`

`titan.shopify.fulfillments` ma 16 kolumn źródłowych.

```columns table=shopify.fulfillments
id                                      integer pk          Pole źródłowe `id`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
delivered_at                            datetime            Pole źródłowe `deliveredAt`.
display_status                          string              Pole źródłowe `displayStatus`.
estimated_delivery_at                   datetime            Pole źródłowe `estimatedDeliveryAt`.
in_transit_at                           datetime            Pole źródłowe `inTransitAt`.
legacy_resource_id                      integer             Pole źródłowe `legacyResourceId`.
location_id                             integer             Pole źródłowe `locationId`.
order_id                                integer             Pole źródłowe `orderId`.
name                                    string              Pole źródłowe `name`.
requires_shipping                       boolean             Pole źródłowe `requiresShipping`.
service                                 json                Pole źródłowe `service`.
status                                  string              Pole źródłowe `status`.
total_quantity                          integer             Pole źródłowe `totalQuantity`.
tracking_info                           json                Pole źródłowe `trackingInfo`.
```

### `metafields`

`titan.shopify.metafields` ma 11 kolumn źródłowych.

```columns table=shopify.metafields
id                                      integer pk          Pole źródłowe `id`.
created_at                              datetime            Pole źródłowe `createdAt`.
updated_at                              datetime            Pole źródłowe `updatedAt`.
type                                    string              Pole źródłowe `type`.
key                                     string              Pole źródłowe `key`.
value                                   string              Pole źródłowe `value`.
json_value                              json                Pole źródłowe `jsonValue`.
namespace                               string              Pole źródłowe `namespace`.
owner_id                                integer             Pole źródłowe `ownerId`.
owner_type                              string              Pole źródłowe `ownerType`.
legacy_resource_id                      integer             Pole źródłowe `legacyResourceId`.
```

### `staff_members`

`titan.shopify.staff_members` ma 13 kolumn źródłowych.

```columns table=shopify.staff_members
id                                      integer pk          Pole źródłowe `id`.
account_type                            string              Pole źródłowe `accountType`.
active                                  boolean             Pole źródłowe `active`.
avatar                                  json                Pole źródłowe `avatar`.
email                                   string              Pole źródłowe `email`.
exists                                  boolean             Pole źródłowe `exists`.
first_name                              string              Pole źródłowe `firstName`.
last_name                               string              Pole źródłowe `lastName`.
name                                    string              Pole źródłowe `name`.
initials                                json                Pole źródłowe `initials`.
is_shop_owner                           boolean             Pole źródłowe `isShopOwner`.
locale                                  string              Pole źródłowe `locale`.
phone                                   string              Pole źródłowe `phone`.
```

### `product_images`

`titan.shopify.product_images` ma 6 kolumn źródłowych.

```columns table=shopify.product_images
id                                      integer pk          Pole źródłowe `id`.
product_id                              integer             Pole źródłowe `productId`.
url                                     string              Pole źródłowe `url`.
width                                   integer             Pole źródłowe `width`.
height                                  integer             Pole źródłowe `height`.
alt_text                                string              Pole źródłowe `altText`.
```

## Usunięcia i historia

Wiersze są scalane według klucza źródłowego. Gdy źródło może potwierdzić usunięcie wiersza, Supernova zachowuje go i ustawia `_deleted`, dzięki czemu zapytania mogą zdecydować, czy uwzględniać historię. Aby pobierać bieżący stan, filtruj zapytania przez `where not _deleted`.
