budtags/skills/leaflink/SKILL.md
Use this skill when working with LeafLink wholesale marketplace integration, managing orders, syncing inventory/products, or handling customer/company data from LeafLink.
npx skillsauth add jwilly246/budtags-claude-plugin leaflinkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
You are now equipped with comprehensive knowledge of the complete LeafLink Marketplace V2 API via modular category files, scenario templates, and pattern guides. This skill uses progressive disclosure to load only the information relevant to your task.
When the user asks about LeafLink integration, you can:
This skill has access to 9 category files, 4-6 scenario templates, and 6 pattern files:
Core Operations:
categories/orders.md - 21 endpoints (order management, transitions, line items)categories/products.md - 24 endpoints (CRUD, batches, categories, images, strains)categories/customers.md - 22 endpoints (CRUD, statuses, tiers, relationships)categories/inventory.md - 20 endpoints (items, facilities, retailer inventory)Organization & Relationships:
categories/companies.md - 10 endpoints (profiles, staff, brands, licenses)categories/crm.md - 12 endpoints (contacts, activity tracking)Additional Features:
categories/promotions.md - 5 endpoints (promo codes, discounts)categories/reports.md - 3 endpoints (report generation, downloads)Inbound Events:
categories/webhooks.md - 2 event types (order, product), HMAC-SHA256 signing, envelope shape, cascade behaviors, receiver-design blueprint. Empirically validated 2026-04-14 — load this whenever implementing or debugging the webhook receiver; the public LeafLink docs omit critical field pathsscenarios/order-workflow.md - Complete order lifecycle managementscenarios/product-sync-workflow.md - Product catalog synchronizationscenarios/inventory-workflow.md - Inventory tracking and updatesscenarios/customer-workflow.md - Customer relationship managementpatterns/authentication.md - API key setup, headers, token typespatterns/company-scoping.md - Seller vs buyer context (CRITICAL!)patterns/pagination.md - Offset-based pagination (limit/offset)patterns/filtering.md - Filter syntax (__gte, __lte, __in, __icontains, etc.)patterns/date-formats.md - ISO 8601 requirements, common date fieldspatterns/error-handling.md - HTTP codes, trailing slash errors, retry strategiesschemas/ directory - 9 OpenAPI JSON files with complete endpoint detailsENTITY_TYPES.md - TypeScript type reference for all LeafLink entities.claude/docs/marketplace/pricing.md - Currency conversion for order line items (cents vs dollars)ALWAYS determine company type before recommending endpoints.
LeafLink operations are scoped to company context. Different company types access different endpoints:
Full Access To:
/orders-received/*)/products/*, /product-lines/*, /strains/*)/customers/*, /customer-statuses/*, /customer-tiers/*)/inventory-items/*, /facilities/*)/companies/*, /brands/*)/contacts/*, /activity-entries/*)Typical Workflows:
Load These Categories:
categories/orders.md (orders-received endpoints)categories/products.mdcategories/customers.mdcategories/inventory.mdFull Access To:
/buyer/orders/*)/retailer-inventory/*)Typical Workflows:
Load These Categories:
categories/orders.md (buyer/orders endpoints)categories/inventory.md (retailer inventory focus)categories/companies.md✅ Seller (Brand/Manufacturer): Manages products, receives orders, ships to buyers
✅ Buyer (Retailer/Dispensary): Places orders, receives deliveries, manages retail inventory
⚠️ API keys are tied to ONE company
⚠️ All operations return data for that company only
⚠️ Orders: Sellers see "orders-received", Buyers see "buyer/orders"
IMPORTANT: Only load files relevant to the user's question. DO NOT load all categories.
Ask the user or determine from context:
"What LeafLink API task are you working on? Please provide:
Determine scope:
User asks: "How do I fetch and process incoming orders?"
Load:
scenarios/order-workflow.md (complete workflow guide)categories/orders.md (endpoint details)patterns/filtering.md (IF date range or status filtering needed)patterns/pagination.md (IF fetching multiple pages)Context: ~250-350 lines (60% reduction from loading all docs)
User asks: "What's the request format for POST /orders-received/{id}/transition/accept/?"
Load:
categories/orders.md (endpoints + descriptions)schemas/openapi-orders.json (full details)scenarios/order-workflow.md (IF workflow context needed)Context: ~100-200 lines (75% reduction)
User asks: "What's the difference between seller and buyer order endpoints?"
Load:
patterns/company-scoping.md (complete company context explanation)categories/orders.md (to show endpoint differences)Context: ~120 lines (80% reduction)
User asks: "How do I filter orders by date range?"
Load:
patterns/filtering.md (filtering patterns + examples)patterns/date-formats.md (IF date format questions arise)Context: ~80 lines (85% reduction)
When answering:
User: "How do I fetch orders from LeafLink and filter by status?"
Your Response:
To fetch orders with status filtering, use the GET /orders-received/ endpoint with status filters.
Let me load the order workflow guide for you...
[Load scenarios/order-workflow.md]
[Load patterns/filtering.md for filter syntax]
**Workflow**:
1. Authenticate with API key
2. Fetch orders with status filter: GET /orders-received/?status=confirmed
3. Handle pagination for large result sets
**Laravel Example**:
[Show code from scenario file]
**Company Compatibility**: Seller companies only (buyers use /buyer/orders/)
**Pattern References**: scenarios/order-workflow.md, patterns/filtering.md
Would you like to see how to transition order status after fetching?
User: "Can buyer companies access the /orders-received/ endpoint?"
Your Response:
NO. Buyer companies CANNOT access /orders-received/ endpoints.
[Load patterns/company-scoping.md for complete details]
**Seller companies (Brands/Manufacturers) CAN access**:
- /orders-received/* (incoming orders from buyers)
- /products/* (manage catalog)
- /customers/* (customer relationships)
**Buyer companies (Retailers/Dispensaries) SHOULD use**:
- /buyer/orders/* (outgoing orders to sellers)
- /retailer-inventory/* (retail inventory tracking)
Attempting to call /orders-received/ with a buyer API key will result in:
- No data returned (empty results)
- Or HTTP 403 Forbidden
**Pattern Reference**: patterns/company-scoping.md
Would you like to see buyer-specific order endpoints instead?
User: "Show me the request format for POST /products/"
Your Response:
The POST /products/ endpoint creates a new product in your catalog.
[Load categories/products.md for endpoint list]
[Read schemas/openapi-products-core.json for exact format]
**Endpoint**: POST /products/
**Company Compatibility**: Seller companies only
**Required Fields**: name, category, company
**Request Body**:
[Show exact JSON structure from schema file]
**Laravel Example**:
[Show code implementation]
**IMPORTANT**: Don't forget the trailing slash! `/products/` not `/products`
**Pattern References**:
- categories/products.md
- patterns/error-handling.md (for trailing slash requirement)
Would you like to see how to upload product images after creation?
User: "How should I handle LeafLink pagination?"
Your Response:
LeafLink uses offset-based pagination with limit and offset query parameters.
[Load patterns/pagination.md]
**Standard Pattern**:
- limit: Number of results per page (default: 50, max: 100)
- offset: Starting position (0-indexed)
- Response includes: count, next, previous, results
**Laravel Example**:
[Show iteration code from pattern file]
**Pattern Reference**: patterns/pagination.md
Would you like to see this applied to fetching all orders?
✅ Seller (Brand/Manufacturer):
- /orders-received/* (incoming orders)
- /products/*, /product-lines/*, /strains/* (catalog management)
- /customers/* (customer relationships)
- /inventory-items/* (seller inventory)
✅ Buyer (Retailer/Dispensary):
- /buyer/orders/* (outgoing orders)
- /retailer-inventory/* (retail inventory)
- Limited product access (browsing only)
⚠️ API keys are company-scoped - you only see YOUR company's data
⚠️ Orders: Sellers see "orders-received", Buyers see "buyer/orders"
✅ ALL endpoint paths MUST end with trailing slash `/` (CRITICAL!)
✅ Date format: ISO 8601 (2025-01-15 or 2025-01-15T10:30:00Z)
✅ Pagination: Use limit and offset query params
✅ Filtering: Use Django-style filters (__gte, __lte, __in, __icontains)
✅ Content-Type: application/json for POST/PATCH requests
✅ Authorization: App {API_KEY} header format
❌ Forgetting trailing slash (returns 400 Bad Request)
❌ Using wrong filter syntax (e.g., date> instead of date__gt)
❌ Not understanding company scoping (seeing no data)
❌ Not paginating large result sets (missing data)
❌ Using wrong date format (must be ISO 8601)
❌ Not clearing cache after bulk updates
Help users successfully integrate with LeafLink API by:
You have complete knowledge of all 117+ LeafLink API v2 endpoints via modular, focused files. Use progressive disclosure to provide fast, relevant answers!
testing
Comprehensive Redis 7.x reference with BudTags-specific patterns. Covers all commands, data types, persistence, memory optimization, performance tuning, high availability, security, and Laravel integration.
development
React 19 changes, new hooks, Actions, Activity component, and migration guides for upgrading from React 18
development
Use this skill when working with Quill.js rich text editor - API methods, configuration, modules, Delta format, and custom implementations.
testing
Use this skill when working with QuickBooks Online integration, OAuth authentication, creating invoices, managing customers, handling payments, or syncing with Metrc data.