Order status prebuilt component

The order status prebuilt component verifies a customer's authentication level and provides information about the user's most recent or past orders to an authenticated customer.

This component uses the Retail authentication prebuilt component to authenticate users. It also uses Generators for post-call summarization.

Limitations

In addition to the common prebuilt component limitations, this prebuilt component has the following limitations:

  • This component doesn't encrypt any data.

Sample dialogs

These sample dialogs show common scenarios that this prebuilt component handles. They demonstrate behavior when the user calls the component using telephony, which triggers the Default Welcome Intent and the first agent response at the start of the conversation.

Recent order

  1. The user calls from an unregistered number.
  2. The agent authenticates the user and provides detailed information about the shipments in the order.
  3. The user confirms that they want an SMS sent to their registered phone number with additional details.
User Input Agent Response
The agent authenticates the user using the Retail authentication prebuilt component.
Okay, John. Are you calling about your most recent order for John Doe containing lamp, shirt and 10 other items placed on 2023-11-10 at 06:00 PM?
Yes
Your order has 2 shipments, which will be delivered by 2024-01-15.

Would you like to hear more about these shipments?
Yes
Shipment 1 containing jeans, belt and 2 other items is in-transit and will be delivered by 2024-01-12.

Shipment 2 containing lamp, shirt and 6 other items was delivered on 2023-11-12.

Would you like to receive an SMS with further details on your items?
Yes
We have sent you an SMS with a link to track the status of all your shipments. Thank you for calling us.

Duplicate orders

  1. The user has been previously authenticated.
  2. The user requests information about an order and provides the last five digits of the order.
  3. The agent identifies that multiple orders placed by this user share the same last five digits, confirms which order the user wants to hear the status of, and provides the order status to the user.
User Input Agent Response
Okay, Amber. Are you calling about your most recent order for Amber Doe containing lamp, shirt and other 2 items placed on 2023-11-10 at 06:00 PM?
No
Could you please provide the last 5 digits of your order ID that you want to track?
12355
The last five digits of the order ID that we got are 12355, is that correct?
Yes that's right
Great, we are done collecting the order ID.
As per our records, we have found 2 orders ending with the same 5 digits 12355. Which order are you looking for?

Order number 1 which was placed on 2023-11-10 at 06:00 PM or Order number 2 which was placed on 2023-11-09 at 08:00 PM?

To select order number one say 1, to select order number two, say 2. Else say No.
Order one
Your order has 2 shipments, which will be delivered by 2024-01-15.

Would you like to hear more about these shipments?
Yes
Shipment 1 containing jeans is in-transit and will be delivered by 2024-01-15.

Shipment 2 containing lamp, shirt and 1 other items is cancelled.

Would you like to receive an SMS with further details on your items?
No that's all
Thank you for calling us.

Naming conventions

This prebuilt component uses the following naming conventions:

Feature Format Example
Flow [Component Name] Order Status
Webhook prebuilt_components_[component_name]:[webhook_action] prebuilt_components_order_status:get_order_details

Input parameters

Input parameters configure certain behaviors of the component. One or more conditions within the flow use these parameters to determine how the component behaves. You must set flow-scoped parameters on the start page of the component. You can set session-scoped parameters using a calling flow or on the start page of this component.

This prebuilt component accepts the following input parameters:

Parameter Name Description Input Format
$session.params.phone_number (optional) The user's local phone number, without the country code, used to identify the user. string
$session.params.all_recent_order_id (optional) A list of order IDs associated with the authenticated user, sorted by the order placement date in descending order. The first element of the array represents the most recent order. If the authenticated user has no orders, the value of this parameter is null. List (string)
$session.params.email (optional) The email registered with the account. string
$session.params.user_first_name (optional) The user's first name, used to greet and confirm ownership of the account. string
$flow.max_shipment Specifies the number of shipments displayed to the user at a time. The default value is 2. integer
$flow.tracking_status_delivered Specifies the value returned by the webhook indicating a delivered order status. The default value is "delivered". string
$flow.tracking_status_cancelled Specifies the value returned by the webhook indicating a cancelled order status. The default value is "cancelled". string
$flow.tracking_status_returned Specifies the value returned by the webhook indicating a returned order status. The default value is "returned". string
$flow.tracking_status_partially_returned Specifies the value returned by the webhook indicating a partially returned order status. The default value is "partially returned". string
$flow.max_retry_alternate_profile Specifies the number of retries allowed when requesting order status from an unregistered phone number or alternate profile. The default value is 3. integer
$flow.max_retry_order_number Specifies the number of retries allowed when providing an order number. The default value is 3. integer
$flow.max_retry_another_order_id Specifies the number of retries allowed after providing an invalid order number. The default value is 3. integer

