Browse Source

docs: update ShopRenter scope documentation with complete list #39

- Add missing scopes: product:write, customer:write, category:read, inventory:read, webhook:read
- Explicitly document phone number and email access via customer:read and order:read
- Add detailed justifications for all 10 scopes
- Highlight critical missing webhook:read scope used by listWebhooks()
- Document data fields accessed by each scope
Claude 5 months ago
parent
commit
46767ec874
2 changed files with 56 additions and 16 deletions
  1. 13 7
      SHOPRENTER.md
  2. 43 9
      SHOPRENTER_REGISTRATION.md

+ 13 - 7
SHOPRENTER.md

@@ -132,21 +132,27 @@ Based on ShopCall.ai functionality, we need:
 ```
 ```
 product:read          # Read product catalog
 product:read          # Read product catalog
 product:write         # Update product information (if needed)
 product:write         # Update product information (if needed)
-customer:read         # Access customer data
+customer:read         # Access customer data (including email, phone, addresses)
 customer:write        # Update customer information (notes, tags)
 customer:write        # Update customer information (notes, tags)
-order:read            # Read order information
+order:read            # Read order information (including customer email, phone)
 order:write           # Update order status, add notes
 order:write           # Update order status, add notes
 category:read         # Read product categories
 category:read         # Read product categories
-webhook:read          # List webhooks
+inventory:read        # Access real-time stock information
+webhook:read          # List existing webhooks
 webhook:write         # Create/update webhooks for real-time sync
 webhook:write         # Create/update webhooks for real-time sync
 ```
 ```
 
 
 **Scope Justification:**
 **Scope Justification:**
 - **product:read** - Sync product catalog for AI knowledge base
 - **product:read** - Sync product catalog for AI knowledge base
-- **customer:read** - Personalize AI responses based on customer history
-- **order:read** - Provide order status information during calls
-- **order:write** - Update order notes after calls
-- **webhook:write** - Set up real-time synchronization
+- **product:write** - Future capability to update stock levels, prices
+- **customer:read** - Access customer data including email, phone numbers, billing/shipping addresses for personalized AI responses
+- **customer:write** - Add call notes, tags, and interaction history to customer records
+- **order:read** - Access order details including customer contact info (email, phone) for order status inquiries
+- **order:write** - Update order notes and status after customer calls
+- **category:read** - Organize products by category for better AI product recommendations
+- **inventory:read** - Provide real-time stock availability information during calls
+- **webhook:read** - List existing webhook registrations to avoid duplicates
+- **webhook:write** - Register webhooks for real-time product/order/customer updates
 
 
 ---
 ---
 
 

+ 43 - 9
SHOPRENTER_REGISTRATION.md

@@ -101,9 +101,14 @@ https://ztklqodcdjeqpsvhlpud.supabase.co/functions/v1/webhook-shoprenter-uninsta
 ### Scope List
 ### Scope List
 ```
 ```
 product:read
 product:read
+product:write
 customer:read
 customer:read
+customer:write
 order:read
 order:read
 order:write
 order:write
+category:read
+inventory:read
+webhook:read
 webhook:write
 webhook:write
 ```
 ```
 
 
@@ -113,25 +118,54 @@ webhook:write
 **Purpose:** Sync product catalog for AI knowledge base
 **Purpose:** Sync product catalog for AI knowledge base
 **Usage:** The AI assistant needs to access product information (name, price, stock, description) to answer customer questions about products during phone calls.
 **Usage:** The AI assistant needs to access product information (name, price, stock, description) to answer customer questions about products during phone calls.
 **Example:** "Is the XYZ product in stock?" → AI checks product availability in real-time.
 **Example:** "Is the XYZ product in stock?" → AI checks product availability in real-time.
