# 串接 Shopify

{% hint style="info" %}
串接支援情境

* 會員資料同步\
  \- 單次所有會員資料同步\
  \- Webhook 異動即時同步
* 自動新增 WhatsApp 聯絡人
  {% endhint %}

### 步驟一

在 Omnichat 選單中找到串接頁面：「通訊渠道 > 第三方應用」，並點擊 Shopify 的串接按鈕

<figure><img src="/files/LF9DCR41OsGxU9B7M1ty" alt=""><figcaption></figcaption></figure>

### 步驟二

{% hint style="info" %}
若沒有建立過 shopify app，請繼續往下參考

若已經建立過 shopify app，可以直接前往 [步驟八](#bu-zhou-ba)
{% endhint %}

回到 Shopify 設定後台，並點擊左下角的 Settings >> Apps and slaes channel

<div><figure><img src="/files/CEgHzisFVv3SuKlGpNhx" alt=""><figcaption></figcaption></figure> <figure><img src="/files/gdG2r5W5kX9kpJ35ruS1" alt=""><figcaption></figcaption></figure></div>

### 步驟三

點選 Develop apps >> Create an app

<div><figure><img src="/files/KX1fwwp0mIKgnnxDUEan" alt=""><figcaption></figcaption></figure> <figure><img src="/files/i9L4QXRTKViFMnF7wlXL" alt=""><figcaption></figcaption></figure></div>

### 步驟四

替 App 名稱命名，並選擇有權限的帳號後，進入介面點擊 「Configure Admin API scopes」

<figure><img src="/files/AObVIf9WXttIoXjwlCv0" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/FxlnQYtWv0M6am1jMokf" alt=""><figcaption></figcaption></figure>

### 步驟五

授權 API 權限，需要至少授權 「`read_customers」`

Webhook subscriptions 選擇 2024-04 版本

並點擊頁面最下方的 Save 儲存

<figure><img src="/files/tYyWAjIPTnJWSTNkpQKj" alt=""><figcaption></figcaption></figure>

### 步驟六

點擊 Install app 並同意

<figure><img src="/files/TNU1VbmRPWjms5UWbcIh" alt=""><figcaption></figcaption></figure>

### 步驟七

點擊 「Reveal token once」 取得 API access token

{% hint style="danger" %}
此 token 僅可顯示一次，請妥善保存
{% endhint %}

<figure><img src="/files/rbDQPlC7eQuwbEqf22jQ" alt=""><figcaption></figcaption></figure>

### 步驟八

複製所有串接資訊至 Omnichat 後台

若需要將 Shopify 的會員手機資料新增為 Omnichat 的 WhatsApp 事件，請將 「自動新增 WhatsApp 聯絡人」 打勾，並選擇要同步的帳號

<figure><img src="/files/6YsInhGVGBqs3oqERdpF" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/iZXx2cUrA2jZILezCPRP" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
注意：若您有使用自訂網域，需到 「網域」 頁面，使用預設的商店URL， "必須符合 https\://{store\_name}.myshopify.com" 格式，若使用自訂的商店URL，會導致串接失敗。\
\
確認路徑：Shopify設定後台>網域
{% endhint %}

<figure><img src="/files/zKQtdmxM4wYzKrz6aAmW" alt=""><figcaption><p>確認網域</p></figcaption></figure>

### 步驟九

串接成功後，會顯示同步按鈕，點擊 「立即同步」 會立刻執行同步功能

點擊「稍後同步」的話，也可以隨時回來串接應用程式的功能選單再度同步

<figure><img src="/files/WFzRL4hiDRVL1tH60AzW" alt=""><figcaption></figcaption></figure>

串接成功後，在應用程式的右側會顯示功能選單

<figure><img src="/files/1vpZSbQqdBRxMZpal1XK" alt=""><figcaption><p>取得串接資料後的選單畫面</p></figcaption></figure>

1. 編輯：可以更改商店的串接資訊
2. 資料同步：除了能再次同步聯絡人資料到最新的狀態外，也可以看到上次同步狀態的資訊
3. 解除串接：若要取得不同商店的聯絡人，可以解除串接後再次串接

### 步驟十

完成同步後，會顯示底下畫面。

{% hint style="info" %}
同步資訊中，若「新聯絡人同步數量」為 0，代表這次同步的過程中沒有新增加的聯絡人。
{% endhint %}

<figure><img src="/files/vWefii2wtd5DUspSaLYk" alt=""><figcaption></figcaption></figure>

### 會員資料同步完成後畫面

若完成同步後，可以到「聯絡人及推播訊息 > 網站」的列表中，找到 Shopify 的客人資料。

{% hint style="info" %}
會員資料同步包含以下資料

* 姓名、會員編號、Email、電話、標籤
* 自訂屬性：Shopify - 累積訂單數、Shopify - 累積消費金額、Shopify - 備註、Shopify - Email 行銷同意、Shopify - SMS 行銷同意
  {% endhint %}

<figure><img src="/files/GqI3W8xHFffAe2BBPh9w" alt=""><figcaption></figcaption></figure>

### 注意事項

1. 若在近期有更新連絡人，但串接後沒有看到聯絡人數量更新，請嘗試解除串接後重新串接。


---

# 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://docs.omnichat.ai/features/tong-xun-qu-dao/di-san-fang-ying-yong/chuan-jie-shopify.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.
