交易 API 將於 2023 年 5 月 3 日淘汰,並將於 2023 年 6 月 13 日淘汰。詳情請參閱「
對話動作已淘汰」。
設計交易對話 (Dialogflow)
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
設計對話,引導使用者完成交易流程。我們提供參考範例,協助您在設計自己的交易動作時做為參考。
範例
設計秘訣
確保對話的自然流暢,也就是真人說話的方式。
文字轉語音/語音功能的文字不一定與即時通訊泡泡中顯示的文字完全相同。如果即時通訊對話框是對話對話的一部分,就很適合採用這種做法。
問候訪客並吸引他們互動。你可以詢問對方的需求,並提出一些建議方塊,方便他們快速上手。
邀請使用者將商品加入購物車前,請使用 actions.intent.TRANSACTION_REQUIREMENTS_CHECK
進行後端檢查,確認使用者是否已為 Google 助理設定付款方式。
請準備好回應與其他行動裝置或網頁體驗相同的語音問題。舉例來說,你可以在某個尺寸或顏色缺貨後提供類似商品,或是邀請使用者註冊,以便在商品補貨時收到通知。
請注意,訂單摘要是根據您透過 API 傳遞的資料建立而成。「透過 Google 付款」標籤可協助使用者瞭解 Google 已完成付款。
向使用者索取地址資訊等資訊時,請先告訴他們您提出要求的原因,以及這項功能有何益處。
Google 會根據使用者的設定顯示購買授權方式 (不需要驗證、密碼或指紋)。我們的風險評估有時會導致額外的驗證步驟,例如確認卡片的 CVV。
付款完成後,請務必傳送收據和訂單確認信。請讓使用者瞭解,您是收單商家。我們會傳送有關訂單的所有詳細資料 (而不是 Google) 給您。
根據預設,交易可以在有螢幕的表面 (例如 Android 手機) 或僅使用語音的介面 (例如 Google Home) 上執行。
為了盡可能支援純語音交易,請格外謹慎設計良好的對話體驗,引導使用者完成完整的交易體驗。
請注意,部分交易意圖可能需要畫面。大部分這些資訊 (例如新增寄送地址、修正付款問題、帳戶連結) 都會自動傳送至手機。如果畫面中有最適合在畫面中新增的對話內容 (例如:針對卡片建立顯示複合式回應、顯示商家服務條款或隱私權政策),請檢查目前的途徑是否支援 SCREEN_OUTPUT
或 WEB_BROWSER
功能,如果不需要,請轉移至新途徑。
如果您不想透過動作支援純語音交易,可以在動作控制台中依序前往「部署」>「途徑功能」,並將「動作需要顯示畫面輸出」設為「是」,將動作專案設為要求特定畫面。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-07-25 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-25 (世界標準時間)。"],[[["\u003cp\u003eDesign conversational flows for transactional Actions, guiding users through the process similar to a real-world conversation.\u003c/p\u003e\n"],["\u003cp\u003eRefer to provided examples like Shoe store, Ticketing, and Flower Shop to understand transactional Action design.\u003c/p\u003e\n"],["\u003cp\u003eFollow design tips to ensure natural dialog, clear communication, and a smooth user experience, including pre-purchase checks and handling potential issues.\u003c/p\u003e\n"],["\u003cp\u003eTransactions can occur on screen and voice-only surfaces; optimize for both by crafting a comprehensive conversational experience and leveraging surface capabilities effectively.\u003c/p\u003e\n"],["\u003cp\u003eRemember to inform users about data requests, purchase authorization, and merchant responsibility for post-purchase communication.\u003c/p\u003e\n"]]],[],null,["# Designing Transactional Conversations (Dialogflow)\n\nDesign a conversation to guide users through your transactional\nflows. We've provided reference examples that you can use as a guide\nwhen designing your own transactional Actions.\n\nExamples\n--------\n\n[](https://docs.google.com/presentation/d/1Zw-Cg4ODJWpEViJJT_LugxvFv1VeOB7Hw54wNQemrfg) [Shoe store Example](https://docs.google.com/presentation/d/1Zw-Cg4ODJWpEViJJT_LugxvFv1VeOB7Hw54wNQemrfg) \n[](https://docs.google.com/presentation/d/1RBVzklC8n7nPU98lRt1CkzDSFcBlaQf5PWVtlr58OQQ) [Ticketing example](https://docs.google.com/presentation/d/1RBVzklC8n7nPU98lRt1CkzDSFcBlaQf5PWVtlr58OQQ) \n[](https://docs.google.com/presentation/d/1icd64B_mJvba6lmhlfmUy35sejy5n-LsYYkvPXzUXgA) [Flower Shop Example](https://docs.google.com/presentation/d/1icd64B_mJvba6lmhlfmUy35sejy5n-LsYYkvPXzUXgA)\n\nDesign Tips\n-----------\n\n- Make sure the dialogs [sound natural and conversational](/assistant/actions/design) --- the way a real person would talk.\n\n- The text spoken by your TTS/voice does not have to exactly match the text shown in your chat bubbles. It works well if the chat bubbles are a subset of the spoken dialog.\n\n- Greet your visitors and get them engaged. Ask what they need and offer a few suggestion chips to get them started.\n\n- Before inviting the user to add items to the cart, do a backend check using `actions.intent.TRANSACTION_REQUIREMENTS_CHECK` to confirm the user has payments set up for their Google Assistant.\n\n- Be prepared to respond to the same issues with voice as with other mobile or web experiences. For example, offer a similar item when you're out of a certain size or color, or invite users to sign up to be notified when the item is back in stock.\n\n- Note that the order summary is built with the data you pass via the API. The \"Pay with Google\" label helps users understand that Google facilitated the payment.\n\n- When requesting info from your users, like their address info, first let them know why you are making the request and how it will benefit them.\n\n- Google will present the purchase authorization method (either no auth required, password, or fingerprint) based on the user's settings. Sometimes our risk assessment will kick off an additional auth step like confirming CVV for a card.\n\n- After the payment is complete, be sure to send a receipt and an order confirmation. It's important that users understand that you are the merchant of record, and will follow up with all details about the order, not Google.\n\n- By default transactions can be performed on either a surface with a screen (such as an Android phone) or a voice-only surface (such as a Google Home).\n\n - To best support voice-only transactions, take extra care to design a [good conversational experience](/assistant/actions/design) that walks users through the full transaction experience.\n\n - Note that some transactions intents may require a screen. Most of these (e.g. adding a new delivery address, fixing payment issues, account linking) will be handed off to the phone automatically. If there are any additions to the conversation that are best displayed on a screen (e.g. presenting rich responses for card building, displaying a merchant ToS or privacy policy), you should check if the current surface supports the `SCREEN_OUTPUT` or `WEB_BROWSER` capabilities, and [transfer to a new surface](/assistant/df-asdk/surface-capabilities#multi-surface_conversations) if not.\n\n - If you would rather not support voice-only transactions with your Action, you can set your Actions project to require a screen by navigating to **Deploy \\\u003e Surface capabilities** in the [Actions Console](https://console.actions.google.com) and setting **Do your Actions require a screen output** to **Yes**."]]