Managing Stores
Stores are the foundation of AI Commerce. Each store represents a separate e-commerce entity with its own products, API keys, and chat configurations.
Info
Each store has its own product catalog and AI configuration. You can create multiple stores for different brands, regions, or use cases.
Creating a Store
Create a new store using the API. Each store gets its own API key and can be configured independently.
create-store.ts
typescript
import { AICommerce } from '@yassirbenmoussa/aicommerce-sdk';
const client = new AICommerce({
apiKey: 'YOUR_API_KEY',
});
// Create a new store
const store = await client.stores.create({
name: 'My Electronics Store',
description: 'Premium electronics and gadgets',
settings: {
language: 'en',
currency: 'USD',
aiPersonality: 'helpful and knowledgeable'
}
});
console.log('Store ID:', store.id);Updating Store Settings
Customize your store's AI behavior, welcome messages, and more.
update-store.ts
typescript
// Update store settings
const updatedStore = await client.stores.update('STORE_ID', {
settings: {
aiPersonality: 'friendly and casual',
welcomeMessage: 'Hey! How can I help you today?'
}
});Store Settings
| Setting | Type | Description |
|---|---|---|
| name | string | Display name for your store |
| language | string | Default language (en, fr, ar, etc.) |
| currency | string | Currency for prices (USD, EUR, etc.) |
| aiPersonality | string | AI assistant personality description |
| welcomeMessage | string | Initial greeting message |
| predefinedQuestions | string[] | docs.storeSettings.predefinedQuestions |