To configure the input parameters for this component, expand for instructions.

  1. Open the Dialogflow CX console.
  2. Choose your Google Cloud project.
  3. Select your agent.
  4. Select the Build tab.
  5. Click the imported component in the Flows section.
  6. Click the Start Page in the Pages section.
  7. Click the true Route in the Start Page.
  8. In the Route window, edit the Parameter Presets values as needed.
  9. Click Save.

Output parameters

Output parameters are session parameters that remain active after exiting the component. These parameters contain important information collected by the component.

This prebuilt component provides the following output parameters:

Parameter Name Description Output Format
phone_number The user's local phone number, without the country code, used to identify the user. string
all_recent_order_id A list of order IDs associated with the authenticated user, sorted by the order placement date in descending order. The first element of the array represents the most recent order. If the user has no orders, the value of this parameter is null. List (string)
email The email registered with the account. string
user_first_name The user's first name, used to greet and confirm ownership of the account. string
transfer_reason Indicates the reason the flow exited, if it was not successful. The returned value is one of the following:

agent: the user requested a human agent at some point during the conversation.

denial_of_information: the user declined to share information requested by the component.

max_no_input: the conversation reached the maximum number of retries for no-input events. See no-input built-in events.

max_no_match: the conversation reached the maximum number of retries for no-match events. See no-match built-in events.

webhook_error: a webhook error occurred. See webhook.error built-in event.

webhook_not_found: a webhook URL was unreachable. See webhook.error.not-found built-in event.
string

Basic setup

To set up this prebuilt component, follow these steps:

  1. Import the prebuilt component.
  2. Configure the provided flexible webhooks with settings describing your external services. For more information, see the Webhook setup section.

Webhook setup

To use this component, configure the included flexible webhooks to retrieve the necessary information from your external services.

Authentication

If you haven't previously configured external services required for authentication, you must configure them to let you authenticate users for this component. For more information, see the Retail authentication webhook setup.

Get order details

The prebuilt_components_order_status:get_order_details webhook retrieves order details for a specified order.

API request parameters

The component provides the following parameters as inputs to the API request:

Parameter Name Description Input Format
$flow.order_id The order ID to retrieve details for. string

API response parameters

The component retrieves the following parameters from the API response:

Parameter Name Description Output Format
order_date Date the order was placed, in YYYY-MM-DD format. string
order_time Time the order was placed, in HH:MM format. string
order_status Indicates status for the order. Example values include "pending", "processing", "in-transit", "on-hold", "cancelled", "delivered", "returned", and "partially returned". string
order_product_name A list of product names within the order. List (string)
order_product_quantity Total count of the number of products ordered for each product within an order. integer
order_product_count The number of unique products within an order. integer
order_status_notification Indicates whether notifications are enabled for this order. boolean
return_eligibility_date A list of dates until which each product within the order is eligible for return, in YYYY-MM-DD format. List (string)
order_customer_billing_name First name of the customer's billing name for the order. string
order_latest_delivery_date The latest delivery date across all estimated delivery dates for the shipments within the order, in YYYY-MM-DD format. string
order_shipment_multiple Indicates whether the order contains multiple shipments. boolean
order_shipment_count The number of shipments within the order. integer
order_shipment_product_count Total product count in each shipment within the order. List (integer)
order_shipment_product_name A list of the product names in each shipment within the order. List (string)
order_estimated_delivery_date A list of estimated delivery dates for each shipment within the order, in YYYY-MM-DD format. List (string)
order_shipment_status A list indicating the status for each shipment within the order. Example values include "pending", "processing", "in-transit", "on-hold", "cancelled", "delivered", "returned", and "partially returned". List (string)

