Cloudkibo / KiboPush

0 stars 1 forks source link

Messenger ChatBot for FaceBook Shop #10861

Closed jekram closed 3 years ago

jekram commented 3 years ago

Messenger ChatBot for FaceBook Shop

This is to create the Messenger ChatBot for Facebook Shop.

The UI and the logic should be the same Messenger Chatbot for Shopify. The only thing that should change is the back end API calls to Facebook Shop API instead of Shopify. The chatbot should be able to work with both at the same time.

Please modify the current design and identify the task.

This is the US audience only and payment integrated with Facebook.

sojharo commented 3 years ago

I have reviewed the Facebook Commerce Platform API. There are certain limitations from the Facebook Commerce Platform API due to which not all of my identified chatbot related tasks can be done.

Following important API entities and API endpoints which are required for our chatbot are not available in Facebook Commerce API:

  1. Checkout and Cart APIs
  2. Create Order API, (we can list order by facebook page id, or see order status by order number)
  3. Customer APIs (we can't create, update, or list customers, can't add billing address or shipping address)
  4. Search Products API (we can only upload orders to FB catalog using Batch APIs or csv files)
  5. Search Product categories (we can create them using batch api but not list, update or delete them)

It looks like Facebook Commerce Platform API is released so that merchants and shop-owners can easily upload their products, product variants, categories and inventory to Facebook Shops. Facebook Commerce Platform API is not letting app developers handle orders or customer management using API. The only place where customers can see the products and create orders is on Instagram Shop and Facebook Page shop.

The API is built in a way that we can just use it to pull the orders information into our existing commerce platform (such as shopify). E.g. if a merchant is selling on both facebook and shopify then he will need to pull all the orders he got on facebook into his shopify account for further processing i.e. attaching shipment details to it.

For how a customer can buy the products, they have defined customer journey that customer will discover products in posts on Facebook Pages and Instagram shops.

In facebook commerce platform, they keep discussing about commerce API in multiple places, but the link is broken and also it doesn't appear on google search or in search inside Facebook docs.

https://developers.facebook.com/docs/commerce-api (the link is broken, only api link we have is commerce platform api link)

I have identified tasks for implementing Chatbot for Facebook Shop but due to API limitations many of them are not possible. I have listed and identified which are not possible.

  1. Search Products by name and category id API layer work (Not possible, we can only upload products using batch api)
  2. Create cart and add items to it commerce API layer work (Not possible)
  3. Fetch last N orders of customer API layer work (Not possible, no customer endpoint or entity available)
  4. show product categories from facebook shops API layer work (Not possible)
  5. see order status by order number API layer work (Possible, we can call api to see order details by giving order number)
  6. see recent orders API layer work (can see recent orders of facebook shop, but not by particular customer)
  7. Show top 10 products on sale API layer work (not possible, we can only upload using batch api)
  8. Show customers cart API layer work (not possible, no cart entity or endpoint available in shops api)
  9. Update the cart items API layer work (not possible)
  10. complete the checkout and create order API layer work (not possible, no endpoint given to create order)
  11. add and change shipping and billing address API layer work (not possible, no customer endpoint or entity given)
  12. find and create customer in facebook shop (not possible, there is no customer entity or endpoint in commerce api)
  13. Server side work to prefill all the message blocks (Possible)
  14. Endpoints to create new and fetch chatbots for connected facebook shops page (Possible)
  15. Server side work to handling sending blocks to customers (Possible)
  16. Endpoint to publish/disable bot and get chatbot details (Possible)
  17. Client side UI to create/update and test chatbot (Possible)

Things available in Facebook Commerce API

We had previously looked into Facebook Commerce Platform API and discussed in the following document. We can see this document section for summary on what is available in commerce platform api.

https://docs.google.com/document/d/1SKPR-XtQsQh2Wae9L3HfNtTVHRyxuecD--ORuyYkEQ8/edit#heading=h.8vqz3p33pboa

Reference:

