{"openapi":"3.1.0","info":{"title":"This Warm is for Profit API","description":"E-commerce API for the This Warm is for Profit hot chocolate store. Part of the PlatPhorm News network (warm.platphormnews.com).","version":"1.0.0","contact":{"name":"This Warm is for Profit","url":"https://warm.platphormnews.com","email":"hello@warm.platphormnews.com"},"license":{"name":"MIT","url":"https://opensource.org/licenses/MIT"}},"servers":[{"url":"https://warm.platphormnews.com","description":"Production"}],"tags":[{"name":"products","description":"Product catalog operations"},{"name":"orders","description":"Order management"},{"name":"cart","description":"Shopping cart operations"},{"name":"health","description":"Service health monitoring"},{"name":"kanban","description":"Kanban integration for order fulfillment"},{"name":"suppliers","description":"Supplier integrations (greens.platphormnews.com)"},{"name":"sync","description":"Offline data synchronization"}],"paths":{"/api/health":{"get":{"operationId":"getHealth","tags":["health"],"summary":"Health check","responses":{"200":{"description":"Service is healthy","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","example":"healthy"},"service":{"type":"string","example":"warm.platphormnews.com"},"version":{"type":"string","example":"1.0.0"},"timestamp":{"type":"string","format":"date-time"}}}}}}}}},"/api/v1/products":{"get":{"operationId":"listProducts","tags":["products"],"summary":"List all products","parameters":[{"name":"category","in":"query","schema":{"type":"string","enum":["classic","mushroom","sprout"]},"description":"Filter by category"},{"name":"featured","in":"query","schema":{"type":"boolean"},"description":"Filter featured products only"}],"responses":{"200":{"description":"List of products","content":{"application/json":{"schema":{"type":"object","properties":{"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"total":{"type":"integer"}}}}}}}}},"/api/v1/products/{slug}":{"get":{"operationId":"getProduct","tags":["products"],"summary":"Get product by slug","parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Product details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"404":{"description":"Product not found"}}}},"/api/v1/orders":{"post":{"operationId":"createOrder","tags":["orders"],"summary":"Create a new order","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrderRequest"}}}},"responses":{"201":{"description":"Order created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}}}},"/api/v1/orders/{id}":{"get":{"operationId":"getOrder","tags":["orders"],"summary":"Get order by ID","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Order details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}}}}},"/api/v1/kanban/project":{"get":{"operationId":"getKanbanProject","tags":["kanban"],"summary":"Get kanban project info for order fulfillment","responses":{"200":{"description":"Kanban project details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KanbanProject"}}}}}}},"/api/v1/kanban/tasks":{"post":{"operationId":"createKanbanTask","tags":["kanban"],"summary":"Create a fulfillment task in kanban","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateTaskRequest"}}}},"responses":{"201":{"description":"Task created"}}}},"/api/v1/suppliers/greens":{"get":{"operationId":"getGreensSupplier","tags":["suppliers"],"summary":"Get supplier info and ingredient inventory","responses":{"200":{"description":"Supplier details and available ingredients","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplierInfo"}}}}}},"post":{"operationId":"createSupplyOrder","tags":["suppliers"],"summary":"Create a supply order for ingredients","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupplyOrderRequest"}}}},"responses":{"201":{"description":"Supply order created"}}}},"/api/v1/orders/sync":{"post":{"operationId":"syncOfflineOrders","tags":["sync"],"summary":"Sync offline orders from localStorage","description":"Used when device reconnects to sync orders created while offline","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncRequest"}}}},"responses":{"200":{"description":"Sync completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SyncResponse"}}}}}}}},"components":{"schemas":{"Product":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"long_description":{"type":"string"},"price_in_cents":{"type":"integer"},"category":{"type":"string","enum":["classic","mushroom","sprout"]},"image_url":{"type":"string","nullable":true},"ingredients":{"type":"array","items":{"type":"string"}},"benefits":{"type":"array","items":{"type":"string"}},"stock":{"type":"integer"},"featured":{"type":"boolean"}}},"Order":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string","enum":["pending","processing","shipped","delivered","cancelled"]},"total_in_cents":{"type":"integer"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}},"created_at":{"type":"string","format":"date-time"}}},"OrderItem":{"type":"object","properties":{"product_id":{"type":"string"},"product_name":{"type":"string"},"quantity":{"type":"integer"},"price_in_cents":{"type":"integer"}}},"CreateOrderRequest":{"type":"object","required":["email","items"],"properties":{"email":{"type":"string","format":"email"},"items":{"type":"array","items":{"type":"object","properties":{"product_id":{"type":"string"},"quantity":{"type":"integer","minimum":1}}}}}},"KanbanProject":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"columns":{"type":"array","items":{"type":"string"}}}},"CreateTaskRequest":{"type":"object","required":["title","type"],"properties":{"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["procurement","fulfillment","success"]},"order_id":{"type":"string"},"priority":{"type":"string","enum":["low","medium","high"]}}},"SupplierInfo":{"type":"object","properties":{"name":{"type":"string","example":"PlatPhorm Greens"},"domain":{"type":"string","example":"greens.platphormnews.com"},"partnership":{"type":"string"},"ingredients":{"type":"array","items":{"$ref":"#/components/schemas/Ingredient"}}}},"Ingredient":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"price_per_kg":{"type":"number"},"available_kg":{"type":"number"},"organic":{"type":"boolean"}}},"SupplyOrderRequest":{"type":"object","required":["ingredient_id","quantity_kg"],"properties":{"ingredient_id":{"type":"string"},"quantity_kg":{"type":"number","minimum":1},"delivery_date":{"type":"string","format":"date"}}},"SyncRequest":{"type":"object","required":["orders","device_id"],"properties":{"orders":{"type":"array","items":{"$ref":"#/components/schemas/OfflineOrder"}},"device_id":{"type":"string"}}},"OfflineOrder":{"type":"object","properties":{"local_id":{"type":"string"},"email":{"type":"string","format":"email"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}},"created_at":{"type":"string","format":"date-time"}}},"SyncResponse":{"type":"object","properties":{"synced":{"type":"integer"},"failed":{"type":"integer"},"results":{"type":"array","items":{"type":"object","properties":{"local_id":{"type":"string"},"server_id":{"type":"string"},"status":{"type":"string","enum":["synced","failed","duplicate"]}}}}}}}}}