Chat with us
NewAI Agents Just Got More Affordable — GetGet2.5xMore AI TokensMore AI TokensPricing
Knowledgebase/WhatsApp AI Agent Configuration/Article

How to Connect Shopify with BotSailor AI Agent Using HTTP API for Live Inventory & Pricing

  • 2 Sep 2026
  • 9 min read
  • 0 views
TL;DR:

This guide explains how to connect a Shopify store with BotSailor AI Agent to create a real-time ecommerce assistant capable of retrieving live product prices and inventory availability.

The integration uses Shopify Admin API, Custom App authentication, API access tokens, BotSailor custom fields, HTTP API endpoints, response mapping, and AI Agent workflows.

After configuration, the AI chatbot can automatically understand customer product requests, convert product names into Shopify handles, fetch live inventory data, and provide accurate pricing and stock information instantly.

This setup helps ecommerce businesses reduce manual customer support tasks, improve shopping experiences, and create an automated conversational commerce workflow across chat platforms.


Part 1(a)

Connect Shopify with BotSailor- Reseller & End User Settings

If you are a BotSailor end-user who simply wants to connect your existing Shopify store, you can easily install the official BotSailor app directly from the Shopify App Store to link your store automatically. Here is how you can do it:

Step 1: Log In to BotSailor

Log in to your BotSailor account and it will take you to the BotSailor's Dashboard.

Dashboard —-> Connect Account —-> Shopify


Click Connect Account, Here, paste your shopify store url ( You will get it from your Shopify accounts settings —-> Below users)

Make sure you are logged in to your Shopify admin account on the same browser).


Step 2: Install the BotSailor app in your Shopify admin panel

Once you click the Connect Store button, you will be redirected to your Shopify admin panel and prompted to install the BotSailor app. Click Install to authorize the connection.

BotSailor App Install in Shipify
Step 3: Confirmation

After the installation is complete, you will be redirected back to your BotSailor account, where a success message will confirm that the integration has been completed. Your connected Shopify store will then appear in the store list below.

shopify connect account on botsailor

Configuring the Custom API in BotSailor (E-commerce API Panel)

Once you have generated your shpat_ access token from your Shopify custom app, you need to plug those credentials into BotSailor's E-commerce API setup panel to bind the store:

Chatbot Manager —> Commerce —> Woocommerce/Shopify(Click Shopify) —> Add new API

  • Profile Name: Enter a recognizable label for your connection (e.g., Shopify Custom Domain (Queens)).
  • Store Sub-Domain: Input your unique Shopify store prefix or handle (e.g., queens-calling-mk0xlrlj).
  • Admin Access Token: Paste the Shopify Admin API access token (shpat_...) that you generated from your custom app credentials.
  • Saving the Configuration:Click the Save button to finalize the API profile mapping so campaigns and live inventory sync can utilize it.
Shopify legacy custom app connect BotSailor

  • Part 2

Creating and Mapping Custom Fields (Crucial Setup)

Before configuring your HTTP API endpoint, you must create and configure custom fields inside BotSailor. Why is this required? Because the AI agent needs a designated memory container (custom field) to store the user's product query dynamically and to hold the incoming live price and inventory data fetched from Shopify. Skipping or incorrectly naming these fields will break the data pipeline and cause the API to return empty results.


Step 1: When and Where to Create Custom Fields

Timing: Create these custom fields inside your BotSailor dashboard before configuring your HTTP API request or setting up the AI Agent prompt.

Dashboard —> Subscriber Manager —> Create Custom Fields


Fields to Create: For today's use case, we need to create three specific custom fields for input handling and data storage:

  • Product Query Field: To Capture and store the lowercase product handle requested by the user.
  • Price Storage Field: This field will Store the live price returned by Shopify.
  • Stock Storage Field: Stores the live inventory quantity returned by Shopify.

Step 2: Detailed Custom Field Nomenclature & Setup


To ensure your API endpoint and response mapping work seamlessly without errors, use the exact field names and variable formats provided below:

#FieldCustom Field NameDetails
1Product Query Fieldproduct_queryBotSailor Syntax Format: #product_query#
Purpose: This field acts as the dynamic variable injected directly into your API endpoint URL to search for specific items.
2Price Storage Fielddynamic_pricePurpose: Maps to Shopify's pricing data structure to let the AI output the exact cost during live chats.
3Stock Storage Fieldlive_stockPurpose: Maps to Shopify's inventory count to track and display real-time stock availability.
Part 3