https://developers.facebook.com/docs/commerce-platform/order-management/order-api https://developers.facebook.com/docs/marketing-api/catalog https://developers.facebook.com/docs/marketing-api/reference/product-catalog/categories/

jekram commented 3 years ago

Let's review this today. Let's start with FB Commerce API

sojharo commented 3 years ago

I looked further into this and tried to read more on the catalog_management paragraph but I was not able to find any meaningful apis around that which will help in getting the actual data from the store about products.

I have gone through the mobile monkey article as well. It also discusses about what the shops feature is and how it will help. There was one passage in the article which explained that messenger chatbot can sell the items using their mobilemonkey chatbot.

I have created an account on MobileMonkey and trying to create a commerce chatbot with them. I will complete it today and share my understanding here.

I have also contacted for support for whatsapp number problem on commerce manager.

sojharo commented 3 years ago

As per discussion, I looked into MobileMonkey and attach another facebook page on which I setup the facebook shops and commerce manager. However, from the UI and features of MobileMonkey it was not evident from where I can do the setup to fetch products from my commerce manager and sell them in the messenger chatbot.

All the integrations of Mobile Monkey are through zapier and there was one zap called Facebook Shops. I tried integrating that zap into zapier account with mobile monkey which will send message in Mobile Monkey whenever there is a new order on Facebook Shops. This integration is done outside of Mobile Monkey inside the zapier application. I was able to connect facebook commerce account to zapier and connect my facebook page as well. However, I was not able test the integration with zapier as it required a real order done on the page to test the integration between mobile monkey and facebook shops. My page did not show my option to purchase the product. The reason maybe because I am outside the USA and order would have required checkout and payment part.

Overall the experience with MobileMonkey was not good but I got somewhat understanding of where to begin in integrating with facebook commerce accounts.

I was able to find product and catalog related APIs inside Marketing API of Facebook instead of Facebook commerce platform. I think we will need to integrate with the marketing APIs of Facebook to locate and search products inside a Facebook catalog. I have found following apis up till now which cater to our chatbot use cases.

I am reading more on the API but following of our tasks will be unlocked and there are few which still needs me to play with marketing API by using them in API explorer.

  1. Search Products by name and category id API layer work (Unlocked now)
  2. Create cart and add items to it commerce API layer work (Not required in our case)
  3. Fetch last N orders of customer API layer work (Not possible, no customer endpoint or entity available)
  4. show product categories from facebook shops API layer work (Unlocked now)
  5. see order status by order number API layer work (Possible)
  6. see recent orders API layer work (Not possible can see recent orders of facebook shop only)
  7. Show top 10 products on sale API layer work (Unlocked)
  8. Show customers cart API layer work (Not required in our case)
  9. Update the cart items API layer work (Not required in our case)
  10. complete and create order API layer work (Not required in our case, need to think other ways i.e. take customer instagram or fb checkout)
  11. add and change shipping and billing address API layer work (Not required in our case)
  12. find and create customer in facebook shop (Not required in our case)
  13. Server side work to prefill all the message blocks (Possible)
  14. Endpoints to create new and fetch chatbots for connected facebook shops page (Possible)
  15. Server side work to handling sending blocks to customers (Possible)
  16. Endpoint to publish/disable bot and get chatbot details (Possible)
  17. Client side UI to create/update and test chatbot (Possible)

With above, we can start working on Messenger Chatbot for Facebook Shops with minimal features. I will try these APIs in API explorer to understand how they work. I will update further here once I have tried these APIs and also understood the permissions required for integrating with commerce accounts.

sojharo commented 3 years ago

On my query to Facebook Support team regarding adding the Whatsapp business number to Facebook Commerce Manager, they responded that adding a whatsapp number is not possible on Facebook Commerce Manager Test accounts. I have a test commerce manager account which does not require me to add bank or credit card and business NTN information while creating it. This test commerce account lets us play with the features and create the fake orders and fake checkouts.

I think we can unlock further features and test them if we go for Facebook Commerce manager real account. I tried to create a commerce manager account but there were lots of details required and also it was not letting me go further.

