{"openapi":"3.1.0","info":{"title":"Happy Cake Sugar Land — Commerce API","version":"1.0.0","description":"Browse the menu and place orders at Happy Cake, a family cake bakery & cafe in Sugar Land, TX. See /llms.txt for an agent guide.","contact":{"email":"marketing.happycake@gmail.com"}},"servers":[{"url":"https://api.happycake.io","description":"Production API (Cloudflare tunnel)"},{"url":"https://happycake.io","description":"Storefront mirror"}],"paths":{"/api/menu":{"get":{"operationId":"browseMenu","summary":"Get the full catalog (cakes, slices, beverages).","responses":{"200":{"description":"Catalog","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Catalog"}}}}}}},"/api/order":{"post":{"operationId":"createOrder","summary":"Place an order on behalf of a customer.","parameters":[{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string"},"description":"Stable key so retries don't create duplicate orders."}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrder"}}}},"responses":{"200":{"description":"Order accepted (see status field).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResult"}}}},"400":{"description":"Rejected (validation error).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResult"}}}},"429":{"description":"Rate limited (too many orders too fast from this client). Retry after the Retry-After header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResult"}}}}}}},"/api/order/{order_id}":{"get":{"operationId":"getOrderStatus","summary":"Check the status of a previously placed order (PII-free).","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"description":"The order_id returned by createOrder."}],"responses":{"200":{"description":"Order status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderStatus"}}}},"404":{"description":"Unknown order_id."}}}}},"components":{"schemas":{"Catalog":{"type":"object","properties":{"version":{"type":"string"},"currency":{"type":"string"},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"allergen_disclaimer":{"type":"string"}}},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"display_name":{"type":"string"},"category":{"type":"string"},"description":{"type":"string"},"price_usd":{"type":"number"},"price_10inch_usd":{"type":"number"},"price_large_usd":{"type":"number"},"sizes":{"type":"array","items":{"type":"string"}},"allergens":{"type":["array","null"],"items":{"type":"string"},"description":"null = UNKNOWN (not confirmed allergen-free). Assume the item MAY contain common allergens; the facility disclaimer always applies."},"allergens_confirmed":{"type":"boolean","description":"true only when the allergen list is owner-confirmed."},"available":{"type":"boolean"},"lead_time_hours":{"type":"integer"}}},"OrderStatus":{"type":"object","properties":{"ok":{"type":"boolean"},"order_id":{"type":"string"},"status":{"type":"string","enum":["pending","confirmed","needs_approval","held_overnight","duplicate"]},"created_at":{"type":"string"},"fulfillment":{"type":["string","null"]},"datetime":{"type":["string","null"]},"estimated_total_usd":{"type":["number","null"]},"items":{"type":"array","items":{"type":"object"}},"escalation_reasons":{"type":"array","items":{"type":"string"}},"note":{"type":"string"}}},"OrderItem":{"type":"object","required":["sku"],"properties":{"sku":{"type":"string","description":"Canonical SKU from /api/menu, or 'custom'."},"size":{"type":"string","description":"8-inch, 10-inch, regular, large"},"qty":{"type":"integer","minimum":1,"default":1},"notes":{"type":"string"}}},"CreateOrder":{"type":"object","required":["customer","phone","items"],"properties":{"customer":{"type":"string"},"phone":{"type":"string","description":"E.164 preferred, e.g. +18325551234"},"items":{"type":"array","items":{"$ref":"#/components/schemas/OrderItem"}},"fulfillment":{"type":"string","enum":["pickup","delivery"]},"address":{"type":["string","null"]},"datetime":{"type":["string","null"],"description":"ISO 8601"},"allergy_notes":{"type":["string","null"]},"channel":{"type":"string","enum":["web","webchat","voice","sms","whatsapp","ig","fb"],"default":"web"},"estimated_total_usd":{"type":"number"},"idempotency_key":{"type":"string"}}},"OrderResult":{"type":"object","properties":{"status":{"type":"string","enum":["confirmed","needs_approval","held_overnight","duplicate","rejected"]},"order_id":{"type":["string","null"]},"estimated_total_usd":{"type":"number"},"confirmation_text":{"type":"string","description":"Relay verbatim to the customer — carries the mandatory allergen disclaimer."},"error":{"type":"string"},"escalation_reasons":{"type":"array","items":{"type":"string"}}}}}}}