Stammer.ai Docs
  • Welcome
    • 👋Welcome to Stammer.ai
    • 📑About Stammer.ai
    • 🆕New/ Latest Updates
  • START HERE
    • ❓What is Stammer.ai?
    • 🫡Agency Quick Start Guide
    • 📚Glossary
    • 🤑Our Community
  • AI Features
    • 🤖AI Agents (Chatbots)
      • How AI Agents Work
      • How to Build an AI Agent
    • 🔃AI Agent Dashboard
      • (White Label) Marketplace
      • Default Chatbot
      • Share Chatbot
      • Clone Chatbot
      • Chatbot UUID
      • Delete Chatbot
      • Summary (Analytics)
    • 💬Conversations
      • Review Past Conversations
      • Conversation Links
      • Training Better Responses
      • Live Chat
        • Human Handoff Automation (for Live Chat)
    • 📚Knowledge Base Explained
      • 💽Data Storage (Characters)
        • Storage (Characters) Example
      • Copy & Paste Text
      • Upload Documents
      • Scrape Websites
        • 24-hour Auto-Scraping
        • Scraping a Google Doc
        • Google Docs
      • Question & Answer Pairs
      • Data & Content Security
      • Citations/ Sources
      • HTML Rendering (Embed Images & Videos)
    • ✍️Prompting
      • What is a Base System Prompt?
      • Writing a Base System Prompt
      • Prompt Examples (Marketplace)
        • Base System Prompt Template (General)
    • 🔧AI Agent Settings
    • 🎨AI Chat Widget
      • Customize Chat Widget Apperance
      • Chat Widget Pop-Up
      • Initial Messages Pop-Up
      • Chat Widget Voice
    • ⚙️Advanced Settings for AI Agent
      • Model Version
      • Prioritize Question/Answer Results
      • Chatbot Visibility
      • Temperature
      • Message Template
      • Support Email
      • Domains
      • Show Data Sources in Chat Widget
      • Debug Mode
    • Leads 2.0
    • 📈Leads (Legacy)
      • Overview of Lead Generation
      • Lead Collection Form Fields
      • Lead Collection Webhook URL
      • Lead Collection Email Notification
      • In Chat Lead Collection Base System Prompt
      • Sending Lead Data to Zapier
      • Sending Lead Data to GHL
      • Sending Lead Data to Zoho CRM
    • 📅Scheduling
      • AI Scheduling - Simplified
      • AI Scheduling - Experimental (Beta)
        • What is Scheduling?
        • Calendar Integration
          • Google Calendar
        • Appointment Scheduling Activation
        • Appointment Scheduling Webhook URL
        • Appointment Scheduling Email Notification
        • Appointment Scheduling Base System Prompt
        • The Appointment Scheduling Functions & Customizing the Appointment Scheduling Prompt
    • 🧊Integrations
      • Embed Chatbot on a Website
      • Zapier App
      • GoHighLevel (GHL)
      • Instagram DM
      • Facebook Messenger
      • WhatsApp
      • ElevenLabs Voice
      • Discord
    • 🤖Troubleshooting
      • How to Respond in Any Language
      • Responses are Too Long
      • Debug Mode
      • Clickable Links in Responses
    • 🌌Functions (Labs)
      • Custom Functions
        • Shopify - Custom Function (New)
      • Custom Functions (Legacy)
        • How Custom Functions Work (Legacy)
        • Code Generation Prompt for Custom Functions
        • Stock Market Data - Custom Function (Legacy)
        • Airtable - Custom Function (Legacy)
        • Google Sheets - Custom Function (Legacy)
        • Shopify - Custom Function (Legacy)
    • 🔄Vault
      • OpenAI API Key (ChatGPT)
      • Anthropic API Key (Claude)
      • xAI API Key (Grok)
      • Eleven Labs API Key
  • 👑MasterChat
  • White Label
    • 🤑What is White Labeling?
    • 👤Client Sub-Accounts
      • Create Sub-Account
      • Sub-Account Wallet
      • Sub-Account Storage Balance
      • Sub-Account Extra AI Agents
      • How to clone a chatbot to a sub-account
    • 🔗Custom Domain
      • Troubleshooting Custom Domain Deployment DNS Issues
    • 🏗️The SaaS Configurator
      • Create Subscription Package
        • Custom Packages + Settings
      • Add-Ons
        • Storage (Characters) - Add Ons
        • AI Agent Rebilling - Add Ons
        • MasterChat - Add Ons
        • Advanced Scraper - Add Ons
    • 👍White Label API
      • API Documentation
      • AI Agent API
        • Message AI Agent
        • Create AI Agent
        • Retrieve AI Agent
        • Update AI Agent
        • Delete AI Agent
      • Knowledge Base API
        • Add AI Agent Q/A
        • Add URLs to Scrape
        • Add Files (Pdf, Doc etc.)
      • Conversations
        • AI Agent Conversations
        • Retrieve Conversation
        • Delete A Conversation
      • Sub-Accounts
        • Create Sub-Account
        • Retrieve Sub-Account
        • Update Sub-Account
        • Delete Sub-Account
      • User
        • Retrieve User's Data
      • Examples
        • Create New Sub-Account (Zapier Example)
        • White Label API x Zapier X Slack Example
        • AI Chatbot Chrome Extension
    • 👾White Label (Your) Marketplace
    • 😇White Label Free Trials
      • Free Trial Settings (No CC Req.)
      • Free Trial Settings (CC Req.)
    • 🎨Custom Dashboard Styling
  • Agency Settings
    • ⛳Agency Dashboard
    • 👥User Permissions
    • 😎Agency Profile
    • 👥User Access
    • 💳Connect Stripe
    • 🔗Custom Menu Links
    • 🤘Default Prompts
  • Account Management
    • ⚙️Billing Usage & Settings
    • 💲Agency Billing
      • Subscription Plans
      • Change Subscription Plan
      • Update Credit Card
      • Download Invoice
      • Refunds
      • Cancel Subscription
    • 💱Agency Wallet
      • The Agency Wallet System
      • Agency vs Sub-Account Wallet
      • Auto Billing
      • Add Funds to Wallet
      • AI Messages Costs
      • AI Agents Costs
      • Storage (Characters) Costs
    • 🤲Admin Account Profile
      • Change Password
      • Google Auth Login
  • Support
    • 🤝Need Help?
    • 🔓Security & Compliance
      • Data Privacy & Security Report
      • GDPR
      • Terms & Conditions
      • Privacy Policy
      • Data Processing Agreement
      • AI Model Data Usage
      • Service Level Agreement
    • ⚡Discord Community
    • 📹Weekly Office Hours
    • 🙌FAQ
      • General
      • Localization
      • Data/Security
      • Set Up
      • Password
      • Technical Questions
      • Sales/Onboarding
      • Marketing/Pricing
      • Where can I find...?
      • Other
      • Alternatives to Stripe Connect
    • 📰Changelog/ Roadmap
    • 🍭Resources
      • Sales Deck
      • 💰AI Agency 101
        • How to Price Your AI Chatbots
        • How to Get More Clients
        • The Value Proposition of AI Agents
        • AI SaaS Funnel Explained
    • 🤑Affiliate Program
