> For the complete documentation index, see [llms.txt](https://docs.dev-cepto.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dev-cepto.com/guides/shopify.md).

# Shopify を接続する

Cepto の品番分析は、Shopify の商品・バリアント・注文をワークスペースに取り込むところから始まります。接続は **設定 → 連携 → Shopify** で行います。

{% hint style="success" %}
通常は **自動接続（OAuth）** を使ってください。Shopify の公式認証フローで、トークンを手入力する必要はありません。
{% endhint %}

## 始める前に

* 対象ワークスペースの **管理者** であること
* 接続するストアのドメイン（`your-shop.myshopify.com`）
* そのストアでアプリ連携を承認できる Shopify アカウント

## 手順

{% stepper %}
{% step %}

#### 連携画面を開く

左メニュー **設定** → **連携** → Shopify の詳細を開きます。
{% endstep %}

{% step %}

#### ショップドメインを入力する

`your-shop.myshopify.com` の形式で入力し、**接続** を押します。サブドメインだけ（`your-shop`）ではなく、`myshopify.com` まで含めてください。
{% endstep %}

{% step %}

#### Shopify で承認する

認証用のウィンドウが開きます。ストアへのアクセスを許可すると、Cepto に接続が登録されます。

{% hint style="warning" %}
ポップアップがブロックされると接続できません。ブラウザで Cepto のポップアップを許可してから、もう一度 **接続** を押してください。
{% endhint %}
{% endstep %}

{% step %}

#### 接続済みストアを確認する

同じ画面の **接続済みストア** にショップ名が出て、状態が **接続中** になっていれば成功です。連携ハブ（設定 → 連携）でも Shopify の状態を確認できます。
{% endstep %}
{% endstepper %}

## 取り込まれるデータ

接続後、Cepto はストアから次を同期し、品番リストとプロジェクト分析に使います。

| データ      | 用途               |
| -------- | ---------------- |
| 商品・バリアント | 品番、商品名、画像、価格、SKU |
| 注文・明細    | 販売数、売上、日次の消化     |
| 在庫数量     | 現在庫、在庫日数などの指標    |

同期には時間がかかることがあります。接続直後に品番リストが空でも、しばらく待って再読み込みしてください。

## 接続状態

連携ハブに表示される状態です。

| 表示  | 意味                 |
| --- | ------------------ |
| 接続中 | 有効。同期・分析に使われます     |
| 未接続 | まだストアがありません        |
| 無効  | 接続はあるがオフです         |
| エラー | 認証切れや同期失敗の可能性があります |

## 手動接続（開発者向け）

同じ画面に **手動接続** があります。アクセストークンを直接貼る方法で、通常の運用では使いません。トークンは設定画面以外に保管しないでください。

## トラブルシュート

<details>

<summary>認証ウィンドウが開かない</summary>

ポップアップブロックを解除し、ドメインが `*.myshopify.com` になっているか確認してください。ブラウザのサードパーティ Cookie 制限が強い場合は、別ブラウザでも試してください。

</details>

<details>

<summary>接続したのに品番が出ない</summary>

1. 連携ハブで状態が **接続中** か確認する
2. 左上で正しいワークスペースを選んでいるか確認する
3. 品番リストを再読み込みする
4. 対象 MD プロジェクトに品番が紐づいているか確認する（[MD プロジェクト](/guides/md-projects.md)）

</details>

<details>

<summary>別のストアの商品が見える / 見えない</summary>

商品データはワークスペース単位です。別ワークスペースに接続したストアは、今のワークスペースには出ません。左上の切替を確認してください。

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.dev-cepto.com/guides/shopify.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
