Skip to main content

Store API Functions

This page explains the Store API functions that the FelAIProductAdvisor can use to retrieve information from your Shopware store.

Overview

The FelAIProductAdvisor uses various Store API functions to access data from your Shopware store. These functions allow the product advisor to retrieve information about products, categories, manufacturers, and more, enabling it to provide accurate and helpful responses to customer queries.

Available Functions

get_categories

Retrieves category information from the shop.

Description: This function allows the product advisor to access and present available shop categories, including their URLs, names, and breadcrumb structures.

Example Usage:

  • When a customer asks about product categories
  • To suggest relevant categories based on customer interests
  • To help customers navigate the shop structure

Response Example:

{
"categories": [
{
"id": "category-id-1",
"name": "Electronics",
"url": "/electronics",
"childCount": 5,
"breadcrumb": ["Home", "Electronics"]
},
{
"id": "category-id-2",
"name": "Smartphones",
"url": "/electronics/smartphones",
"childCount": 0,
"breadcrumb": ["Home", "Electronics", "Smartphones"]
}
]
}

get_manufacturer

Retrieves information about product manufacturers.

Description: This function allows the product advisor to provide users with detailed information about the manufacturers of your products.

Example Usage:

  • When a customer asks about specific brands
  • To filter products by manufacturer
  • To provide information about a manufacturer's background

Response Example:

{
"manufacturers": [
{
"id": "manufacturer-id-1",
"name": "Apple",
"description": "Apple Inc. is an American multinational technology company...",
"url": "/manufacturer/apple"
},
{
"id": "manufacturer-id-2",
"name": "Samsung",
"description": "Samsung Electronics Co., Ltd. is a South Korean multinational electronics company...",
"url": "/manufacturer/samsung"
}
]
}

get_product_properties

Retrieves properties, manufacturers, and categories of products.

Description: This function allows the product advisor to retrieve and utilize product properties, manufacturer names, and categories to enhance product search and filtering capabilities.

Example Usage:

  • To understand available product attributes
  • To suggest filtering options to customers
  • To explain product specifications

Response Example:

{
"properties": [
{
"id": "property-id-1",
"name": "Color",
"options": ["Red", "Blue", "Green", "Black"]
},
{
"id": "property-id-2",
"name": "Size",
"options": ["S", "M", "L", "XL"]
}
],
"manufacturers": [...],
"categories": [...]
}

get_payment_methods

Retrieves available payment methods.

Description: This function allows the product advisor to provide users with information about the available payment methods in your shop.

Example Usage:

  • When a customer asks about payment options
  • To explain payment processes
  • To address payment-related questions

Response Example:

{
"paymentMethods": [
{
"id": "payment-id-1",
"name": "Credit Card",
"description": "Pay securely with your credit card."
},
{
"id": "payment-id-2",
"name": "PayPal",
"description": "Fast and secure payment with PayPal."
}
]
}

get_delivery_times

Retrieves information about delivery times.

Description: This function allows the product advisor to inform users about the estimated delivery times for products or services.

Example Usage:

  • When a customer asks about shipping times
  • To provide delivery estimates
  • To explain shipping options

Response Example:

{
"deliveryTimes": [
{
"id": "delivery-id-1",
"name": "Standard Shipping",
"min": 2,
"max": 5,
"unit": "day"
},
{
"id": "delivery-id-2",
"name": "Express Shipping",
"min": 1,
"max": 2,
"unit": "day"
}
]
}

get_countries

Retrieves available countries for shipping.

Description: This function allows the product advisor to provide users with a list of available countries, useful for shipping and localization purposes.

Example Usage:

  • When a customer asks about international shipping
  • To provide information about shipping destinations
  • To address country-specific questions

Response Example:

{
"countries": [
{
"id": "country-id-1",
"name": "United States",
"iso": "US"
},
{
"id": "country-id-2",
"name": "Germany",
"iso": "DE"
}
]
}

Searches for products based on various criteria.

Description: This function allows the product advisor to conduct product searches based on user queries, with the ability to filter results by categories, properties, price range, and sorting options.

Parameters:

  • query: Search term
  • categories: Array of category IDs
  • properties: Array of property IDs
  • price_min: Minimum price
  • price_max: Maximum price
  • limit: Number of results (default: 10)
  • page: Page number for pagination
  • order: Sorting order (e.g., "price_asc", "price_desc", "name_asc")

