How to use Get Invoice Smart Skill?
- Getting Started
- Bot Building
- Smart Agent Chat
- Conversation Design
-
Developer Guides
Code Step Integration Static Step Integration Shopify Integration SETU Integration Exotel Integration CIBIL integration Freshdesk KMS Integration PayU Integration Zendesk Guide Integration Twilio Integration Razorpay Integration LeadSquared Integration USU(Unymira) Integration Helo(VivaConnect) Integration Salesforce KMS Integration Stripe Integration PayPal Integration CleverTap Integration Fynd Integration HubSpot Integration Magento Integration WooCommerce Integration Microsoft Dynamics 365 Integration
- Deployment
- External Agent Tool Setup
- Analytics & Reporting
- Notifications
- Commerce Plus
- Troubleshooting Guides
- Release Notes
Table of Contents
Get InvoicePurpose of the skillRequirementsLimitationsHow to make changes to the skill?How to analyze your skill post go-live?The Ecommerce Smart Skills are eligible to fulfill critical customer support queries. The Smart Skills are selected based on market research and user behavior of the retail vertical.
Get Invoice
Name of the skill on Conversation Studio - get invoice
Purpose of the skill - To view and download the customer’s invoice copy on the IVA or via email.
- The IVA will provide the list of past orders to the user.
- The user will proceed by selecting the order for which they need to either download the required invoice or send it to their email id.
- If the user selects download, then they can check their invoice in the IVA and download it directly.
- If the user wants the invoice to be sent to their email id, then the IVA will perform this action and will notify the user about the same.
What’s the design template going to look like?
The skill is designed to keep in mind quick resolution & added value to the user. Reach out to the Conversation Designer for access to the design lucidchart or PDF.
Requirements
- The smart skill assumes the end-user is authenticated already.
- If you wish to add an authentication flow within the bot, you can combine this with the OTP authentication Smart Skill
- For users already logged into your platform (website, apps, etc), authentication can happen via custom signup
- The client has 3 APIs already developed with them -
- Get the list of orders based on user_id
- Download invoice via order ID
- Email invoice copy via order ID
Limitations
This is a no-code smart skill if the APIs are developed to match the API structure added in the skill. If the business has additional rules or logic to be implemented for this use case, you will need to make changes accordingly (read more in the changes section). If the client wants to add further APIs, they will need to add more steps to this smart skill.
How to make changes to the skill?
For UI-related or bot response changes, refer to Generic smart skill.
API calls are made on 3 code steps in the skill.
API 1 - Get the list of orders made by the user to get the invoice copy
Name of the step - Get_user_orders
Approach - In order to get the user orders a valid user must be returned from custom signup or authenticated user by OTP validation.
The sequence of events in the code and where to change them-
Section 1: Used to get entities and variables and send a final response to bot
- Gets entities and environment variables and conversation_details from the body which would be used in the API call or to store user-related information.
- Creates final response to be sent to the bot by calling the process_request method from MainHandler class.
- The response is sent to the output step.
Section 2: Handles the main logic for the response to be sent, also is responsible for calling the API.
- Initializes class with the instance parameters which are used for calling the API to get orders.
- Creates the final response to be sent to the bot, it uses status, message, hsl parameters which are sent to the output step. Along with these parameters extra_parameters can also be sent as a response, it should be a dictionary.
- Calls the getOrders API and returns the response for further processing.
- Generates carousel HSL by calling the get_carousel_item method for creating individual carousel cells. This HSL is displayed on the bot.
- Generates individual carousel elements.
- Used to configure the details to be listed on an individual element.
- Creates HSL based on the variables to be displayed and actionable to an individual element
- Used to create actionable for elements, it can be buttons with different actions/messages assigned to it.
- Calls the method which makes the API call and basis of the status returns the final response consumed by the bot.
- Calls the API to fetch orders.
- Adds extra_paramters to be sent to the bot response.
- Return final response based on the conditions.
Step Name | Nature of Changes | API Name & Contract |
Get_user_orders |
Phone_number entity is used as the user_id to get details. It can be replaced by user_id shared in custom_signup data or another API to fetch user_id based on phone number can also be implemented based on the requirements. Change the carousel details. |
Request:{ "user_id": user_id }Response: { "user": { "first_name": "John", "last_name": "Doe" }, "orders": [ { "order_id": "5398613", "product_name": name, "order_amount": amount, "order_created_date": date, "product_image": product_image, "order_status": order_status } ] } |
API 2 - Download Invoice (download invoice flow)
Name of the step - download invoice
Approach- For this to work the user must select the download invoice option for one of the orders listed to him, which would populate get_order_id_regex entity used for further API references.
The sequence of events in the code and where to change them-
Section 1: Used to get entities and variables and send a final response to bot
- Gets entities and environment variables and conversation_details from the body which would be used in the API call or to store user-related information.
- Creates final response to be sent to the bot by calling the process_request method from MainHandler class.
- The response is sent to the output step.
Section 2: Handles the main logic for the response to be sent, also is responsible for calling the API.
- Initializes class with the instance parameters which are used for calling the API to get orders
- Creates the final response to be sent to the bot, it uses status, message, HSL parameters which are sent to the output step. Along with these parameters extra_parameters can also be sent as a response, it should be a dictionary.
- Calls the get_invoice API and returns the response for further processing.
- Calls the method which makes the API call and basis of the status returns the final response consumed by the bot.
- Calls the API to fetch invoice.
- Adds extra_paramters to be sent to the bot response.
- Return final response based on the conditions
When to deactivate this code step?
If download invoice flow is not required as per the requirement.
Step Name | Nature of Changes | API Name & Contract |
download invoice | Change the carousel details. |
Request: {
"user_id": user_id,
"order_id": order_id
}
Response: {
"user": {
"first_name": "Samantha",
"last_name": "Doe"
},
"invoice_url": invoice_url
}
|
API 3 - Email Invoice (email invoice flow)
Name of the step - email invoice
Approach- For this to work the user must select the email invoice option for one of the orders listed to him, which would populate get_order_id_regex entity used for further API references
The sequence of events in the code and where to change them-
Section 1: Used to get entities and variables and send a final response to bot
- Gets entities and environment variables and conversation_details from the body which would be used in the API call or to store user-related information
- Creates final response to be sent to the bot by calling the process_request method from MainHandler class.
- The response which is sent to the output step.
Section 2: Handles the main logic for the response to be sent, also is responsible for calling the API.
- Initializes class with the instance parameters which are used for calling the API to get orders
- Creates the final response to be sent to the bot, it uses status, message, HSL parameters which are sent to the output step. Along with these parameters extra_parameters can also be sent as a response, it should be a dictionary.
- Calls the get_invoice API and returns the response for further processing.
- Calls the method which makes the API call and basis of the status returns the final response consumed by the bot.
- Calls the API to fetch invoice.
- Adds extra_paramters to be sent to the bot response.
- Return final response based on the conditions.
When to deactivate this code step?
If email invoice flow is not required as per the requirement.
Step Name | Nature of Changes | API Name & Contract |
email invoice | Change the carousel details. |
Request: {
"user_id": user_id,
"order_id": order_id
}
Response: {
"user": {
"first_name": "Samantha",
"last_name": "Doe"
},
"status_code": 200,
"email": email
}
|
How to analyze your skill post go-live?
Create smart funnels on our Intelligent Analytics to analyze how many users are able to reach the end of the chat flow and get their invoice copy.
Smartfunnel suggestion: How many users were able to view their invoice copy successfully
- Start point: start_flow
- Endpoints:
- Give_download_invoice
- Email_sent
- No_invoice_for_order
- API Failure