+**Data Accessed:** Product name, SKU, price, description, stock levels, active status
+
+#### `product:write`
+**Purpose:** Future capability to update product information
+**Usage:** Enable future features like AI-assisted inventory management or price updates based on customer interactions.
+**Example:** Automatically mark products as "low stock" after multiple customer inquiries.
 
 
 #### `customer:read`
 #### `customer:read`
-**Purpose:** Personalize AI responses based on customer history
-**Usage:** Access customer information to provide personalized service during calls. The AI can reference previous orders and customer preferences.
+**Purpose:** Access customer contact information and history
+**Usage:** Access customer data including **email addresses, phone numbers**, billing/shipping addresses to enable personalized AI service and direct customer communication.
 **Example:** "Hello Mr. Kovács, I see you previously ordered product ABC. Would you like to reorder?"
 **Example:** "Hello Mr. Kovács, I see you previously ordered product ABC. Would you like to reorder?"
+**Data Accessed:** Email, phone, first name, last name, billing address (including phone), shipping address (including phone), order history, total spent
+
+#### `customer:write`
+**Purpose:** Update customer records with call interaction data
+**Usage:** Add call notes, tags, and interaction history to customer profiles for merchant reference and improved service.
+**Example:** After a support call, the AI adds a note: "Customer prefers SMS notifications for order updates."
 
 
 #### `order:read`
 #### `order:read`
-**Purpose:** Provide order status information during calls
-**Usage:** Answer customer inquiries about order status, shipping, and delivery details during phone conversations.
-**Example:** "Where is my order SR-2024-001?" → AI provides current order status and tracking information.
+**Purpose:** Access order details and customer contact information
+**Usage:** Answer customer inquiries about order status and access customer **email and phone numbers** from order data for follow-up communication.
+**Example:** "Where is my order SR-2024-001?" → AI provides current order status, tracking, and customer contact details.
+**Data Accessed:** Order number, status, total, currency, customer email, customer phone, billing/shipping addresses (including phones), line items
 
 
 #### `order:write`
 #### `order:write`
-**Purpose:** Update order notes after calls
-**Usage:** Add call summaries and customer requests to order notes for merchant reference.
-**Example:** After a call about delivery preferences, the AI adds a note to the order: "Customer requested morning delivery."
+**Purpose:** Update order information after calls
+**Usage:** Add call summaries, customer requests, and delivery notes to orders for merchant reference.
+**Example:** After a call about delivery preferences, the AI adds a note: "Customer requested morning delivery."
+
+#### `category:read`
+**Purpose:** Organize products by category for better recommendations
+**Usage:** Enable the AI to suggest related products and navigate product categories effectively during customer conversations.
+**Example:** "I'm looking for phone accessories" → AI can browse category structure to suggest relevant products.
+
+#### `inventory:read`
+**Purpose:** Access real-time stock availability information
+**Usage:** Provide accurate stock information during calls and suggest alternatives for out-of-stock items.
+**Example:** "Product XYZ is currently out of stock, but we have similar product ABC available."
+
+#### `webhook:read`
+**Purpose:** List existing webhook registrations
+**Usage:** Check for existing webhooks before creating new ones to avoid duplicates and manage webhook lifecycle.
+**Example:** During setup, verify if webhooks are already registered for this store.
+**Critical Note:** ⚠️ Our code calls `listWebhooks()` function - this scope is REQUIRED!
 
 
 #### `webhook:write`
 #### `webhook:write`
 **Purpose:** Set up real-time synchronization
 **Purpose:** Set up real-time synchronization
-**Usage:** Register webhooks for `order/create`, `product/update` events to keep AI knowledge base synchronized in real-time.
+**Usage:** Register webhooks for `order/create`, `product/update`, `customer/update` events to keep AI knowledge base synchronized in real-time.
 **Example:** When a product goes out of stock, webhook updates AI immediately so it doesn't offer unavailable products.
 **Example:** When a product goes out of stock, webhook updates AI immediately so it doesn't offer unavailable products.
 
 
 ---
 ---