[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eThe cancel order component authenticates users and allows them to cancel entire orders or specific items within an order.\u003c/p\u003e\n"],["\u003cp\u003eThis component uses the Retail authentication prebuilt component for user authentication and includes Generators for post-call summarization.\u003c/p\u003e\n"],["\u003cp\u003eThe component has limitations, including the fact that it does not encrypt any data.\u003c/p\u003e\n"],["\u003cp\u003eIt utilizes several webhooks, such as \u003ccode\u003eget_order_details\u003c/code\u003e, \u003ccode\u003eget_duplicate_order_details\u003c/code\u003e, and \u003ccode\u003epost_cancellation_details\u003c/code\u003e, to interact with external services and manage order cancellations.\u003c/p\u003e\n"],["\u003cp\u003eVarious input parameters are used to configure the component's behavior, including options for setting retry limits and defining payment and cancellation reason defaults.\u003c/p\u003e\n"]]],[],null,["# Cancel order prebuilt component\n\nThe cancel order\n[prebuilt component](/dialogflow/cx/docs/concept/prebuilt-component)\nchecks a user's authentication level. Once the user has been authenticated, the\ncomponent provides information about the user's most recent or past orders. The\nuser may then choose to cancel an entire order or cancel specific items in an\norder. This component uses the\n[Retail authentication](/dialogflow/cx/docs/concept/prebuilt-component/authentication-retail)\nprebuilt component to authenticate users. The component also uses\n[Generators](/dialogflow/cx/docs/concept/generative/generators) for post-call\nsummarization.\n\nLimitations\n-----------\n\nIn addition to the\n[common prebuilt component limitations](/dialogflow/cx/docs/concept/prebuilt-component#limits),\nthis prebuilt component has the following limitations:\n\n- This component does not encrypt any data.\n\nSample dialogs\n--------------\n\nThe following sample dialogs demonstrate common scenarios handled by this\nprebuilt component. The sample dialogs demonstrate behavior when the component is\ncalled using telephony, which triggers the Default Welcome Intent and the first\nagent response at the start of the conversation.\n\n### Cancel single product in recent order\n\nEnd-user has been previously authenticated. The agent confirms which items from\nthe most recent order should be cancelled. The agent checks the original method\nof payment and confirms the cancellation details with the user.\n\n### Cancel entire order\n\nEnd-user has been previously authenticated. The agent confirms that the user\nwants to cancel a specific order, then collects the cancellation reason. The\nagent checks the original method of payment and confirms the cancellation\ndetails with the user.\n\nNaming conventions\n------------------\n\nThis prebuilt component uses the following naming conventions:\n\nInput parameters\n----------------\n\nInput parameters are parameters that are used to configure certain behaviors of\nthe component. The parameters will be used by one or more conditions within the\nflow to determine how the component should behave. Flow-scoped parameters must\nbe set on the start page of the component. Session-scoped\nparameters may be set either by a calling flow, or on the start\npage of this component.\n\nThis prebuilt component accepts the following input parameters:\n\nThis prebuilt component allows the following optional parameters to configure\nthe behavior of the component, including retries.\n\n#### To configure the input parameters for this component, expand for instructions.\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Build** tab.\n5. Click the imported component in the **Flows** section.\n6. Click the Start Page in the **Pages** section.\n7. Click the **true** Route in the Start Page.\n8. In the Route window, edit the **Parameter Presets** values as needed.\n9. Click **Save**.\n\nOutput parameters\n-----------------\n\nOutput parameters are session parameters that will remain active after exiting\nthe component. These parameters contain important information collected by the\ncomponent. This prebuilt component provides values for the following output\nparameters:\n\nGenerators\n----------\n\nThis component uses [Generators](/dialogflow/cx/docs/concept/generative/generators)\nto enable specific parts of the conversation.\n\n### Summarization\n\nThe `Summarization` generator is used to generate a post-call summary describing\nthe conversation handled by the component.\n\nBasic setup\n-----------\n\nTo set up this prebuilt component:\n\n1. [Import the prebuilt component](/dialogflow/cx/docs/concept/prebuilt-component#import).\n2. Configure the provided [flexible webhooks](/dialogflow/cx/docs/concept/webhook#flexible) with configuration describing your external services, see Webhook setup.\n\nWebhook setup\n-------------\n\nIn order to use this component, you will need to configure the included\n[flexible webhooks](/dialogflow/cx/docs/concept/webhook#flexible) to retrieve\nneeded information from your external services.\n\n### Authentication\n\nIf you have not previously configured external services required for\nauthentication, you will need to configure them to enable authentication of\nusers for this component. See [Retail authentication webhook setup](/dialogflow/cx/docs/concept/prebuilt-component/authentication-retail#webhook-setup)\nfor detailed instructions.\n\n### Get order details\n\nThe `prebuilt_components_cancel_order:get_order_details` webhook is used\nby the component to retrieve order details for a specified order.\n\n#### API request parameters\n\nThe following parameters are provided by the component as inputs to the API request.\n\n#### API response parameters\n\nThe following parameters are pulled from the API response to be used by the component.\n\n#### To configure the Get order details webhook for this component, expand for instructions.\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Webhooks**.\n6. Select the prebuilt_components_cancel_order:get_order_details webhook.\n7. Replace the URL in the Conversational Agents (Dialogflow CX) **Webhook URL** field with the endpoint for the service you want to integrate with. Select the proper **Method** in the dropdown.\n8. Review and update the **Request body** to form the proper request format for your webhook.\n9. Review and update the **Response configuration** to extract specific fields from your webhook's response. Do not modify the parameter names, as these are required by the component to access the returned field values.\n10. Review and update the **Authentication** settings as needed.\n11. Click **Save**.\n\n### Get duplicate order details\n\nThe `prebuilt_components_retail_services:get_duplicate_order_details` webhook is used\nby the component to retrieve detailed information in order to distinguish between\norders when multiple order numbers have the same last five digits.\n\n#### API request parameters\n\nThe following parameters are provided by the component as inputs to the API request.\n\n#### API response parameters\n\nThe following parameters are pulled from the API response to be used by the component.\n\n#### To configure the Get duplicate order details webhook for this component, expand for instructions.\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Webhooks**.\n6. Select the prebuilt_components_retail_services:get_duplicate_order_details webhook.\n7. Replace the URL in the Conversational Agents (Dialogflow CX) **Webhook URL** field with the endpoint for the service you want to integrate with. Select the proper **Method** in the dropdown.\n8. Review and update the **Request body** to form the proper request format for your webhook.\n9. Review and update the **Response configuration** to extract specific fields from your webhook's response. Do not modify the parameter names, as these are required by the component to access the returned field values.\n10. Review and update the **Authentication** settings as needed.\n11. Click **Save**.\n\n### Post cancellation details\n\nThe `prebuilt_components_cancel_order:post_cancellation_details` webhook is used\nby the component to submit a cancellation request.\n\n#### API request parameters\n\nThe following parameters are provided by the component as inputs to the API request.\n\n#### API response parameters\n\nThe following parameters are pulled from the API response to be used by the component.\n\n#### To configure the Post cancellation details webhook for this component, expand for instructions.\n\n1. Open the [Dialogflow CX console](https://dialogflow.cloud.google.com/cx/projects).\n2. Choose your Google Cloud project.\n3. Select your agent.\n4. Select the **Manage** tab.\n5. Click **Webhooks**.\n6. Select the prebuilt_components_cancel_order:post_cancellation_details webhook.\n7. Replace the URL in the Conversational Agents (Dialogflow CX) **Webhook URL** field with the endpoint for the service you want to integrate with. Select the proper **Method** in the dropdown.\n8. Review and update the **Request body** to form the proper request format for your webhook.\n9. Review and update the **Response configuration** to extract specific fields from your webhook's response. Do not modify the parameter names, as these are required by the component to access the returned field values.\n10. Review and update the **Authentication** settings as needed.\n11. Click **Save**.\n\n### Complete\n\nYour agent and its webhooks should now be set up and ready to test."]]