Powered by GitBook
On this page
  • 🛠️ How to Connect Shopify to Stammer.ai and Provide Tracking Info via AI Agent
  • Step 1: Create a Private App in Shopify
  • Step 2: Get the Admin API Access Token
  • Step 3: Set Up the Custom Function in Stammer.ai
  • Step 4: Add Headers
  • Step 5: Add Static Parameters
  • Step 6: Write a Prompt Instruction
  • Step 7: Save and Test
  • 🧠 AI Agent Response Handling
  • Final Output Example:
  1. AI Features
  2. Functions (Labs)
  3. Custom Functions

Shopify - Custom Function (New)

🛠️ How to Connect Shopify to Stammer.ai and Provide Tracking Info via AI Agent

In this guide, we’ll walk through how to set up a custom function in Stammer.ai that allows your chatbot to respond with tracking information based on a user’s email.

🔍 Use Case Example:

User: Where’s my order? Bot: What’s your email? User: name@email.com Bot: Your order for the "product-name" has been fulfilled and delivered. It was shipped via USPS with the tracking number 920019030243561811486929. You can track your order here.


Step 1: Create a Private App in Shopify

  1. Go to your Shopify Admin Panel

  2. Click Apps and sales channels > App development

  3. Click Create an app or select an existing one

  4. Name your app (e.g. AI Order Tracking)

  5. Under Configuration, click Edit on Admin API access scopes

  6. Enable the following scopes:

    read_orders  
    read_shipping  
    read_fulfillments  
    read_customers  
  7. Click Save


Step 2: Get the Admin API Access Token

  1. Click on the API credentials tab in your app settings

  2. Click Install App (if it’s not already installed)

  3. Copy the Admin API access token (starts with shpat_...)

    • You will need this for your Stammer function

    • Store this securely


Step 3: Set Up the Custom Function in Stammer.ai

  1. Log in to your Stammer.ai account

  2. Go to your AI Agent > Functions tab

  3. Click + Add Function

Fill in the following fields:

  • Function Alias: get_tracking_by_email

  • Description: Get order tracking data from Shopify

  • Function URL:

    https://<your-store>.myshopify.com/admin/api/2023-04/orders.json

    Replace <your-store> with your actual Shopify subdomain

  • Method: GET

Add a Parameter:

Field
Value

Name

email

Type

String

Description

user’s email

Required

✅ Yes


Step 4: Add Headers

Click + Add Header and paste in your API access token as the value.

Header Name
Value

X-Shopify-Access-Token

shpat_... (from step 2)


Step 5: Add Static Parameters

Click + Add Parameter

Name
Value

status

any

This makes sure the API includes all orders, regardless of fulfillment status.


Step 6: Write a Prompt Instruction

Paste this in the Prompt Instructions field:

- If the user asks to track their order, you will ask for their email address 
- After you have required information call this get_tracking_by_email() function

Step 7: Save and Test

  1. Click Test Function and try using a test email of a recent order

  2. If successful, the response will include order data like:

    • Customer name

    • Fulfillment status

    • Tracking number

    • Carrier


🧠 AI Agent Response Handling

Your AI agent should be instructed (via its system prompt) to:

  • Ask for the user’s email

  • Call the get_tracking_by_email() function

The AI agent will then return the available information to the user in the chat conversation. You can format this data to make it look any way you'd like by including an example in the base system prompt.


Final Output Example:

"Your order for the Nike Sneakers has been fulfilled and shipped via FedEx. Tracking number: 784569302145. Track it here: https://www.fedex.com/fedextrack/?trknbr=784569302145"

PreviousCustom FunctionsNextCustom Functions (Legacy)

Last updated 7 hours ago

🌌