Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Go to Haptik Website
  • Contact Us
  • Home
  • Bot Building
  • Smart Skills
  • ECommerce

How to use Get Invoice Smart Skill?

Written by Soham Amburle

Updated on August 26th, 2022

Contact Us

If you still have questions or prefer to get help directly from an agent, please submit a request.
We’ll get back to you as soon as possible.

Please fill out the contact form below and we will reply as soon as possible.

  • Getting Started
    Build Deploy Analyse Manage Account Bot Deactivation
  • Bot Building
    Essentials Smart Skills Steps User Messages Bot Responses Entities Connections Customisations User feedback collection Testing Whatsapp Bots NLU Bot Maintenance
  • Smart Agent Chat
    Set up Admin Settings MyChats Section (Agent Inbox) Live Traffic Section Teams Section Archives Section Analytics Plans on Smart Agent Chat
  • Conversation Design
    Design Basics Design Guides Designing for Platforms Designing WhatsApp Bots
  • 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
    Web SDK WhatsApp Facebook Instagram Sunshine Conversation LINE Google Business Messages Telegram MS Teams Bot as an API iOS SDK Android SDK
  • External Agent Tool Setup
    Zendesk Chat Salesforce Service Cloud Freshchat Zoho NICE CXOne Gorgias
  • Analytics & Reporting
    Intelligent Analytics
  • Notifications
    SMS Notifications Success Measurement
  • Commerce Plus
    Catalog Integration Bot Building Guide Channel Deployments Unified ML Pipeline Documentation
  • Troubleshooting Guides
    Error Messages FAQs
  • Release Notes
+ More

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.

  1. The IVA will provide the list of past orders to the user.
  2. 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.
  3. If the user selects download, then they can check their invoice in the IVA and download it directly.
  4. 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

  1. The smart skill assumes the end-user is authenticated already. 
    1. If you wish to add an authentication flow within the bot, you can combine this with the OTP authentication Smart Skill
    2. For users already logged into your platform (website, apps, etc), authentication can happen via custom signup
  2. The client has 3 APIs already developed with them -  
    1. Get the list of orders based on user_id
    2. Download invoice via order ID
    3. 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

  1. 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.
  2.  Creates final response to be sent to the bot by calling the process_request method from MainHandler class.
  3. 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.

  1. Initializes class with the instance parameters which are used for calling the API to get orders.
  2. 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.
  3. Calls the getOrders API and returns the response for further processing.
  4. Generates carousel HSL by calling the get_carousel_item method for creating individual carousel cells. This HSL is displayed on the bot.
  5. Generates individual carousel elements.
    1. Used to configure the details to be listed on an individual element.
    2. Creates HSL based on the variables to be displayed and actionable to an individual element
  6. Used to create actionable for elements, it can be buttons with different actions/messages assigned to it.
  7. Calls the method which makes the API call and basis of the status returns the final response consumed by the bot.
    1. Calls the API to fetch orders.
    2. Adds extra_paramters to be sent to the bot response.
    3. 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

  1. 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.
  2. Creates final response to be sent to the bot by calling the process_request method from MainHandler class.
  3. 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.

  1. Initializes class with the instance parameters which are used for calling the API to get orders
  2. 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.
  3. Calls the get_invoice API and returns the response for further processing.
  4. Calls the method which makes the API call and basis of the status returns the final response consumed by the bot.
    1. Calls the API to fetch invoice.
    2. Adds extra_paramters to be sent to the bot response.
    3. 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

  1. 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
  2. Creates final response to be sent to the bot by calling the process_request method from MainHandler class.
  3. 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.

  1. Initializes class with the instance parameters which are used for calling the API to get orders
  2. 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.
  3. Calls the get_invoice API and returns the response for further processing.
  4. Calls the method which makes the API call and basis of the status returns the final response consumed by the bot.
    1. Calls the API to fetch invoice.
    2. Adds extra_paramters to be sent to the bot response.
    3. 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

  1. Start point: start_flow
  2. Endpoints:
    1. Give_download_invoice
    2. Email_sent
    3. No_invoice_for_order
    4. API Failure

Was this article helpful?

Yes
No
Give feedback about this article

Related Articles

  • How to use Cancel my order Smart Skill?
  • How to use Track my order Smart Skill?
  • How to use Check Refund Status Smart Skill?
  • How to use Return/Replacement Smart Skill?

Platform

  • Conversation Studio
  • Smart Skills
  • Advanced NLU
  • Intelligent Analytics
  • Omnichannel
  • Smart Agent Chat
  • Enterprise Security
  • Integrations

Solutions

  • Conversational Commerce
  • Lead Generation
  • Customer Care
  • WhatsApp
  • Conversational IVR
  • Google Business Messages

Industries

  • Retail/ E-Commerce
  • Financial Services
  • Travel & Hospitality
  • Telecom

Knowledge

  • ROI Calculator
  • Reports & Research
  • Case Studies
  • Webinars
  • ISAT
  • Tech Blog
  • Business Blog
  • Resources
  • Haptik v/s Yellow
  • Haptik v/s Liveperson
  • Haptik v/s IBM Watson
  • Haptik v/s Verloop
  • Conversations on AI

Company

  • Why Haptik
  • About Us
  • Careers
  • News & Media
  • Awards & Recognition
  • Contact Us
  • Partnerships
  • Investor Relations

Subscribe

Sign up to recieve the latest updates

Find us on

  • Twitter-footer
  • Linkedin-footer
  • YT-footer
  • Insta-footer
  • G2-footer
  • Facebook-footer

Knowledge Base Software powered by Helpjuice

Copyright © jio Haptik Technology Limited 2021 | Data Security & Privacy Policy | GDPR

North America | Asia Pacific | Africa | enterprise@haptik.ai

Definition by Author

0
0