diff --git a/.claude/settings.local.json b/.claude/settings.local.json new file mode 100644 index 0000000..c14d84d --- /dev/null +++ b/.claude/settings.local.json @@ -0,0 +1,9 @@ +{ + "permissions": { + "allow": [ + "Bash(mkdir:*)" + ], + "deny": [], + "ask": [] + } +} diff --git a/fern/docs.yml b/fern/docs.yml index 5da3af5..adb19b5 100644 --- a/fern/docs.yml +++ b/fern/docs.yml @@ -17,7 +17,7 @@ layout: tabs: home: - display-name: Home + display-name: Docs icon: home guides: display-name: Guides @@ -35,13 +35,42 @@ navigation: path: docs/pages/welcome.mdx - tab: guides layout: - - section: Learn + - section: Get started contents: - - page: Concepts - path: docs/pages/concepts.mdx - - page: SDKs - path: docs/pages/sdks.mdx - slug: sdks + - page: Overview + path: docs/pages/get-started/overview.mdx + icon: fa-duotone fa-book-open + - page: Quickstart + path: docs/pages/get-started/quickstart.mdx + icon: fa-duotone fa-rocket + - section: Capabilities + contents: + - page: Plant management + path: docs/pages/capabilities/plant-management.mdx + icon: fa-duotone fa-seedling + - page: Order processing + path: docs/pages/capabilities/order-processing.mdx + icon: fa-duotone fa-cart-shopping + - page: Customer management + path: docs/pages/capabilities/customer-management.mdx + icon: fa-duotone fa-users + - page: Inventory tracking + path: docs/pages/capabilities/inventory-tracking.mdx + icon: fa-duotone fa-boxes-stacked + - section: Tutorials + contents: + - page: Searching for plants + path: docs/pages/tutorials/searching-plants.mdx + icon: fa-duotone fa-magnifying-glass + - page: Creating your first order + path: docs/pages/tutorials/first-order-tutorial.mdx + icon: fa-duotone fa-bag-shopping + - page: Managing plant inventory + path: docs/pages/tutorials/inventory-tutorial.mdx + icon: fa-duotone fa-clipboard-list + - section: Changelog + contents: + - changelog: docs/changelog - tab: API Reference layout: - api: API Reference diff --git a/fern/docs/changelog/09-01-2025.mdx b/fern/docs/changelog/09-01-2025.mdx new file mode 100644 index 0000000..ab40bc2 --- /dev/null +++ b/fern/docs/changelog/09-01-2025.mdx @@ -0,0 +1,28 @@ +--- +title: September 1, 2025 +slug: 09-01-2025 +tags: ["plants-api", "orders", "webhooks", "security"] +--- + +## New features + +### Order refunds API +Introduced comprehensive refund management: +- `POST /orders/{id}/refund` - Process full or partial refunds +- `GET /orders/{id}/refunds` - View refund history +- Automatic inventory restoration on refunded items + +### Webhook signature verification +All webhooks now include `x-plantstore-signature` header for verifying webhook authenticity using HMAC-SHA256. + +## Enhancements + +- Added `description` field to plant objects for detailed product information +- Customer addresses can now be labeled (e.g., "Home", "Work", "Gift Address") +- Improved API response times by 40% through database optimization + +## Documentation + +- Added new tutorial: "Managing plant inventory" +- Updated webhook setup guide with signature verification examples +- Added code samples for Python, JavaScript, and Go SDKs diff --git a/fern/docs/changelog/09-15-2025.mdx b/fern/docs/changelog/09-15-2025.mdx new file mode 100644 index 0000000..76faac2 --- /dev/null +++ b/fern/docs/changelog/09-15-2025.mdx @@ -0,0 +1,31 @@ +--- +title: September 15, 2025 +slug: 09-15-2025 +tags: ["plants-api", "search", "new-features", "plant-care"] +--- + +## New features + +### Plant care requirements +Added detailed care information to plant objects: +- `light_requirements` - Light level needs (low, medium, bright indirect, full sun) +- `water_frequency` - Watering schedule recommendations +- `temperature_range` - Ideal temperature range +- `humidity_level` - Humidity preferences + +### Advanced filtering +Plant search now supports filtering by care requirements: +```bash +GET /plants?care_level=easy&light_requirements=low +``` + +## Enhancements + +- Increased rate limit from 1000 to 5000 requests per hour for production API keys +- Added response caching headers to improve performance +- Order confirmation emails now include estimated delivery date + +## Bug fixes + +- Fixed pagination issue in customer order history +- Resolved incorrect stock calculations when orders were cancelled diff --git a/fern/docs/changelog/10-01-2025.mdx b/fern/docs/changelog/10-01-2025.mdx new file mode 100644 index 0000000..dc63b5a --- /dev/null +++ b/fern/docs/changelog/10-01-2025.mdx @@ -0,0 +1,30 @@ +--- +title: October 1, 2025 +slug: 10-01-2025 +tags: ["plants-api", "breaking-change", "customers", "orders"] +--- + +## New features + +### Customer loyalty program +Introduced new `/customers/{id}/loyalty` endpoint for accessing customer loyalty points and rewards. + +### Wishlist functionality +Customers can now maintain wishlists: +- `POST /customers/{id}/wishlist` - Add plants to wishlist +- `GET /customers/{id}/wishlist` - Retrieve wishlist +- `DELETE /customers/{id}/wishlist/{plant_id}` - Remove from wishlist + +## Breaking changes + +### Order status field +The order `status` field now uses standardized values. Legacy status values will be deprecated on December 1, 2025: +- `pending_payment` → `pending` +- `in_progress` → `processing` + +Please update your integrations to use the new values. + +## Enhancements + +- Added pagination support to `/plants` endpoint with `limit` and `offset` parameters +- Improved error messages with more detailed validation feedback diff --git a/fern/docs/changelog/10-15-2025.mdx b/fern/docs/changelog/10-15-2025.mdx new file mode 100644 index 0000000..bed75a4 --- /dev/null +++ b/fern/docs/changelog/10-15-2025.mdx @@ -0,0 +1,21 @@ +--- +title: October 15, 2025 +slug: 10-15-2025 +tags: ["plants-api", "webhooks", "inventory-management", "new-features"] +--- + +## New features + +### Webhook events +Added support for new webhook events: +- `inventory.low_stock` - Triggered when stock falls below reorder point +- `inventory.restocked` - Triggered when items are restocked +- `customer.updated` - Triggered when customer profile is modified + +### Multi-location inventory +Inventory endpoints now support `location` parameter for tracking stock across multiple warehouses and greenhouses. + +## Enhancements + +- Improved webhook retry logic with exponential backoff +- Added `tracking_number` and `carrier` fields to order responses diff --git a/fern/docs/changelog/10-29-2025.mdx b/fern/docs/changelog/10-29-2025.mdx new file mode 100644 index 0000000..8593877 --- /dev/null +++ b/fern/docs/changelog/10-29-2025.mdx @@ -0,0 +1,18 @@ +--- +title: October 29, 2025 +slug: 10-29-2025 +tags: ["plants-api", "inventory-management", "enhancements"] +--- + +## Enhancements + +### Inventory tracking improvements +Added new `reserved` field to inventory responses, allowing better tracking of stock allocated to pending orders. + +### Bulk operations +Introduced `/inventory/batch-update` endpoint for updating multiple plant inventory levels in a single request. + +## Bug fixes + +- Fixed an issue where low stock alerts weren't triggering when inventory reached exactly the reorder point +- Corrected timezone handling in inventory history timestamps diff --git a/fern/docs/pages/capabilities/customer-management.mdx b/fern/docs/pages/capabilities/customer-management.mdx new file mode 100644 index 0000000..e4a2b1f --- /dev/null +++ b/fern/docs/pages/capabilities/customer-management.mdx @@ -0,0 +1,77 @@ +--- +title: Customer management +subtitle: Build lasting customer relationships with comprehensive profile and preference tracking +slug: customer-management +--- + +## Overview + +The Plant Store API's customer management capabilities help you build and maintain customer relationships through detailed profiles, preferences, and purchase history. Use it to create and manage customer profiles, track order history, manage multiple shipping addresses, store communication preferences, and build loyalty programs. + + + + Learn how to create customers as part of the order flow. + + + Explore customer endpoints and schemas. + + + +## Customer data types + +Different types of customer data serve different purposes in your system. + +| Data type | What it includes | Primary use | +|-----------|------------------|-------------| +| **Identity** | Name, email, phone, customer ID | Order fulfillment, authentication | +| **Preferences** | Email/SMS settings, language, timezone | Marketing, communication | +| **Transactional** | Order history, total spend, returns | Loyalty programs, segmentation | +| **Addresses** | Multiple shipping addresses, labels | Faster checkout, gift shipping | + + +Only collect data you'll actually use. More data means more liability and compliance requirements. Keep it minimal and purposeful. + + +## Address management + +Customers often ship to multiple locations like home, office, or gift recipients. Support multiple saved addresses with labels like "Home" or "Mom's house" for easy selection. Validate addresses at entry to reduce shipping errors and allow customers to set a default shipping address for faster checkout. + + +Address validation during input prevents expensive shipping errors. Most shipping carriers provide free address validation APIs. + + +## Privacy and compliance + +Customer data requires careful handling to maintain trust and meet legal requirements. Encrypt sensitive data at rest and in transit, support GDPR data export and deletion requests, and implement secure password requirements. Log all access to customer data for audit trails. + +| Regulation | Applies to | Key requirement | +|------------|------------|-----------------| +| GDPR | EU customers | Right to access, export, and delete data | +| CCPA | California customers | Right to know what data is collected | +| CAN-SPAM | Email marketing | Easy unsubscribe, accurate sender info | + +Retain customer data only as long as it's useful and compliant. Active customers can be kept indefinitely, inactive customers for 3-7 years, and deleted accounts only what's legally required for tax and transaction records. + + +Never commit customer data or API keys to version control. Use environment variables and secrets management instead. + + +## Customer segmentation + +Group customers for targeted engagement and personalized experiences. + +| Segment by | Example groups | Use case | +|------------|----------------|----------| +| **Purchase behavior** | High-value, frequent, one-time, at-risk | Loyalty rewards, win-back campaigns | +| **Product preference** | Indoor enthusiasts, succulent collectors | Product recommendations | +| **Engagement** | Highly engaged, moderate, dormant | Email frequency, re-engagement | + +Segmentation enables more effective marketing by tailoring messages to customer interests and behavior patterns. diff --git a/fern/docs/pages/capabilities/inventory-tracking.mdx b/fern/docs/pages/capabilities/inventory-tracking.mdx new file mode 100644 index 0000000..15696f8 --- /dev/null +++ b/fern/docs/pages/capabilities/inventory-tracking.mdx @@ -0,0 +1,93 @@ +--- +title: Inventory tracking +subtitle: Track plant stock levels in real-time with automated alerts and reservations +slug: inventory-tracking +--- + +## Overview + +The Plant Store API's inventory tracking capabilities help you maintain accurate stock levels and prevent overselling. Use it to track on-hand, reserved, and available quantities, reserve inventory when orders are placed, set up automatic low-stock alerts, view inventory history and audit trails, and manage stock across multiple locations. + + + + Learn how to track and update your plant stock. + + + Explore inventory endpoints and schemas. + + + +## Inventory states + +Inventory isn't just a single number. Plants exist in different states throughout the order and fulfillment process. + +| State | Definition | Formula | +|-------|------------|---------| +| **On-hand** | Physical count in your possession | Actual count from warehouse | +| **Reserved** | Committed to pending orders | Sum of active order reservations | +| **Available** | Stock available for new orders | On-hand - Reserved - Damaged | +| **In-transit** | Ordered from suppliers, not yet received | Active purchase orders | + + +Update inventory in real-time, not in batches. Delays between order creation and inventory updates cause overselling. + + +## Reservation strategy + +Reserve inventory when an order is created (not just when paid) to prevent two customers from buying the last plant simultaneously. Set expiration times for unpaid orders—typically 15-30 minutes—and release reservations automatically if payment fails or times out. Convert reservations to permanent deductions when the order ships. + + +Most payment processors complete checkout within 15 minutes. Setting reservation expiration to 15-30 minutes balances preventing overselling with not holding stock unnecessarily. + + +## Low-stock alerts + +Set reorder points based on supplier lead time and sales velocity to ensure you never run out of popular plants. + +**Reorder point formula:** `(Lead time in days × Daily sales) + Safety stock` + +| Component | Example | Purpose | +|-----------|---------|---------| +| Lead time | 7 days | How long to get new stock from supplier | +| Daily sales | 2 plants/day | Average sales velocity | +| Safety stock | 5 plants | Buffer for demand spikes or delays | +| **Reorder point** | **19 plants** | Alert when inventory drops below this | + +Automate reorder notifications via email or webhook when inventory drops below the reorder point. Track supplier lead times over time and adjust reorder points accordingly to account for seasonal variations or supply chain changes. + +## Accuracy and auditing + +Maintain inventory accuracy through regular physical counts and comprehensive audit trails. Use cycle counting—counting a different section each week rather than everything at once. High-value or fast-moving items should be counted weekly, while slow-movers can be quarterly. + +Log all inventory changes with timestamps, reasons, and the user who made the change. This creates an audit trail for troubleshooting discrepancies and preventing fraud. + +| Change type | Reason code | Approval required | +|-------------|-------------|-------------------| +| Stock received | `shipment_received` | No | +| Order shipped | `order_fulfilled` | No | +| Damaged goods | `shrinkage_damaged` | Manager approval | +| Manual adjustment | `count_correction` | Manager approval | + + +Plants are trickier than most inventory due to perishability, growth, and quality variance. Regular physical counts catch issues before they impact customers. + + +## Multi-location inventory + +For operations with multiple greenhouses, warehouses, or stores, choose a strategy that balances complexity with delivery speed. + +| Strategy | Best for | Trade-offs | +|----------|----------|------------| +| **Centralized** | Small operations, specialty items | Simpler to manage, slower/costlier shipping | +| **Distributed** | Large operations, fast delivery needs | Faster delivery, more complex management | +| **Hybrid** | Most operations | Popular items everywhere, specialty items central | Balanced approach | + +Route orders to the optimal location based on proximity to customer, current stock availability, and shipping costs. Allow transfers between locations for balancing inventory across facilities. diff --git a/fern/docs/pages/capabilities/order-processing.mdx b/fern/docs/pages/capabilities/order-processing.mdx new file mode 100644 index 0000000..80c40c8 --- /dev/null +++ b/fern/docs/pages/capabilities/order-processing.mdx @@ -0,0 +1,86 @@ +--- +title: Order processing +subtitle: Manage orders from creation through delivery with automated status tracking +slug: order-processing +--- + +## Overview + +The Plant Store API manages the complete order lifecycle, from purchase through delivery. Use it to create orders, process payments, track fulfillment, and handle cancellations and refunds. + + + + Step-by-step guide to creating and processing an order. + + + Explore order endpoints and schemas. + + + +## Order status + +Orders progress through these states: + +```mermaid +stateDiagram-v2 + [*] --> pending + pending --> paid: Payment confirmed + pending --> cancelled: Payment failed + + paid --> processing: Begin fulfillment + paid --> cancelled: Customer cancels + + processing --> shipped: Carrier pickup + processing --> cancelled: Issue found + + shipped --> delivered: Customer receives + + cancelled --> refunded: Process refund + refunded --> [*] + delivered --> [*] +``` + +| Status | Description | Typical duration | +|--------|-------------|------------------| +| `pending` | Order created, awaiting payment | Minutes to hours | +| `paid` | Payment confirmed, ready for fulfillment | Hours to days | +| `processing` | Being prepared for shipment | 1-2 business days | +| `shipped` | In transit to customer | 2-7 business days | +| `delivered` | Successfully received | Final state | +| `cancelled` | Order cancelled before shipment | Leads to refund | +| `refunded` | Payment returned to customer | Final state | + + +Only allow order modifications before the `processing` status. Once fulfillment starts, cancel and create a new order instead. + + +## Payment and inventory coordination + +Effective order processing requires careful synchronization between payment and inventory systems. Reserve inventory immediately when an order is created to prevent overselling. If payment fails or times out, release the reservation automatically. Only deduct from physical stock when the order actually ships. + +For payments, authorize at checkout to verify funds exist, but capture (actually charge) only after validating inventory and preparing to ship. This two-step approach reduces chargebacks from unfulfilled orders and provides better fraud prevention. + + +Separate authorization and capture gives you time to validate inventory before actually charging the customer. Most payment processors support a 7-day window between authorization and capture. + + +## Customer notifications + +Keep customers informed at every stage with automated notifications. Send a confirmation email immediately after order creation, notify when payment is received, and provide tracking information when the order ships. Following up after delivery with care instructions helps ensure satisfaction and reduces support queries. + +| Event | Notification | Content to include | +|-------|-------------|-------------------| +| Order created | Confirmation email | Order details, items, estimated delivery | +| Payment received | Payment confirmation | Amount charged, next steps | +| Order shipped | Shipping notification | Tracking number, carrier, estimated arrival | +| Order delivered | Delivery confirmation | Care instructions, review request | + +Update order status in real-time and log all changes with timestamps to create an audit trail. Make the current status visible to customers at all times through their account dashboard or order tracking pages. diff --git a/fern/docs/pages/capabilities/plant-management.mdx b/fern/docs/pages/capabilities/plant-management.mdx new file mode 100644 index 0000000..6acdf88 --- /dev/null +++ b/fern/docs/pages/capabilities/plant-management.mdx @@ -0,0 +1,69 @@ +--- +title: Plant management +subtitle: Organize and maintain your plant catalog with flexible categorization and search +slug: plant-management +--- + +## Overview + +The Plant Store API's plant management capabilities let you create, organize, and maintain your plant catalog with rich metadata and flexible categorization. Use it to create and update plant listings, organize by categories and tags, control availability status, and search and filter for customers and internal operations. + + + + Learn how to search and filter your plant catalog. + + + Explore plant management endpoints and schemas. + + + +## Plant status values + +Plants in your catalog have availability states that reflect inventory. Status should automatically sync with inventory levels to prevent overselling. + +| Status | When to use | +|--------|-------------| +| `available` | In stock and ready to purchase | +| `pending` | Reserved for orders or incoming shipments | +| `sold` | No longer available for new orders | + + +Always update plant status when inventory changes. Stale status values lead to overselling and customer disappointment. + + +## Categorization strategies + +Organize plants to help customers find what they need. Most successful plant stores use multiple categorization methods simultaneously. + +| Strategy | Categories | Example use case | +|----------|-----------|------------------| +| **Care difficulty** | Easy, Moderate, Advanced | Help beginners find low-maintenance plants | +| **Environment** | Indoor, Outdoor, Tropical, Desert | Match plants to customer's space | +| **Size** | Small, Medium, Large | Filter by available space constraints | + +Use categories for broad grouping (mutually exclusive choices like Indoor vs Outdoor), and tags for flexible overlapping labels like "pet-friendly", "air-purifying", or "low-light". This dual approach gives customers maximum flexibility when browsing. + + +Include scientific names alongside common names. Many experienced plant enthusiasts search by scientific names, and it helps differentiate between similar common names. + + +## Handling variants + +Different pot sizes or colors of the same plant should be tracked separately for pricing and inventory purposes. Create separate plant records for each variant and link them using consistent tags or naming conventions. For example, "Snake Plant - 4 inch" and "Snake Plant - 6 inch" as distinct SKUs. + +| Approach | Pros | Cons | +|----------|------|------| +| Separate products | Independent pricing and inventory | More records to manage | +| Single product with variants | Cleaner catalog | Complex inventory tracking | + + +Most plant stores find separate products simpler to implement and more flexible for pricing adjustments. + diff --git a/fern/docs/pages/concepts.mdx b/fern/docs/pages/concepts.mdx index 9bd5e1b..e1fcaf8 100644 --- a/fern/docs/pages/concepts.mdx +++ b/fern/docs/pages/concepts.mdx @@ -16,3 +16,34 @@ A store has a collection of plants. It is responsible for managing the inventory ### User A user is a person who buys plants from the store. Also known as plant parents. + + + + Learn when and how much to water different types of plants. Overwatering is one of the most common mistakes! + + + Understand the difference between full sun, partial shade, and low light conditions. + + + Discover the right soil types and feeding schedules for healthy plant growth. + + + Identify and treat common pests, diseases, and plant health issues. + + \ No newline at end of file diff --git a/fern/docs/pages/get-started/overview.mdx b/fern/docs/pages/get-started/overview.mdx new file mode 100644 index 0000000..d61b197 --- /dev/null +++ b/fern/docs/pages/get-started/overview.mdx @@ -0,0 +1,125 @@ +--- +title: Overview +subtitle: Welcome to the Plant Store API +slug: overview +--- + +The Plant Store API is a complete e-commerce platform designed for plant retailers. It handles everything from catalog management and inventory tracking to order processing and customer relationships. + +## What you can build + +The Plant Store API provides the building blocks for plant retail operations: + + + + Build online storefronts with real-time inventory, shopping carts, and checkout flows. + + + Create native iOS and Android apps for browsing plants and placing orders. + + + Track stock across multiple locations with automated reorder alerts. + + + Manage your catalog, process orders, and analyze customer behavior. + + + +## Core capabilities + +The API is organized around four main capabilities, each handling a specific aspect of plant retail: + + + + Create and organize your plant catalog with rich metadata, images, and categorization. Control availability status as inventory changes and enable customers to search and filter by care level, environment, or tags. + + + Handle the complete order lifecycle from purchase through delivery. Process payments, track fulfillment status, and manage cancellations and refunds. Every order automatically reserves inventory to prevent overselling. + + + Build lasting relationships with detailed customer profiles, order history, and communication preferences. Support multiple shipping addresses, track purchase patterns, and segment customers for targeted marketing. + + + Maintain accurate stock levels across all sales channels with real-time updates. Set automated reorder alerts, reserve inventory for pending orders, and track changes with comprehensive audit trails. + + + +## How it works + +When a customer browses your catalog, the plant management system handles search and filtering. Creating an order triggers the order processing system, which validates payment. On successful payment, inventory tracking reserves stock and manages fulfillment. Throughout the process, customer management sends notifications and maintains order history. If payment fails, the system cancels the order and notifies the customer automatically. + + +```mermaid +graph TD + A[Customer browses plants] --> B[Plant Management] + B --> C[Adds to cart] + C --> D[Creates order] + + D --> E[Order Processing] + E --> F{Payment successful?} + + F -->|Yes| G[Inventory Tracking] + F -->|No| H[Cancel & notify] + + G --> I[Reserve stock] + I --> J[Fulfill order] + J --> K[Update inventory] + + K --> L[Customer Management] + L --> M[Send notifications] + L --> N[Update order history] + + H --> L +``` + + +## Rate limits + +The Plant Store API has the following rate limits to ensure reliable service: + +| Plan | Requests per minute | Burst limit | +|------|-------------------|-------------| +| Free | 60 | 100 | +| Pro | 600 | 1000 | +| Enterprise | Custom | Custom | + +If you exceed your rate limit, you'll receive a `429 Too Many Requests` response. Implement exponential backoff to handle rate limit errors gracefully. + +## SDKs and libraries + +Official SDKs are available for popular languages. Each SDK handles authentication, error handling, and request formatting automatically, making integration faster and more reliable than using the raw REST API. + + + + ```bash + pip install plantstore-sdk + ``` + + + ```bash + npm install @plantstore/sdk + ``` + + + ```bash + go get github.com/plantstore/plantstore-go + ``` + + + +## Getting help + + + + Make your first API request in minutes + + + Complete endpoint documentation + + + Step-by-step integration guides + + + Contact our team for help + + diff --git a/fern/docs/pages/get-started/quickstart.mdx b/fern/docs/pages/get-started/quickstart.mdx new file mode 100644 index 0000000..2a96140 --- /dev/null +++ b/fern/docs/pages/get-started/quickstart.mdx @@ -0,0 +1,182 @@ +--- +title: Quickstart +subtitle: Get up and running with the Plant Store API in minutes +slug: quickstart +--- + +This guide shows you how to make your first API request to the Plant Store API using our SDKs. + +## Making your first API request + + + + +[Create an API key in your dashboard](https://plantstore.com/settings/api-keys), which you'll use to authenticate your requests. + +Store the key securely and pass it to the SDK either as an environment variable via a `.env` file, or directly in your app's configuration. + +```bash title=".env" +PLANT_STORE_API_KEY=your_api_key_here +``` + + +Never commit API keys to version control. Use environment variables and rotate keys regularly for security. + + + + + + +Install the Plant Store SDK for your preferred language: + + +```bash Python +pip install plantstore-sdk +pip install python-dotenv +``` + +```bash TypeScript +npm install @plantstore/sdk +npm install dotenv +``` + +```bash Go +go get github.com/plantstore/plantstore-go +``` + + + + + + +Create a new file and add the following code to search for available plants: + + +```python Python +# quickstart.py +import os +from dotenv import load_dotenv +from plantstore import PlantStoreClient + +load_dotenv() + +client = PlantStoreClient( + api_key=os.getenv("PLANT_STORE_API_KEY") +) + +# Search for available plants +plants = client.plants.search(status="available") + +print(f"Found {len(plants)} available plants:") +for plant in plants[:5]: + print(f"- {plant.name} (${plant.price})") +``` + +```typescript TypeScript +// quickstart.ts +import { PlantStoreClient } from '@plantstore/sdk'; +import 'dotenv/config'; + +const client = new PlantStoreClient({ + apiKey: process.env.PLANT_STORE_API_KEY +}); + +async function searchPlants() { + // Search for available plants + const plants = await client.plants.search({ + status: 'available' + }); + + console.log(`Found ${plants.length} available plants:`); + plants.slice(0, 5).forEach(plant => { + console.log(`- ${plant.name} ($${plant.price})`); + }); +} + +searchPlants(); +``` + +```go Go +// main.go +package main + +import ( + "fmt" + "log" + "os" + + "github.com/joho/godotenv" + "github.com/plantstore/plantstore-go" +) + +func main() { + godotenv.Load() + + client := plantstore.NewClient( + plantstore.WithAPIKey(os.Getenv("PLANT_STORE_API_KEY")), + ) + + // Search for available plants + plants, err := client.Plants.Search(&plantstore.PlantSearchRequest{ + Status: "available", + }) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Found %d available plants:\n", len(plants)) + for i := 0; i < 5 && i < len(plants); i++ { + fmt.Printf("- %s ($%.2f)\n", plants[i].Name, plants[i].Price) + } +} +``` + + + + + + + +```bash Python +python quickstart.py +``` + +```bash TypeScript +npx tsx quickstart.ts +``` + +```bash Go +go run main.go +``` + + +You should see a list of available plants from your catalog. + + + + +## Next steps + + + + Learn how to search and filter your plant catalog + + + Build a complete order workflow + + + Explore all available endpoints + + diff --git a/fern/docs/pages/light.mdx b/fern/docs/pages/light.mdx new file mode 100644 index 0000000..d4e7a2b --- /dev/null +++ b/fern/docs/pages/light.mdx @@ -0,0 +1,118 @@ +--- +title: Light requirements +subtitle: Understanding plant lighting needs +slug: light +description: Learn about different light levels and how to provide the right amount of light for your plants to thrive. +--- + +Light is essential for photosynthesis and healthy plant growth. Understanding your home's light conditions and matching them to the right plants is key to success. + +## Light levels explained + +### Full sun (direct light) +- **6+ hours** of direct sunlight per day +- Usually south-facing windows +- Hot, bright spots +- Best for: Succulents, cacti, herbs, vegetables, flowering plants + +### Bright indirect light +- **4-6 hours** of bright but filtered light +- Near east or west-facing windows +- Light is bright but not hitting plants directly +- Best for: Most tropical plants, ferns, many houseplants + +### Medium light (partial shade) +- **2-4 hours** of indirect light +- Several feet from a bright window +- North-facing windows +- Best for: Pothos, philodendrons, snake plants + +### Low light (shade) +- **Less than 2 hours** of indirect light +- Corners of rooms, hallways +- Far from windows +- Best for: Snake plants, ZZ plants, cast iron plants + +## How to assess your light + +### The shadow test +Hold your hand 12 inches above where you want to place your plant: +- **Sharp, defined shadow**: Bright/direct light +- **Soft, fuzzy shadow**: Medium light +- **Barely visible shadow**: Low light + +### Watch the sun +Observe your space throughout the day: +- **Morning sun** (east): Gentle, great for most plants +- **Afternoon sun** (west): Intense, can be too hot +- **All-day sun** (south): Brightest, best for sun-lovers +- **No direct sun** (north): Lowest light + +## Signs of light problems + +### Too much light +- Bleached or faded leaves +- Brown, crispy patches (sunburn) +- Leaves turning yellow +- Wilting despite adequate water +- Soil drying very quickly + +### Too little light +- Leggy, stretched growth +- Leaning toward light source +- Small, pale new leaves +- Slow or no growth +- Lower leaves dropping +- Variegated plants losing patterns + +## Solutions for light issues + +### Increasing light +- Move closer to windows +- Use mirrors to reflect light +- Clean windows and leaves (dust blocks light) +- Paint walls white or light colors +- **Use grow lights** for low-light spaces + +### Reducing light +- Move away from windows +- Use sheer curtains to filter light +- Place plants behind taller plants +- Relocate to north-facing windows + +## Grow lights + +When natural light isn't enough, supplement with artificial lighting: + +### Types of grow lights +- **LED**: Energy-efficient, cool, full spectrum +- **Fluorescent**: Good for seedlings and herbs +- **Full spectrum bulbs**: Mimic natural sunlight + +### Grow light tips +- Place 6-12 inches above plants +- Run for 12-16 hours per day +- Use timers for consistency +- Adjust height as plants grow + +## Seasonal changes + +### Summer +- Longer days mean more light +- Watch for sun damage as sun angle changes +- May need to move plants away from windows + +### Winter +- Shorter days mean less light +- Consider moving plants closer to windows +- Supplement with grow lights if needed +- Rotate plants more frequently + +## Pro tips + +- **Rotate plants weekly** for even growth on all sides +- **Acclimate gradually** when moving to brighter spots +- **Clean leaves monthly** to maximize light absorption +- **South-facing windows** get the most light in Northern Hemisphere +- **Observe your plants** - they'll tell you what they need +- **Use the right window** - not all windows are equal \ No newline at end of file diff --git a/fern/docs/pages/tutorials/first-order-tutorial.mdx b/fern/docs/pages/tutorials/first-order-tutorial.mdx new file mode 100644 index 0000000..ff76320 --- /dev/null +++ b/fern/docs/pages/tutorials/first-order-tutorial.mdx @@ -0,0 +1,298 @@ +--- +title: Creating your first order +subtitle: Learn how to create and process an order end-to-end +slug: first-order-tutorial +--- + +This guide shows you how to create a complete order workflow, from customer creation through order fulfillment. + +## Creating and processing an order + + + + +[Create an API key in your dashboard](https://plantstore.com/settings/api-keys), which you'll use to authenticate your requests. + +Store the key securely and pass it to the SDK either as an environment variable via a `.env` file, or directly in your app's configuration. + +```bash title=".env" +PLANT_STORE_API_KEY=your_api_key_here +``` + + + + + +We'll also use the `dotenv` library to load our API key from an environment variable. + + +```bash Python +pip install plantstore-sdk +pip install python-dotenv +``` + +```bash TypeScript +npm install @plantstore/sdk +npm install dotenv +``` + +```bash Go +go get github.com/plantstore/plantstore-go +``` + + + + + + +Create a new file named `create_order.py`, `create_order.ts`, or `main.go` and add the following code: + + +```python Python +# create_order.py +import os +from dotenv import load_dotenv +from plantstore import PlantStoreClient + +load_dotenv() + +client = PlantStoreClient( + api_key=os.getenv("PLANT_STORE_API_KEY") +) + +# Create a customer +customer = client.customers.create( + email="gardener@example.com", + name="Jane Smith", + phone="+1-555-0123" +) + +print(f"Created customer: {customer.id}") + +# Browse available plants +plants = client.plants.search(status="available") +selected_plant = plants[0] + +print(f"Selected plant: {selected_plant.name}") + +# Create the order +order = client.orders.create( + customer_id=customer.id, + items=[ + { + "plant_id": selected_plant.id, + "quantity": 2, + "price": selected_plant.price + } + ], + shipping_address={ + "street": "123 Garden Ave", + "city": "Portland", + "state": "OR", + "zip": "97201" + } +) + +print(f"Created order: {order.id}") + +# Process payment +payment = client.orders.process_payment( + order_id=order.id, + payment_method="card", + amount=order.total +) + +print(f"Payment processed: {payment.status}") + +# Update order status to processing +updated_order = client.orders.update( + order_id=order.id, + status="processing" +) + +print(f"Order status: {updated_order.status}") +print(f"Order complete! ID: {order.id}") +``` + +```typescript TypeScript +// create_order.ts +import { PlantStoreClient } from '@plantstore/sdk'; +import 'dotenv/config'; + +const client = new PlantStoreClient({ + apiKey: process.env.PLANT_STORE_API_KEY +}); + +async function createOrder() { + // Create a customer + const customer = await client.customers.create({ + email: 'gardener@example.com', + name: 'Jane Smith', + phone: '+1-555-0123' + }); + + console.log(`Created customer: ${customer.id}`); + + // Browse available plants + const plants = await client.plants.search({ status: 'available' }); + const selectedPlant = plants[0]; + + console.log(`Selected plant: ${selectedPlant.name}`); + + // Create the order + const order = await client.orders.create({ + customerId: customer.id, + items: [ + { + plantId: selectedPlant.id, + quantity: 2, + price: selectedPlant.price + } + ], + shippingAddress: { + street: '123 Garden Ave', + city: 'Portland', + state: 'OR', + zip: '97201' + } + }); + + console.log(`Created order: ${order.id}`); + + // Process payment + const payment = await client.orders.processPayment({ + orderId: order.id, + paymentMethod: 'card', + amount: order.total + }); + + console.log(`Payment processed: ${payment.status}`); + + // Update order status to processing + const updatedOrder = await client.orders.update({ + orderId: order.id, + status: 'processing' + }); + + console.log(`Order status: ${updatedOrder.status}`); + console.log(`Order complete! ID: ${order.id}`); +} + +createOrder(); +``` + +```go Go +// main.go +package main + +import ( + "fmt" + "log" + "os" + + "github.com/joho/godotenv" + "github.com/plantstore/plantstore-go" +) + +func main() { + godotenv.Load() + + client := plantstore.NewClient( + plantstore.WithAPIKey(os.Getenv("PLANT_STORE_API_KEY")), + ) + + // Create a customer + customer, err := client.Customers.Create(&plantstore.CustomerCreateRequest{ + Email: "gardener@example.com", + Name: "Jane Smith", + Phone: "+1-555-0123", + }) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Created customer: %s\n", customer.ID) + + // Browse available plants + plants, err := client.Plants.Search(&plantstore.PlantSearchRequest{ + Status: "available", + }) + if err != nil { + log.Fatal(err) + } + selectedPlant := plants[0] + + fmt.Printf("Selected plant: %s\n", selectedPlant.Name) + + // Create the order + order, err := client.Orders.Create(&plantstore.OrderCreateRequest{ + CustomerID: customer.ID, + Items: []plantstore.OrderItem{ + { + PlantID: selectedPlant.ID, + Quantity: 2, + Price: selectedPlant.Price, + }, + }, + ShippingAddress: plantstore.Address{ + Street: "123 Garden Ave", + City: "Portland", + State: "OR", + Zip: "97201", + }, + }) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Created order: %s\n", order.ID) + + // Process payment + payment, err := client.Orders.ProcessPayment(&plantstore.PaymentRequest{ + OrderID: order.ID, + PaymentMethod: "card", + Amount: order.Total, + }) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Payment processed: %s\n", payment.Status) + + // Update order status + updatedOrder, err := client.Orders.Update(&plantstore.OrderUpdateRequest{ + OrderID: order.ID, + Status: "processing", + }) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Order status: %s\n", updatedOrder.Status) + fmt.Printf("Order complete! ID: %s\n", order.ID) +} +``` + + + + + + + +```bash Python +python create_order.py +``` + +```bash TypeScript +npx tsx create_order.ts +``` + +```bash Go +go run main.go +``` + + +You should see output showing each step of the order creation process, ending with the completed order ID. + + + \ No newline at end of file diff --git a/fern/docs/pages/tutorials/inventory-tutorial.mdx b/fern/docs/pages/tutorials/inventory-tutorial.mdx new file mode 100644 index 0000000..6e8651a --- /dev/null +++ b/fern/docs/pages/tutorials/inventory-tutorial.mdx @@ -0,0 +1,428 @@ +--- +title: Managing plant inventory +subtitle: Learn how to track and manage your plant stock levels +slug: inventory-tutorial +--- + +This guide shows you how to manage your plant inventory, from adding new stock to setting up automated reorder alerts. + +## Building an inventory management system + + + + +[Create an API key in your dashboard](https://plantstore.com/settings/api-keys) to authenticate your requests. + +```bash title=".env" +PLANT_STORE_API_KEY=your_api_key_here +``` + + + + + + +```bash Python +pip install plantstore-sdk +pip install python-dotenv +``` + +```bash TypeScript +npm install @plantstore/sdk +npm install dotenv +``` + +```bash Go +go get github.com/plantstore/plantstore-go +``` + + + + + + +Create a new file named `manage_inventory.py`, `manage_inventory.ts`, or `main.go` with the following code: + + +```python Python +# manage_inventory.py +import os +from dotenv import load_dotenv +from plantstore import PlantStoreClient + +load_dotenv() + +client = PlantStoreClient(api_key=os.getenv("PLANT_STORE_API_KEY")) + +# Add a new plant with initial stock +plant = client.plants.create( + name="Snake Plant", + category="Indoor", + tags=["low-light", "beginner-friendly", "air-purifying"], + status="available", + stock=25, + price=29.99, + location="greenhouse_a" +) + +print(f"Added plant: {plant.name} (ID: {plant.id})") +print(f"Initial stock: {plant.stock}") +``` + +```typescript TypeScript +// manage_inventory.ts +import { PlantStoreClient } from '@plantstore/sdk'; +import 'dotenv/config'; + +const client = new PlantStoreClient({ + apiKey: process.env.PLANT_STORE_API_KEY +}); + +async function addPlant() { + // Add a new plant with initial stock + const plant = await client.plants.create({ + name: 'Snake Plant', + category: 'Indoor', + tags: ['low-light', 'beginner-friendly', 'air-purifying'], + status: 'available', + stock: 25, + price: 29.99, + location: 'greenhouse_a' + }); + + console.log(`Added plant: ${plant.name} (ID: ${plant.id})`); + console.log(`Initial stock: ${plant.stock}`); +} + +addPlant(); +``` + +```go Go +// main.go +package main + +import ( + "fmt" + "log" + "os" + + "github.com/joho/godotenv" + "github.com/plantstore/plantstore-go" +) + +func main() { + godotenv.Load() + + client := plantstore.NewClient( + plantstore.WithAPIKey(os.Getenv("PLANT_STORE_API_KEY")), + ) + + // Add a new plant with initial stock + plant, err := client.Plants.Create(&plantstore.PlantCreateRequest{ + Name: "Snake Plant", + Category: "Indoor", + Tags: []string{"low-light", "beginner-friendly", "air-purifying"}, + Status: "available", + Stock: 25, + Price: 29.99, + Location: "greenhouse_a", + }) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Added plant: %s (ID: %s)\n", plant.Name, plant.ID) + fmt.Printf("Initial stock: %d\n", plant.Stock) +} +``` + + + + + + +Add code to check the current inventory status: + + +```python Python +# Check inventory for the plant +inventory = client.inventory.get(plant_id=plant.id) + +print(f"\nInventory Status:") +print(f"On-hand: {inventory.quantity}") +print(f"Reserved: {inventory.reserved}") +print(f"Available: {inventory.available}") +print(f"Location: {inventory.location}") +``` + +```typescript TypeScript +// Check inventory for the plant +const inventory = await client.inventory.get({ + plantId: plant.id +}); + +console.log('\nInventory Status:'); +console.log(`On-hand: ${inventory.quantity}`); +console.log(`Reserved: ${inventory.reserved}`); +console.log(`Available: ${inventory.available}`); +console.log(`Location: ${inventory.location}`); +``` + +```go Go +// Check inventory for the plant +inventory, err := client.Inventory.Get(&plantstore.InventoryGetRequest{ + PlantID: plant.ID, +}) +if err != nil { + log.Fatal(err) +} + +fmt.Println("\nInventory Status:") +fmt.Printf("On-hand: %d\n", inventory.Quantity) +fmt.Printf("Reserved: %d\n", inventory.Reserved) +fmt.Printf("Available: %d\n", inventory.Available) +fmt.Printf("Location: %s\n", inventory.Location) +``` + + + + + + +Add functionality to update inventory when you receive shipments: + + +```python Python +# Receive new shipment +updated_inventory = client.inventory.update( + plant_id=plant.id, + quantity=40, + note="Received shipment from supplier" +) + +print(f"\nStock updated to: {updated_inventory.quantity}") +``` + +```typescript TypeScript +// Receive new shipment +const updatedInventory = await client.inventory.update({ + plantId: plant.id, + quantity: 40, + note: 'Received shipment from supplier' +}); + +console.log(`\nStock updated to: ${updatedInventory.quantity}`); +``` + +```go Go +// Receive new shipment +updatedInventory, err := client.Inventory.Update(&plantstore.InventoryUpdateRequest{ + PlantID: plant.ID, + Quantity: 40, + Note: "Received shipment from supplier", +}) +if err != nil { + log.Fatal(err) +} + +fmt.Printf("\nStock updated to: %d\n", updatedInventory.Quantity) +``` + + + + + + +Configure automatic alerts when inventory runs low: + + +```python Python +# Configure low-stock alert +alert = client.inventory.set_alert( + plant_id=plant.id, + reorder_point=10, + notify_email="inventory@plantstore.com" +) + +print(f"\nLow-stock alert set: {alert.reorder_point} units") +``` + +```typescript TypeScript +// Configure low-stock alert +const alert = await client.inventory.setAlert({ + plantId: plant.id, + reorderPoint: 10, + notifyEmail: 'inventory@plantstore.com' +}); + +console.log(`\nLow-stock alert set: ${alert.reorderPoint} units`); +``` + +```go Go +// Configure low-stock alert +alert, err := client.Inventory.SetAlert(&plantstore.InventoryAlertRequest{ + PlantID: plant.ID, + ReorderPoint: 10, + NotifyEmail: "inventory@plantstore.com", +}) +if err != nil { + log.Fatal(err) +} + +fmt.Printf("\nLow-stock alert set: %d units\n", alert.ReorderPoint) +``` + + + + + + +Demonstrate how to reserve stock when processing orders: + + +```python Python +# Reserve stock for an order +reservation = client.inventory.reserve( + plant_id=plant.id, + quantity=2, + order_id="order_123", + expires_at="2025-11-01T10:00:00Z" +) + +print(f"\nReserved {reservation.quantity} units for order {reservation.order_id}") + +# Check updated inventory +updated = client.inventory.get(plant_id=plant.id) +print(f"Reserved: {updated.reserved}, Available: {updated.available}") +``` + +```typescript TypeScript +// Reserve stock for an order +const reservation = await client.inventory.reserve({ + plantId: plant.id, + quantity: 2, + orderId: 'order_123', + expiresAt: '2025-11-01T10:00:00Z' +}); + +console.log(`\nReserved ${reservation.quantity} units for order ${reservation.orderId}`); + +// Check updated inventory +const updated = await client.inventory.get({ plantId: plant.id }); +console.log(`Reserved: ${updated.reserved}, Available: ${updated.available}`); +``` + +```go Go +// Reserve stock for an order +reservation, err := client.Inventory.Reserve(&plantstore.InventoryReserveRequest{ + PlantID: plant.ID, + Quantity: 2, + OrderID: "order_123", + ExpiresAt: "2025-11-01T10:00:00Z", +}) +if err != nil { + log.Fatal(err) +} + +fmt.Printf("\nReserved %d units for order %s\n", reservation.Quantity, reservation.OrderID) + +// Check updated inventory +updated, err := client.Inventory.Get(&plantstore.InventoryGetRequest{ + PlantID: plant.ID, +}) +if err != nil { + log.Fatal(err) +} +fmt.Printf("Reserved: %d, Available: %d\n", updated.Reserved, updated.Available) +``` + + + + + + + +```bash Python +python manage_inventory.py +``` + +```bash TypeScript +npx tsx manage_inventory.ts +``` + +```bash Go +go run main.go +``` + + +You should see output showing: +- Plant creation with initial stock +- Current inventory status +- Stock updates from shipments +- Alert configuration +- Stock reservation for orders + + + + + + +### Batch inventory updates + +For processing large shipments, use batch updates: + + +```python Python +# Update multiple plants at once +batch_result = client.inventory.batch_update( + updates=[ + {"plant_id": "plant_123", "quantity": 30}, + {"plant_id": "plant_456", "quantity": 15}, + {"plant_id": "plant_789", "quantity": 22} + ] +) +print(f"Updated {len(batch_result.updated)} plants") +``` + +```typescript TypeScript +// Update multiple plants at once +const batchResult = await client.inventory.batchUpdate({ + updates: [ + { plantId: 'plant_123', quantity: 30 }, + { plantId: 'plant_456', quantity: 15 }, + { plantId: 'plant_789', quantity: 22 } + ] +}); +console.log(`Updated ${batchResult.updated.length} plants`); +``` + + +### Inventory history tracking + +View all changes to understand inventory patterns: + + +```python Python +# Get inventory history +history = client.inventory.get_history( + plant_id=plant.id, + limit=10 +) + +for event in history: + print(f"{event.timestamp}: {event.change:+d} units - {event.reason}") +``` + +```typescript TypeScript +// Get inventory history +const history = await client.inventory.getHistory({ + plantId: plant.id, + limit: 10 +}); + +history.forEach(event => { + console.log(`${event.timestamp}: ${event.change:+d} units - ${event.reason}`); +}); +``` + + diff --git a/fern/docs/pages/tutorials/searching-plants.mdx b/fern/docs/pages/tutorials/searching-plants.mdx new file mode 100644 index 0000000..3416ff4 --- /dev/null +++ b/fern/docs/pages/tutorials/searching-plants.mdx @@ -0,0 +1,215 @@ +--- +title: Searching for plants +subtitle: Learn how to search and filter your plant catalog +slug: searching-plants +--- + +This guide shows you how to search for plants in your catalog using filters and tags to find exactly what you need. + +## Using the Plant Search API + + + + +[Create an API key in your dashboard](https://plantstore.com/settings/api-keys), which you'll use to authenticate your requests. + +Store the key securely and pass it to the SDK either as an environment variable via a `.env` file, or directly in your app's configuration. + +```bash title=".env" +PLANT_STORE_API_KEY=your_api_key_here +``` + + + + + + +```bash Python +pip install plantstore-sdk +pip install python-dotenv +``` + +```bash TypeScript +npm install @plantstore/sdk +npm install dotenv +``` + +```bash Go +go get github.com/plantstore/plantstore-go +``` + + + + + + +Create a new file named `search_plants.py`, `search_plants.ts`, or `main.go` and add the following code: + + +```python Python +# search_plants.py +import os +from dotenv import load_dotenv +from plantstore import PlantStoreClient + +load_dotenv() + +client = PlantStoreClient( + api_key=os.getenv("PLANT_STORE_API_KEY") +) + +# Search for available plants +plants = client.plants.search(status="available") + +print(f"Found {len(plants)} available plants:") +for plant in plants[:5]: + print(f"- {plant.name} (${plant.price})") + +# Search by tags +beginner_plants = client.plants.search( + tags=["beginner-friendly", "low-light"] +) + +print(f"\nBeginner-friendly plants:") +for plant in beginner_plants[:3]: + print(f"- {plant.name}: {', '.join(plant.tags)}") + +# Get a specific plant by ID +plant = client.plants.get(plant_id=plants[0].id) +print(f"\nPlant details:") +print(f"Name: {plant.name}") +print(f"Status: {plant.status}") +print(f"Tags: {', '.join(plant.tags)}") +``` + +```typescript TypeScript +// search_plants.ts +import { PlantStoreClient } from '@plantstore/sdk'; +import 'dotenv/config'; + +const client = new PlantStoreClient({ + apiKey: process.env.PLANT_STORE_API_KEY +}); + +async function searchPlants() { + // Search for available plants + const plants = await client.plants.search({ + status: 'available' + }); + + console.log(`Found ${plants.length} available plants:`); + plants.slice(0, 5).forEach(plant => { + console.log(`- ${plant.name} ($${plant.price})`); + }); + + // Search by tags + const beginnerPlants = await client.plants.search({ + tags: ['beginner-friendly', 'low-light'] + }); + + console.log('\nBeginner-friendly plants:'); + beginnerPlants.slice(0, 3).forEach(plant => { + console.log(`- ${plant.name}: ${plant.tags.join(', ')}`); + }); + + // Get a specific plant by ID + const plant = await client.plants.get({ + plantId: plants[0].id + }); + + console.log('\nPlant details:'); + console.log(`Name: ${plant.name}`); + console.log(`Status: ${plant.status}`); + console.log(`Tags: ${plant.tags.join(', ')}`); +} + +searchPlants(); +``` + +```go Go +// main.go +package main + +import ( + "fmt" + "log" + "os" + "strings" + + "github.com/joho/godotenv" + "github.com/plantstore/plantstore-go" +) + +func main() { + godotenv.Load() + + client := plantstore.NewClient( + plantstore.WithAPIKey(os.Getenv("PLANT_STORE_API_KEY")), + ) + + // Search for available plants + plants, err := client.Plants.Search(&plantstore.PlantSearchRequest{ + Status: "available", + }) + if err != nil { + log.Fatal(err) + } + + fmt.Printf("Found %d available plants:\n", len(plants)) + for i := 0; i < 5 && i < len(plants); i++ { + fmt.Printf("- %s ($%.2f)\n", plants[i].Name, plants[i].Price) + } + + // Search by tags + beginnerPlants, err := client.Plants.Search(&plantstore.PlantSearchRequest{ + Tags: []string{"beginner-friendly", "low-light"}, + }) + if err != nil { + log.Fatal(err) + } + + fmt.Println("\nBeginner-friendly plants:") + for i := 0; i < 3 && i < len(beginnerPlants); i++ { + fmt.Printf("- %s: %s\n", + beginnerPlants[i].Name, + strings.Join(beginnerPlants[i].Tags, ", ")) + } + + // Get a specific plant by ID + plant, err := client.Plants.Get(&plantstore.PlantGetRequest{ + PlantID: plants[0].ID, + }) + if err != nil { + log.Fatal(err) + } + + fmt.Println("\nPlant details:") + fmt.Printf("Name: %s\n", plant.Name) + fmt.Printf("Status: %s\n", plant.Status) + fmt.Printf("Tags: %s\n", strings.Join(plant.Tags, ", ")) +} +``` + + + + + + + +```bash Python +python search_plants.py +``` + +```bash TypeScript +npx tsx search_plants.ts +``` + +```bash Go +go run main.go +``` + + +You should see a list of available plants, beginner-friendly options, and detailed information about a specific plant. + + + diff --git a/fern/docs/pages/welcome.mdx b/fern/docs/pages/welcome.mdx index 07be66b..199fd3d 100644 --- a/fern/docs/pages/welcome.mdx +++ b/fern/docs/pages/welcome.mdx @@ -1,39 +1,76 @@ --- -title: Welcome to our developer documentation -subtitle: Get started with the Plant Store API +title: Welcome to Plant Store API +subtitle: Everything you need to build plant retail experiences slug: welcome -description: Here you'll find information to get started, as well as a sample API Reference generated by Fern from an OpenAPI specification file. --- -Welcome to the Plant Store API docs! This site demonstrates how to use Fern to generate API documentation from an OpenAPI file. You can [use this site template](https://github.com/fern-api/docs-starter-openapi) as a starting point for your own API documentation. +The Plant Store API provides a complete platform for building plant retail applications. From catalog management and inventory tracking to order processing and customer relationships, our API handles the complexity so you can focus on creating great experiences. -## Getting Started +## Quick links -Here you'll find information about managing your plants, customers, and orders for your plant shop. - - - + + + Understand what you can build with the Plant Store API + + title="Quickstart" + icon="duotone rocket" + href="/quickstart" + > + Make your first API request in minutes + + title="Tutorials" + icon="duotone book-sparkles" + href="/searching-plants" + > + Step-by-step guides for common workflows + + title="API Reference" + icon="duotone code" + href="/api-reference" + > + Complete endpoint documentation and schemas + +## Core capabilities + +Build complete plant retail operations with these integrated capabilities: + +| Capability | What you can do | +|------------|-----------------| +| **Plant management** | Organize your catalog with categories, tags, and rich metadata | +| **Order processing** | Handle the complete lifecycle from cart to delivery | +| **Customer management** | Build relationships with profiles, preferences, and history | +| **Inventory tracking** | Maintain accurate stock with real-time updates and alerts | + + +New to the Plant Store API? Start with the [Overview](/overview) to understand the platform, then follow the [Quickstart](/quickstart) to make your first API call. + + +## What you can build + +- **E-commerce websites** - Online storefronts with real-time inventory and checkout +- **Mobile applications** - Native iOS and Android shopping experiences +- **Inventory systems** - Multi-location stock tracking and management +- **Admin dashboards** - Internal tools for catalog and order management + ## Get support -Want to get in touch with the Fern team? Open an issue on [GitHub](https://github.com/fern-api/docs-starter-openapi/issues/new) or reach out to us via [email](mailto:support+plantstore@buildwithfern.com). We're here to help! +Have questions or need help? We're here for you: + +- **Documentation issues** - [Open an issue on GitHub](https://github.com/fern-api/docs-starter-openapi/issues) +- **General support** - [Email our team](mailto:support+plantstore@buildwithfern.com) +- **Community** - [Join our Slack](https://join.slack.com/t/fern-community/shared_invite/zt-2q7ev4mki-mhO5anKslwRowp4oExWf4A) + +--- + + +This is a demonstration of documentation built with [Fern](https://buildwithfern.com). You can [use this template](https://github.com/fern-api/docs-starter-openapi) as a starting point for your own API documentation. +