Facebook Messenger chatbot for retail support

Set up a Facebook Messenger chatbot around the customer question, supported store access and human handover, then verify permissions and failed actions.

A Facebook Messenger chatbot answers retail questions through your Facebook Page, using the product facts and store access you connect. Start with one supported question, then prove that the bot can answer it or pass it to a person without exposing another customer’s order.

A menu reply can direct someone to your returns policy. An AI answer needs a source for the explanation it generates. An order-status answer also needs a secure way to establish which order the customer can access. Receiving a message provides none of those store connections by itself.

Define the question and supported channel method

Choose the question first, then select the reply method and the systems needed to resolve it. A small rule-based Messenger bot is a useful starting point for predictable questions.

This example uses a custom application connected to Meta’s Messenger Platform, with a WooCommerce store for product and order retrieval. Your developer must build the store connection and staff routing. It is a development route, so budget for application hosting and ongoing maintenance separately from any optional AI service.

Meta’s Messenger Platform samples provide sending and receiving examples. They are a starting point for the channel connection, not a finished retail support system.

Set up the channel in this order:

  1. Identify the Facebook Page and the person authorised to manage its messaging. Create or select the Meta application that will handle its messages.
  2. Configure the application’s webhook endpoint, which receives incoming message notifications. Complete Meta’s endpoint verification and subscribe the application to the Page’s required messaging events.
  3. Obtain the Page access token and the pages_messaging permission. Keep the token on your server. Send a message from an authorised test account and confirm that the application receives it and returns a reply.
  4. Check the application’s public access requirements before opening the workflow to customers. Meta’s quick-start guidance limits unapproved applications to accounts with application roles. A successful developer test does not establish public access.
  5. Add a visible way to request a person. Assign the request to a monitored staff queue and make the application stop automatic replies while staff own the conversation.

Use Meta’s quick-start instructions for the application’s approval path. Check the permissions required by each endpoint you actually use. Reading conversation history is a separate operation from sending a reply.

Meta’s official API collection documents a standard 24-hour response window after a customer messages the Page. Outside that window, use only a supported messaging route for which the Page and recipient qualify. Build that eligibility check into sending, including staff follow-ups.

For the first workflow, offer a policy reply and a product lookup with a human fallback. Add AI-generated explanations only after you have defined their source and failure behaviour. An AI step must not invent stock, infer an order result or grant itself permission to change an order.

Connect the required retail facts

Connect public catalogue facts separately from private order records. Give each reply an identifiable source and let your application control which fields can leave the store.

For a product question, use the store’s product identifier and the exact variant. Return the relevant price and availability from the connected catalogue. For a delivery or returns question, use the retailer’s maintained policy document. Assign someone to replace that document when the policy changes.

WooCommerce’s REST API setup guide explains how to create an application programming interface (API) credential under WooCommerce > Settings > Advanced > REST API. Its permissions can be Read, Write or Read/Write. Use Read for this lookup-only example, attached to a dedicated user with appropriate store permissions.

Store that credential on the server. Read access can still expose private records, so it must not be sent to Messenger, placed in browser code or given directly to an AI model. The application must restrict which records and fields it returns.

WooCommerce’s API can retrieve products and orders, but the application must establish the customer’s authority before returning an order. Use an authenticated store session and a short-lived linking process that binds that verified customer to the Messenger conversation. Have your developer enforce the ownership check for every lookup. If that connection is unavailable, direct the customer to the signed-in order page or staff.

Treat a Messenger profile name or an order number as a reference, not proof of ownership. An authenticated customer must still be prevented from requesting somebody else’s order. Return only the fields needed to answer the question, such as the permitted order’s fulfilment status.

The WooCommerce API reference separates order retrieval from order updates and refunds. This example permits retrieval only. A request to cancel or refund an order goes to staff, with no success claim or attempted write.

Verify the answer and handover

Run fictional cases through the configured application and inspect the customer’s reply alongside the store result and staff queue. Use a test Page and test store records before involving customer data.

Use a retail acceptance checklist

Fictional customer requestSetupExpected result
Does the navy jacket come in medium?Test catalogue has navy medium in stockReply uses that variant’s facts and links the correct product
Where is order 7012?Verified test customer owns the orderReply returns the permitted order’s stored status
Where is order 7012?Another test customer is signed inApplication withholds the order and gives a safe help route
Cancel order 7012Lookup-only store connectionStaff receive the request and the bot does not claim cancellation
Can I return this jacket?Policy source is missingBot routes the question to staff without inventing a returns rule

For the product case, change the test variant’s availability and ask again. Confirm the connection reflects its documented update behaviour. A plausible answer from an old catalogue fails this check.

Next, revoke the test store credential and attempt an order lookup. The application must treat the failed request as a failure, withhold private details and route the unresolved question. Restore authorised access only after the failure path works.

Test uncertain identity by abandoning account linking halfway through. The bot must keep order details private. Also simulate a timeout after a lookup starts. The customer must receive an unresolved result or a human route, even if an earlier lookup succeeded.

For handover, inspect what the staff member receives. Preserve the customer’s question, the product or order reference and the verified identity state. Include the source used and the failed operation, with secrets removed. Confirm that a named staff member can accept the request and reply without competing automatic messages.

Test a staff reply outside the ordinary messaging window too. If the reply is ineligible, keep the case unresolved and use an authorised contact route. A queue entry does not guarantee that Messenger can deliver the response.

Maintain the workflow

Assign ownership of the channel connection and store facts before relying on the bot for customer support. The person managing Meta access needs a replacement when they leave. The policy owner needs a way to publish corrections and test the resulting answer.

Keep a private record of the application’s permissions, supported API version and messaging routes. Include any provider plan or usage allowance if you later use a hosted bot service. Review the workflow when permissions change or a token stops working.

Test access revocation as well as connection. WooCommerce provides a Revoke Key action for store credentials. Confirm that revoking the application’s test key prevents further retrieval and that staff see the connection failure. Review Meta access separately when removing a Page or application administrator.

Assess the workflow by observed outcomes: correct product answers, authorised order lookups and unresolved cases accepted by staff. Track failed sends separately from replies delivered to the customer. An API response or a generated answer does not establish a completed purchase or a revenue gain.

If staff handle several channels, use a separate omnichannel customer service process to assign case ownership across them. Keep the Messenger workflow bounded to the questions and actions its tested connections can complete.

Give your store its own shopping agent

Customers ask in their own words. Your agent finds, compares and checks out from your catalogue, right on your site.

See it in actionFree trial · Simple setup