Example Usage:

  • When a customer asks for specific products
  • To show products matching certain criteria
  • To filter products based on customer preferences

Response Example:

{
"products": [
{
"id": "product-id-1",
"name": "iPhone 13 Pro",
"description": "Apple's flagship smartphone with advanced camera system.",
"price": {
"amount": 999.00,
"currency": "EUR",
"formatted": "€999.00"
},
"images": [
{
"url": "https://example.com/images/iphone-13-pro.jpg",
"alt": "iPhone 13 Pro"
}
],
"url": "/detail/iphone-13-pro",
"properties": [
{
"name": "Color",
"value": "Graphite"
},
{
"name": "Storage",
"value": "256GB"
}
]
}
],
"total": 25,
"page": 1,
"limit": 10
}

get_product_details

Retrieves detailed information about a specific product.

Description: This function allows the product advisor to fetch detailed information about specific products using their product IDs or numbers, offering users comprehensive product details.

Parameters:

  • productId: ID of the product

Example Usage:

  • When a customer asks for more information about a specific product
  • To provide detailed specifications
  • To answer product-specific questions

Response Example:

{
"product": {
"id": "product-id-1",
"name": "iPhone 13 Pro",
"description": "Apple's flagship smartphone with advanced camera system.",
"longDescription": "The iPhone 13 Pro features a 6.1-inch Super Retina XDR display with ProMotion technology, A15 Bionic chip, pro camera system with new 12MP telephoto, wide, and ultra wide cameras, and up to 1TB of storage.",
"price": {
"amount": 999.00,
"currency": "EUR",
"formatted": "€999.00"
},
"images": [
{
"url": "https://example.com/images/iphone-13-pro-1.jpg",
"alt": "iPhone 13 Pro Front"
},
{
"url": "https://example.com/images/iphone-13-pro-2.jpg",
"alt": "iPhone 13 Pro Back"
}
],
"url": "/detail/iphone-13-pro",
"properties": [
{
"name": "Color",
"value": "Graphite"
},
{
"name": "Storage",
"value": "256GB"
},
{
"name": "Display",
"value": "6.1-inch Super Retina XDR"
},
{
"name": "Processor",
"value": "A15 Bionic"
}
],
"manufacturer": {
"name": "Apple",
"id": "manufacturer-id-1"
},
"categories": [
{
"name": "Smartphones",
"id": "category-id-2"
}
],
"stock": {
"available": true,
"quantity": 15
}
}
}

Integration in the Product Advisor

The product advisor automatically has access to these functions and uses them based on the context of the conversation. You don't need to explicitly enable or configure these functions, as they are built into the product advisor's capabilities.

How the Product Advisor Uses These Functions

  1. Understanding Customer Needs: The advisor analyzes customer queries to determine which function to use
  2. Retrieving Relevant Data: It calls the appropriate function to get the needed information
  3. Presenting Information: It formats and presents the data in a user-friendly way
  4. Following Up: Based on the retrieved data, it can ask follow-up questions or make recommendations

Example Conversation Flow

Here's an example of how these functions might be used in a conversation:

  1. Customer: "I'm looking for a smartphone under €500"
  2. Advisor: Uses product_search with parameters { "categories": ["smartphones"], "price_max": 500 }
  3. Advisor: "I found several smartphones under €500. Here are some options..."
  4. Customer: "Can you tell me more about this Samsung model?"
  5. Advisor: Uses get_product_details to retrieve detailed information
  6. Advisor: "The Samsung Galaxy A52 features a 6.5-inch Super AMOLED display..."
  7. Customer: "What payment methods do you accept?"
  8. Advisor: Uses get_payment_methods to retrieve payment information
  9. Advisor: "We accept several payment methods including Credit Card, PayPal..."

Performance Considerations

  • The functions are optimized for performance, but complex queries might take longer to process
  • Consider limiting the number of products returned in searches to improve response times
  • The product advisor automatically handles pagination for large result sets

Next Steps

After understanding the Store API functions, you can:

  1. Optimize your product data to improve search results
  2. Configure the AI to make better use of these functions
  3. Test different scenarios to see how the functions work in practice
  4. Monitor performance to identify areas for improvement