How to use Check Refund Status 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
Refund StatusRequirementsLimitationsHow to make changes to the skill?How to analyze your skill post go-live?The E-commerce Smart Skills are eligible to fulfill critical customer support queries. Smart Skills are selected based on market research and user behavior of the retail vertical.
Refund Status
Name of the skill on Conversation Studio - check refund status
Purpose of the skill: To view the number of orders for a user along with their refund statuses.
- The IVA will provide the list of orders for which a refund was initiated by the user.
- The user will proceed by selecting the order for which they need to check the refund status.
- The user will also be able to see other details related to their order such as the image of the order and its price.
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 2 APIs already developed with them:
- Get_active_refund_orders via user_id
- Check refund status 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 them here.
API calls are made on 2 code steps in the skill.
API 1: Get the list of orders for which a refund was initiated by the user
Name of the step - get_active_refund_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
- Creates an instance of the main class Haptik and calls the get orders API to fetch all the active orders mapped to a user.
- Creates final response to be sent to the bot by calling the get_final_response method from Haptik class.
- The response is sent to the output step.
Section 2: Calls the get orders API and return corresponding response object or status
- API configurations are to be made in this section (method, URL, timeout)
- Body used for calling the API extra parameters can be added here.
- Headers required for API currently mock headers are added which are mapped to mock response from Haptik postman account.
- Responsible for making requests to endpoint provided.
- Handles Timeout and API error cases also return API response object in case of a successful response.
Section 3: Creates final response which is sent to the bot by taking Haptik class object as input along with the order's response.
- Sets in initial values for carousel, quick_replies, and number_of_orders variables.
- Checks for timeout, API error, zero orders, and successful response and sets the status and number_of_order variables accordingly.
- If an order is successful additional parameter carousal is also filled which internally calls get_carousels function which returns carousel HSL to be displayed on the bot.
- final_response with required parameters is created and replied to the calling function.
Section 4: Random number generator which can be used for providing retry option.
Need to pass the length of random number and it creates random number to a specific length.
Section 5: Create buttons that can be sent if no orders are found (not implemented in current smart skill)
- Configure the message send and the button text to be sent.
- Created the button HSL.
Section 6: Creates carousel elements based on the list of orders passed to it additionally it takes a Haptik class object as an input parameter for implementing a carousel.
Loops over orders list passed to the function and created carousel elements by calling get_carousel_item method from the class object.
- Configures the variables passed to the carousel to be displayed.
- Appends the carousel element to the carousel list.
Section 7: The main class that implements all the functionality required.
- Initializes the instance variables used in the flow.
- Returns the entity value by filtering the entity_object with the enity_name passed as a parameter along with the type of entity it is.
- Creates a simplified entity dictionary that can be used for getting the values by searing the dictionary key. It does this by iterating over the entity object and implementing get_entity_value internally to fetch entity value.
- Used for creating QR items (Not implemented in the smart skill).
- Used for creating QR body (Not implemented in the smart skill).
- Generates carousel elements based on the details passed to it.
- Generates carousel body by adding the carousel elements in the body.
- Makes the calls to API endpoint with the details passed to it.
Step Name | Nature of Changes | API Name & Contract |
get_active_refund_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.
You can also change the carousel details displayed per order |
Request: { "user_id": user_id } Response: { "status": "success", "user": { "first_name": "John", "last_name": "Doe" }, "active_refund_orders": [ { "order_id": "5398613", "product_name": product_name, "price": "345.00", “number_of_items”: 2, "description":product_description, "image_url": image_path, "purchase-date": "26-05-2021" }, ] } |
API 2- Check refund status for an order id
Name of step - check_refund_status
Approach- User must select the order for the list displayed to him/her to capture the order_id and make API requests accordingly.
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 the bot.
- Creates an instance of the main class Haptik and calls the get orders API to fetch all the active orders mapped to a user.
- Creates final response to be sent to the bot by calling the get_final_response method from Haptik class.
- The response is sent to the output step.
Section 2: Calls the get orders API and returns the corresponding response object or status.
- API configurations are to be made in this section (method, URL, timeout).
- Mock cases for displaying data as per the mock response. Remove this while integrating the smart skill with IVA.
- Body used for calling the API extra parameters can be added here.
- Headers required for API currently mock headers are added which are mapped to mock response from Haptik postman account.
- Remove the header “x-mock-response-name” while integrating the smart skill with the current IVA as this header is used for displaying the correct mock cases.
- Responsible for making requests to endpoint provided.
- Handles Timeout and API error cases also return API response object in case of a successful response.
Section 3: Creates final response which is sent to the bot by taking Haptik class object as input along with the order's response.
- Sets in initial values for carousel, quick_replies, and number_of_orders variables.
- Checks for timeout, API error, zero orders, and successful response and sets the status and number_of_order variables accordingly.
- If an order is successful additional parameter carousal is also filled which internally calls get_carousels function which returns carousel HSL to be displayed on the bot.
- final_response with required parameters is created and replied to the calling function.
Section 4: Random number generator which can be used for providing retry option.
Need to pass the length of random number and it creates random number to a specific length.
Section 5: The main class that implements all the functionality required.
- Initializes the instance variables used in the flow.
- Returns the entity value by filtering the entity_object with the enity_name passed as a parameter along with the type of entity it is.
- Creates a simplified entity dictionary that can be used for getting the values by searing the dictionary key. It does this by iterating over the entity object and implementing get_entity_value internally to fetch entity value.
- Used for creating QR item (Not implemented in the smart skill)
- Used for creating QR body (Not implemented in the smart skill)
- Generates carousel elements based on the details passed to it.
- Generates carousel body by adding the carousel elements in the body.
- Makes the calls to API endpoint with the details passed to it.
Step Name | Name of Changes | API Name & Contract |
check_refund_status |
Change the carousel details. |
Request:Order_id in the request endpoint Response: { "status": "success", "refund_details": [ { "refund_status": status, "refund_initiated_date": date, "refund_amount": amount, "payment_mode": payment_mode, "refund_process_id": transaction_id, } ] } |
check_refund_status |
Current outputs configured are processing, processed, and paid. More statuses can be configured as per business |
- |
How to analyse your skill post go-live?
Create smart funnels on our Intelligent Analytics to analyse how many users are able to reach the end of the chat flow and get their invoice copy.
Smart funnel suggestion: How many users were able to view their invoice copy successfully
- Start point: active_refund_orders.
-
Endpoints:
- cant _find_order
- no_orders
- Processing
- Processed<7days
- Processed>7days
- Paid_out