{
  "info": {
    "_postman_id": "7b8a9c1d-2e3f-4a5b-6c7d-8e9f0a1b2c3d",
    "name": "SmartGrocery SaaS API",
    "description": "SmartGrocery SaaS API collection (major endpoints). Set base_url and token variables before testing.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://your-admin-domain.com" },
    { "key": "token", "value": "" },
    { "key": "product_id", "value": "1" },
    { "key": "order_id", "value": "1" },
    { "key": "order_number", "value": "ORD-0001" },
    { "key": "address_id", "value": "1" },
    { "key": "ticket_id", "value": "1" },
    { "key": "review_id", "value": "1" }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Register",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json", "type": "text" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"name\": \"John Doe\",\n  \"email\": \"john@example.com\",\n  \"password\": \"StrongPassword123!\"\n}"
            },
            "url": { "raw": "{{base_url}}/api/register", "host": ["{{base_url}}"], "path": ["api", "register"] }
          }
        },
        {
          "name": "Login",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json", "type": "text" }],
            "body": { "mode": "raw", "raw": "{\n  \"email\": \"john@example.com\",\n  \"password\": \"StrongPassword123!\"\n}" },
            "url": { "raw": "{{base_url}}/api/login", "host": ["{{base_url}}"], "path": ["api", "login"] }
          }
        },
        {
          "name": "Get Current User",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/user", "host": ["{{base_url}}"], "path": ["api", "user"] }
          }
        },
        {
          "name": "Update Profile",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"name\": \"John Doe\",\n  \"phone\": \"+1 555 0100\"\n}" },
            "url": { "raw": "{{base_url}}/api/user/update", "host": ["{{base_url}}"], "path": ["api", "user", "update"] }
          }
        },
        {
          "name": "Delete Account",
          "request": {
            "method": "POST",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/user/delete", "host": ["{{base_url}}"], "path": ["api", "user", "delete"] }
          }
        },
        {
          "name": "Logout",
          "request": {
            "method": "POST",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/logout", "host": ["{{base_url}}"], "path": ["api", "logout"] }
          }
        }
      ]
    },
    {
      "name": "Catalog (Public)",
      "item": [
        { "name": "Settings", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/settings", "host": ["{{base_url}}"], "path": ["api", "settings"] } } },
        { "name": "Categories", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/categories", "host": ["{{base_url}}"], "path": ["api", "categories"] } } },
        { "name": "Banners", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/banners", "host": ["{{base_url}}"], "path": ["api", "banners"] } } },
        { "name": "Products (Paginated)", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/products?page=1", "host": ["{{base_url}}"], "path": ["api", "products"], "query": [{ "key": "page", "value": "1" }] } } },
        { "name": "Product Details", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/products/{{product_id}}", "host": ["{{base_url}}"], "path": ["api", "products", "{{product_id}}"] } } },
        { "name": "Related Products", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/products/{{product_id}}/related", "host": ["{{base_url}}"], "path": ["api", "products", "{{product_id}}", "related"] } } },
        { "name": "Flash Sale Products", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/flash-sale/products", "host": ["{{base_url}}"], "path": ["api", "flash-sale", "products"] } } },
        { "name": "Premium Products", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/premium-products", "host": ["{{base_url}}"], "path": ["api", "premium-products"] } } },
        { "name": "Popular Deals", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/popular-deals/products", "host": ["{{base_url}}"], "path": ["api", "popular-deals", "products"] } } },
        { "name": "Special Offers", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/special-offers/products", "host": ["{{base_url}}"], "path": ["api", "special-offers", "products"] } } },
        { "name": "New Arrivals", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/new-arrivals/products", "host": ["{{base_url}}"], "path": ["api", "new-arrivals", "products"] } } },
        { "name": "Featured Categories", "request": { "method": "GET", "url": { "raw": "{{base_url}}/api/featured-categories", "host": ["{{base_url}}"], "path": ["api", "featured-categories"] } } }
      ]
    },
    {
      "name": "Addresses (Auth)",
      "item": [
        {
          "name": "List Addresses",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/addresses", "host": ["{{base_url}}"], "path": ["api", "addresses"] }
          }
        },
        {
          "name": "Create Address",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"label\": \"Home\",\n  \"address\": \"123 Main St\",\n  \"city\": \"New York\",\n  \"state\": \"NY\",\n  \"zip\": \"10001\",\n  \"phone\": \"+1 555 0100\"\n}" },
            "url": { "raw": "{{base_url}}/api/addresses", "host": ["{{base_url}}"], "path": ["api", "addresses"] }
          }
        },
        {
          "name": "Set Default Address",
          "request": {
            "method": "POST",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/addresses/{{address_id}}/default", "host": ["{{base_url}}"], "path": ["api", "addresses", "{{address_id}}", "default"] }
          }
        },
        {
          "name": "Delete Address",
          "request": {
            "method": "DELETE",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/addresses/{{address_id}}", "host": ["{{base_url}}"], "path": ["api", "addresses", "{{address_id}}"] }
          }
        }
      ]
    },
    {
      "name": "Orders (Auth)",
      "item": [
        {
          "name": "Create Order",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"delivery_type_id\": 1,\n  \"address_id\": {{address_id}},\n  \"payment_method\": \"COD\",\n  \"items\": [\n    { \"product_id\": {{product_id}}, \"quantity\": 1 }\n  ]\n}" },
            "url": { "raw": "{{base_url}}/api/orders", "host": ["{{base_url}}"], "path": ["api", "orders"] }
          }
        },
        {
          "name": "List Orders",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/orders", "host": ["{{base_url}}"], "path": ["api", "orders"] }
          }
        },
        {
          "name": "Order Details",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/orders/{{order_id}}", "host": ["{{base_url}}"], "path": ["api", "orders", "{{order_id}}"] }
          }
        },
        {
          "name": "Track by Order Number",
          "request": {
            "method": "GET",
            "url": { "raw": "{{base_url}}/api/orders/by-number/{{order_number}}", "host": ["{{base_url}}"], "path": ["api", "orders", "by-number", "{{order_number}}"] }
          }
        }
      ]
    },
    {
      "name": "Coupons & Reviews (Auth)",
      "item": [
        {
          "name": "Apply Coupon",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"code\": \"SAVE10\"\n}" },
            "url": { "raw": "{{base_url}}/api/coupons/apply", "host": ["{{base_url}}"], "path": ["api", "coupons", "apply"] }
          }
        },
        {
          "name": "My Reviews",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/reviews/my", "host": ["{{base_url}}"], "path": ["api", "reviews", "my"] }
          }
        },
        {
          "name": "Create Review",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"product_id\": {{product_id}},\n  \"rating\": 5,\n  \"comment\": \"Great quality!\"\n}" },
            "url": { "raw": "{{base_url}}/api/reviews", "host": ["{{base_url}}"], "path": ["api", "reviews"] }
          }
        },
        {
          "name": "Update Review",
          "request": {
            "method": "PUT",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"rating\": 4,\n  \"comment\": \"Updated review\"\n}" },
            "url": { "raw": "{{base_url}}/api/reviews/{{review_id}}", "host": ["{{base_url}}"], "path": ["api", "reviews", "{{review_id}}"] }
          }
        }
      ]
    },
    {
      "name": "Support Tickets (Auth)",
      "item": [
        {
          "name": "List Tickets",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/support/tickets", "host": ["{{base_url}}"], "path": ["api", "support", "tickets"] }
          }
        },
        {
          "name": "Create Ticket",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"subject\": \"Order issue\",\n  \"message\": \"Please help\"\n}" },
            "url": { "raw": "{{base_url}}/api/support/tickets", "host": ["{{base_url}}"], "path": ["api", "support", "tickets"] }
          }
        },
        {
          "name": "Show Ticket",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/support/tickets/{{ticket_id}}", "host": ["{{base_url}}"], "path": ["api", "support", "tickets", "{{ticket_id}}"] }
          }
        },
        {
          "name": "Reply Ticket",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"message\": \"Reply message\"\n}" },
            "url": { "raw": "{{base_url}}/api/support/tickets/{{ticket_id}}/reply", "host": ["{{base_url}}"], "path": ["api", "support", "tickets", "{{ticket_id}}", "reply"] }
          }
        }
      ]
    },
    {
      "name": "Wallet (Auth)",
      "item": [
        {
          "name": "Get Wallet",
          "request": {
            "method": "GET",
            "header": [{ "key": "Authorization", "value": "Bearer {{token}}", "type": "text" }],
            "url": { "raw": "{{base_url}}/api/wallet", "host": ["{{base_url}}"], "path": ["api", "wallet"] }
          }
        },
        {
          "name": "Deposit",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"amount\": 100,\n  \"payment_method\": \"Stripe\",\n  \"transaction_id\": \"tx_demo_001\"\n}" },
            "url": { "raw": "{{base_url}}/api/wallet/deposit", "host": ["{{base_url}}"], "path": ["api", "wallet", "deposit"] }
          }
        }
      ]
    },
    {
      "name": "Payments",
      "item": [
        {
          "name": "Initiate Payment",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Authorization", "value": "Bearer {{token}}", "type": "text" },
              { "key": "Content-Type", "value": "application/json", "type": "text" }
            ],
            "body": { "mode": "raw", "raw": "{\n  \"order_id\": {{order_id}},\n  \"payment_method\": \"Stripe\"\n}" },
            "url": { "raw": "{{base_url}}/api/payments/initiate", "host": ["{{base_url}}"], "path": ["api", "payments", "initiate"] }
          }
        }
      ]
    },
    {
      "name": "AI",
      "item": [
        {
          "name": "Generate Description",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json", "type": "text" }],
            "body": { "mode": "raw", "raw": "{\n  \"title\": \"Fresh Apples\",\n  \"category\": \"Fruits\",\n  \"keywords\": [\"fresh\",\"organic\"]\n}" },
            "url": { "raw": "{{base_url}}/api/ai/generate-description", "host": ["{{base_url}}"], "path": ["api", "ai", "generate-description"] }
          }
        },
        {
          "name": "Prepare Product",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json", "type": "text" }],
            "body": { "mode": "raw", "raw": "{\n  \"name\": \"Fresh Apples\"\n}" },
            "url": { "raw": "{{base_url}}/api/ai/prepare-product", "host": ["{{base_url}}"], "path": ["api", "ai", "prepare-product"] }
          }
        },
        {
          "name": "Generate Product SEO",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json", "type": "text" }],
            "body": { "mode": "raw", "raw": "{\n  \"name\": \"Fresh Apples\"\n}" },
            "url": { "raw": "{{base_url}}/api/ai/generate-product-seo", "host": ["{{base_url}}"], "path": ["api", "ai", "generate-product-seo"] }
          }
        }
      ]
    },
    {
      "name": "Marketing & Analytics",
      "item": [
        {
          "name": "Newsletter Subscribe",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json", "type": "text" }],
            "body": { "mode": "raw", "raw": "{\n  \"email\": \"customer@example.com\"\n}" },
            "url": { "raw": "{{base_url}}/api/newsletter-subscriptions", "host": ["{{base_url}}"], "path": ["api", "newsletter-subscriptions"] }
          }
        },
        {
          "name": "Store Visit",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json", "type": "text" }],
            "body": { "mode": "raw", "raw": "{\n  \"page\": \"/\",\n  \"referrer\": \"\"\n}" },
            "url": { "raw": "{{base_url}}/api/visits", "host": ["{{base_url}}"], "path": ["api", "visits"] }
          }
        },
        {
          "name": "Visit Stats",
          "request": {
            "method": "GET",
            "url": { "raw": "{{base_url}}/api/visits/stats", "host": ["{{base_url}}"], "path": ["api", "visits", "stats"] }
          }
        }
      ]
    }
  ]
}