To configure the Get order details webhook for this component, expand for instructions.

  1. Open the Dialogflow CX console.
  2. Choose your Google Cloud project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Webhooks.
  6. Select the prebuilt_components_order_status:get_order_details webhook.
  7. Replace the URL in the Dialogflow CX Webhook URL field with the endpoint for the service you want to integrate with. Select the proper Method in the dropdown.
  8. Review and update the Request body to form the proper request format for your webhook.
  9. 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.
  10. Review and update the Authentication settings as needed.
  11. Click Save.

Get duplicate orders

The prebuilt_components_retail_services:get_duplicate_order webhook lets you retrieve detailed information to distinguish between orders when multiple order numbers have the same last five digits.

API request parameters

The component provides the following parameters as inputs to the API request:

Parameter Name Description Input Format
$flow.duplicate_order_id A list containing the last five digits of order numbers shared between one or more orders for the user. List (string)

API response parameters

The component retrieves the following parameters from the API response:

Parameter Name Description Output Format
all_order_date A list of order dates for duplicate orders with the specified last five digits in YYYY-MM-DD format. Each element in this array corresponds to the same element in the all_order_time array. List (string)
all_order_time A list of order times for duplicate orders with the specified last five digits in HH:MM format. Each element in this array corresponds to the same element in the all_order_date array. List (string)

To configure the Get duplicate orders webhook for this component, expand for instructions.

  1. Open the Dialogflow CX console.
  2. Choose your Google Cloud project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Webhooks.
  6. Select the prebuilt_components_retail_services:get_duplicate_order webhook.
  7. Replace the URL in the Dialogflow CX Webhook URL field with the endpoint for the service you want to integrate with. Select the proper Method in the dropdown.
  8. Review and update the Request body to form the proper request format for your webhook.
  9. 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.
  10. Review and update the Authentication settings as needed.
  11. Click Save.

Send SMS

The component uses the prebuilt_components_order_status:send_sms webhook to send order details to the specified phone number using SMS.

API request parameters

The component provides the following parameters as inputs to the API request:

Parameter Name Description Input Format
$session.params.phone_number The user's local phone number, without the country code, used to identify the user. string
$flow.order_id The order ID to send order details for. string

To configure the Send SMS webhook for this component, expand for instructions.

  1. Open the Dialogflow CX console.
  2. Choose your Google Cloud project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Webhooks.
  6. Select the prebuilt_components_order_status:send_sms webhook.
  7. Replace the URL in the Dialogflow CX Webhook URL field with the endpoint for the service you want to integrate with. Select the proper Method in the dropdown.
  8. Review and update the Request body to form the proper request format for your webhook.
  9. 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.
  10. Review and update the Authentication settings as needed.
  11. Click Save.

Enable notifications

The component uses the prebuilt_components_order_status:enable_notification webhook to enable notifications for the user's registered phone number.

API request parameters

The component provides the following parameters as inputs to the API request:

Parameter Name Description Input Format
$session.params.phone_number The user's local phone number, without the country code, used to identify the user. string
$flow.order_notification Indicates whether notifications should be enabled for the user. boolean

To configure the Enable notifications webhook for this component, expand for instructions.

  1. Open the Dialogflow CX console.
  2. Choose your Google Cloud project.
  3. Select your agent.
  4. Select the Manage tab.
  5. Click Webhooks.
  6. Select the prebuilt_components_order_status:enable_notification webhook.
  7. Replace the URL in the Dialogflow CX Webhook URL field with the endpoint for the service you want to integrate with. Select the proper Method in the dropdown.
  8. Review and update the Request body to form the proper request format for your webhook.
  9. 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.
  10. Review and update the Authentication settings as needed.
  11. Click Save.

Complete

The prebuilt component and its webhooks are now set up and ready to test.