On reading more, I found that creating a commerce manager real account is only possible for USA sellers according to following guide:

https://business.facebook.com/business/help/3108347352588316

I think we should go and create a facebook commerce manager real account and test our work related to chatbot in this task with real account. We will not incur any cost for this until June 30, 2021 on real commerce manager account as facebook has temporarily waived the fee until then.

Screenshot 2021-01-15 at 20 14 11

We can create this together and we will also create a page from USA so that we don't have any country restriction in our testing.

Also I read up on putting Instagram under Commerce manager account and I was able to understand why my previous Instagram account submission to become a shop was rejected. They require to have a website for your store in order to apply for Instagram shop features.

Here is their response:

Hi Sajharo,

Thanks for contacting Commerce Facebook Concierge Support.

I’m Ayra and I’ll be helping you today. The reference ID for your issue is 1100473090469105.

As per my understanding, you are unable to connect your WhatsApp number to the Commerce Manager account.

I’m sorry to hear about your experience.

After checking, I could see that you try to connect your WhatsApp number to Commerce Test Account. I would like to suggest you to delete the Commerce Test Account and create a real Commerce Manager Account.

We truly hope that your issue can be resolved as soon as possible.

Please feel free to reach us if you have any other questions and we’ll be glad to assist.

Moreover, please help us improve by completing a short survey about your experience.

You’ll receive the survey in a few minutes.

We appreciate your feedback, and thanks for contacting Commerce Facebook Concierge Support.

Thanks,

Ayra Facebook Concierge Support | To learn more about supporting your business with Facebook visit: https://www.facebook.com/business/boost/resource and https://fb.me/learn-blueprint

jekram commented 3 years ago

@sojharo Let's review the API today after the status meeting.

The scope is the same chatbot that we develop for Shopify - minus those function that is provided by FB itself.

What is the next step with linking Whatsapp?

sojharo commented 3 years ago

For linking whatsapp, I will work with you to create a real commerce manager account so that whatsapp number can be linked to it.

Ok Sir. we will review this today and I will open the tasks then.

sojharo commented 3 years ago

Here are the final set of tasks that we will be working on in facebook shops. I have also added few tasks for getting permission from facebook and showing screens to let admin access their commerce manager account and shop. There are two more tasks for test cases and team testing

  1. Search Products by name and category id API layer work
  2. show product categories from facebook shops API layer work
  3. see order status by order number API layer work
  4. Show top 10 products on sale API layer work
  5. Server side work to prefill all the message blocks
  6. Endpoints to create new and fetch chatbots for connected facebook shops page
  7. Server side work to handling sending blocks to customers
  8. Endpoint to publish/disable bot and get chatbot details
  9. Client side UI to create/update and test chatbot
  10. Server side work to get access to admins commerce manager accounts and list them
  11. Client side work to show commerce managers so that admin can choose
  12. Server side work to get and show facebook shops under selected commerce accounts
  13. Client side work to list facebook shops pages with chatbot connected
  14. Work on getting and setting facebook permissions for commerce and marketing api
  15. Work on database layer and endpoints
  16. Write test cases for facebook shops chatbot
  17. Team Testing for facebook shops chatbot

Following are tasks that we will not be doing:

  1. Create cart and add items to it commerce API layer work (Not required in our case)
  2. Fetch last N orders of customer API layer work (Not possible, no customer endpoint or entity available)
  3. Show customers cart API layer work (Not required in our case)
  4. Update the cart items API layer work (Not required in our case)
  5. complete and create order API layer work (Not required in our case, need to think other ways i.e. take customer instagram or fb checkout)
  6. add and change shipping and billing address API layer work (Not required in our case)
  7. find and create customer in facebook shop (Not required in our case)
  8. see recent orders API layer work (will try if possible through filter on customer id, we can get shops order only)
sojharo commented 3 years ago

We can close this task as I opened all of the tasks and also used this task to add products to our store.