BotSailor HTTP API Integration Setup

Configure your API connection inside the BotSailor dashboard using your Shopify store details and the custom field variable embedded directly into the endpoint URL.

HTTP API Configuration Settings & Endpoint URL Breakdown


Dashboard —> Chatbot Manager —> Integrations —> Http API —> Create


To fetch real-time product data dynamically, you need to construct the correct REST API endpoint using your Shopify store domain and variable syntax. Here is how and why you build the endpoint URL:

Where the Endpoint URL Comes From:

The core API structure is derived directly from Shopify's official Admin REST API documentation for products (/admin/api/[version]/products.json), combined with your specific store subdomain and a query filter to search by product handle.


Here, We will Keep the Method as GET, since we want to receive data from Shopify, & we need this Specific Endpoint URL Structure:

                    https://your-subdomain.myshopify.com/admin/api/2026-07/products.json?handle=#product_query#
                                  
  • Store Subdomain (your-subdomain): Replaces the placeholder with your unique Shopify store identifier (e.g., queens-calling-mk0xlrlj) to target your specific database.
  • API Version (2026-07): Specifies the stable Shopify API release version ensuring the endpoint returns the correct schema.
  • Query Parameter (?handle=): Tells Shopify to filter the product list by its URL handle rather than fetching all products.
  • Dynamic Custom Field (#product_query#): Uses BotSailor's hash syntax instead of curly braces to dynamically capture the user's chat input at runtime and inject it into the request.

2. Request Headers Configuration

Add the following key-value pairs under headers (configured with Static Value type):

KeyValue
X-Shopify-Access-Tokenshpat_your_access_token_here
Content-Typeapplication/json
API Token & Request data mapping-http api builder botsailor
Part 4

Response Mapping Configuration

To ensure BotSailor extracts the price and stock quantity correctly from Shopify's nested JSON array response, map the JSON paths to your created custom fields precisely as follows:

Map Response PathCustom Field
products>0>variants>0>pricedynamic_price
products>0>variants>0>inventory_quantitylive_stock
Response mapping-price & inventory fields-botsailor http api integration
Part 5

AI Agent System Prompt Configuration

Dashboard —> Chatbot Manager —> AI —> Agents —> Create Agent


Add name, slug, description, & paste the following refined system prompt into your BotSailor AI Agent settings. This prompt instructs the agent to correctly process user queries, format product names into lowercase URL handles, save them to the custom field variable, and trigger the live API endpoint. Save the Agent.

BotSailor AI Agent system prompt
                      You are a live inventory and pricing assistant connected to Shopify.
                                                Whenever a user asks about a product's price, stock, or availability, you MUST strictly follow these execution steps:1. Extract the product name from the user's message and format it into a clean lowercase URL handle with spaces replaced by hyphens (e.g., "Micellar Cleansing Water" becomes "micellar-cleansing-water").
                                                2. Save this formatted value to the custom field variable (#product_query#).
                                                3. Trigger the HTTP API to fetch the real-time inventory and pricing data.
                                                4. Reply to the user using the returned dynamic_price and live_stock values. If the product is
                                                not found or stock is 0, inform them that the item is currently unavailable.
                                             

Multi Agent AI Configuration

Once your HTTP API campaign chatbot is configured, you need to map your newly created agent inside the BotSailor AI configuration panel to handle real-time triggers seamlessly:


Enabling Multiple Active Agents: As shown in the configuration dashboard, you can assign multiple specialized agents simultaneously (e.g., General Agent, Live inventory and pricing tracking, and live tracking etc). While you can choose to run a single agent for simple setups, we highly recommend utilizing multiple dedicated agents for distinct task accomplishments to maximize response accuracy.


Configuring Agent Routing Rules: Define precise routing rules under the Agent Routing section to determine which agent handles specific customer inquiries:

Multi agent enable & AI rule for agents-botsailor ai agent configuration
  • General Queries: Set standard conversation starters (like "hi, hello") to route toward the General Agent.
  • Inventory & Pricing: Map keywords such as "Inventory, price, stock" to trigger your newly created Live inventory and pricing tracking agent, allowing it to instantly fetch real-time data using your HTTP API.
  • Logistics & Delivery: Route shipment keywords (like "Shipment, Track, Delivery") to your tracking agent.


For advanced guides on creating, scaling, and optimizing additional multi-agent workflows, please refer to our core documentation repository.


Testing, Deployment & Real-World Results

Once you have completed your Shopify custom app integration, custom field bindings, HTTP API endpoint setup, and AI agent prompt configurations, the final stage is to test the live loop and deploy the assistant for production use.


Step 1: Live Chat Validation & Testing

  • Initiate a Test Session: Open your connected chat channel (such as WhatsApp) and send a natural query asking for a specific product's price or stock (e.g., "Can you tell me the price of peach powder blush").
  • Verify Execution Sequence: The AI agent will parse the text, normalize the product name into a lowercase URL slug, bind it to your custom field variable (#product_query#), and instantly trigger the Shopify HTTP API call.
  • Inspect the Live Output: A successfully configured pipeline will bypass static responses and fetch live store data directly, replying with the precise pricing and inventory count in real time.

AI Agent fetching live data from shopify store through http api call-botsailor

Step 2: Production Deployment & Multi-Agent Scaling

  • Verify Intent Rules: Ensure your intent routing rules are active so incoming queries regarding stock or pricing trigger your specialized inventory agent instead of the general assistant.
  • Monitor Logs & Fallbacks: Check your BotSailor execution logs to ensure payloads and variables are binding correctly on user input. If a product handle returns empty, the AI will gracefully execute its fallback logic and inform the user that the item is currently unavailable.

Conclusion

Integrating Shopify with BotSailor transforms a standard chat interface into an autonomous, real-time e-commerce powerhouse. By bridging Shopify's robust Admin REST API with BotSailor's flexible custom fields, dynamic HTTP endpoints, and multi-agent AI routing, businesses can deliver instant, accurate answers regarding product pricing and stock availability directly inside chat applications. Whether deploying an automated public connection as a standard end-user or configuring advanced custom private apps as a reseller, this architecture eliminates manual bottlenecks, enhances customer satisfaction, and drives higher conversions through immediate, frictionless engagement.

Fatema Khatun

Fatema Khatun

Team
FAQ

Frequently Asked Questions

Find answers to common questions about this topic

You can connect Shopify with BotSailor AI Agent by installing the BotSailor Shopify app or creating a Shopify Custom App for advanced API integration. The setup involves connecting Shopify, configuring API permissions, generating an Admin API access token, and connecting Shopify data through BotSailor's HTTP API configuration.

This allows the AI Agent to access product information, pricing, and inventory data automatically.

BotSailor fetches real-time Shopify product prices by using Shopify Admin API with an HTTP API request. The AI Agent sends the product query through a dynamic custom field, retrieves product information from Shopify, and maps the returned price data into BotSailor for live customer responses.

This creates a Shopify real time price lookup system without requiring manual updates.

Yes. BotSailor can perform Shopify inventory tracking by connecting with Shopify Admin API through HTTP API integration. Once configured, the AI Agent can retrieve current stock quantities and availability status directly from Shopify.

This helps businesses automate inventory checking during customer conversations.

Shopify HTTP API integration allows external platforms like BotSailor to securely communicate with Shopify stores and retrieve live product information.

Instead of maintaining separate inventory records, businesses can use Shopify and inventory management together through automated API synchronization, ensuring customers receive accurate stock and pricing information.

For Shopify BotSailor integration, the Custom App requires Admin API access permissions including:

read_products
read_inventory

These permissions allow BotSailor to retrieve product details, pricing information, and inventory availability from Shopify.

BotSailor does not replace Shopify's native inventory management system. Instead, it works as an AI-powered customer interaction layer connected with Shopify.

By using Shopify HTTP API integration, BotSailor can access inventory data and provide customers with automated answers about product availability, stock levels, and pricing.

BotSailor uses a product query field to capture the customer's requested product name. The AI Agent converts the product name into a Shopify-compatible handle, sends the request through HTTP API, and retrieves matching product information from Shopify.

The response can include product price and available stock quantity.

Yes. A Shopify AI chatbot connected with BotSailor HTTP API can provide live stock availability by retrieving inventory quantity directly from Shopify.

This helps customers instantly know whether a product is available before completing a purchase.

Connecting Shopify and inventory management with AI automation reduces manual customer support work by allowing AI agents to answer product availability, pricing, and stock-related questions instantly.

Businesses can improve response time, reduce repetitive inquiries, and create a better ecommerce shopping experience.

To build a Shopify AI shopping assistant, connect Shopify Admin API with BotSailor using HTTP API, configure custom fields, map API responses, and create AI Agent routing rules.

Once configured, the assistant can automatically answer customer questions using live Shopify product and inventory data.