{"openapi":"3.1.1","info":{"title":"Skillflower API","version":"v1","description":"仅面向中国大陆普通 Skill 的鲜花赠礼 API。地址固定为 CN，金额固定为 CNY，支付仅支持浏览器微信 Native。所有受保护接口使用 Bearer API Key，并且 sender、receiver、event、checkout、payment 与 order 仅对创建它们的安装可见；跨安装资源按不存在处理。Agent 注册接口可接受空请求体，并自动从请求头和服务运行环境补齐元数据。"},"servers":[{"url":"/","description":"Current deployment"}],"tags":[{"name":"Senders","description":"赠送者档案"},{"name":"Receivers","description":"收花人及地址"},{"name":"Events","description":"赠花场景和提醒"},{"name":"Recommendations","description":"花礼推荐"},{"name":"Checkout","description":"结算与支付"},{"name":"Orders","description":"订单查询"},{"name":"Agent","description":"Agent 注册与支持"}],"paths":{"/api/v1/senders":{"post":{"summary":"创建赠送者","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Senders"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderInput"}}}}}},"/api/v1/senders/{senderId}":{"get":{"summary":"获取赠送者","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Senders"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"summary":"更新赠送者","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Senders"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SenderPatch"}}}}},"delete":{"summary":"删除赠送者","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Senders"],"parameters":[{"name":"senderId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/receivers":{"get":{"summary":"按赠送者列出收花人","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Receivers"],"parameters":[{"name":"senderId","in":"query","required":true,"schema":{"type":"string"}}]},"post":{"summary":"创建收花人","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Receivers"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiverInput"}}}}}},"/api/v1/receivers/{receiverId}":{"get":{"summary":"获取收花人","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Receivers"],"parameters":[{"name":"receiverId","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"summary":"更新收花人","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Receivers"],"parameters":[{"name":"receiverId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReceiverPatch"}}}}},"delete":{"summary":"删除收花人","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Receivers"],"parameters":[{"name":"receiverId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/receiver-events":{"get":{"summary":"按收花人列出事件","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Events"],"parameters":[{"name":"receiverId","in":"query","required":true,"schema":{"type":"string"}}]},"post":{"summary":"创建赠花事件","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Events"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventInput"}}}}}},"/api/v1/receiver-events/{eventId}":{"get":{"summary":"获取赠花事件","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string"}}]},"patch":{"summary":"更新赠花事件","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventPatch"}}}}},"delete":{"summary":"删除赠花事件","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Events"],"parameters":[{"name":"eventId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/products/recommend":{"post":{"summary":"生成花礼推荐","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendationResponse"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Recommendations"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecommendationRequest"}}}}}},"/api/v1/checkout-sessions":{"post":{"summary":"创建结算会话","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Checkout"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutInput"}}}}}},"/api/v1/checkout-sessions/{sessionId}":{"get":{"summary":"获取结算会话","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Checkout"],"parameters":[{"name":"sessionId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/orders":{"get":{"summary":"按赠送者列出订单","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PublicOrder"}}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Cached fulfillment state is inconsistent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Orders"],"parameters":[{"name":"senderId","in":"query","required":true,"schema":{"type":"string"}}]}},"/api/v1/orders/{orderId}":{"get":{"summary":"获取订单","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicOrder"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"Cached fulfillment state is inconsistent","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Orders"],"parameters":[{"name":"orderId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/orders/validate":{"post":{"summary":"校验 Agent 订单条件","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Orders","Agent"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentContext"}}}}}},"/api/v1/agents/register":{"post":{"summary":"注册 Agent 并取得安装凭据","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Installation credentials cannot be recovered","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agent"],"security":[],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentRegistration"}}}},"description":"每个 fingerprint 只签发一次 Bearer key。服务端不保存可恢复的 key；重复 fingerprint 返回 409，客户端必须改用新的 fingerprint 重新注册。"}},"/api/v1/payment-sessions":{"post":{"summary":"创建 Agent 支付会话","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Checkout","Agent"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentSessionInput"}}}}}},"/api/v1/payment-sessions/{paymentSessionId}":{"get":{"summary":"获取 Agent 支付会话","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Checkout","Agent"],"parameters":[{"name":"paymentSessionId","in":"path","required":true,"schema":{"type":"string"}}]}},"/api/v1/payments/callback/wechat":{"post":{"summary":"微信支付回调","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Checkout"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object"}}}}}},"/api/v1/support-info":{"get":{"summary":"获取人工支持渠道","responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object"}}}},"400":{"description":"Invalid request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"tags":["Agent"]}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Key","description":"Bearer key 同时标识稳定安装身份；受保护资源只在该安装内可见。"}},"schemas":{"Error":{"type":"object","required":["error"],"properties":{"error":{"type":"string","example":"Invalid receiver payload"}}},"SenderInput":{"type":"object","required":["displayName","description","senderMobile"],"properties":{"displayName":{"type":"string","example":"王小明"},"description":{"type":"string","example":"偏爱简约花束"},"senderMobile":{"type":"string","example":"13800138000"},"bio":{"type":"string"},"preferences":{"type":"object"},"occupation":{"type":"string"},"gender":{"type":"string"},"address":{"type":"string"}}},"SenderPatch":{"type":"object","properties":{"description":{"type":"string","example":"经常为家人订花"},"senderMobile":{"type":"string","example":"13800138000"}}},"Address":{"type":"object","required":["recipientName","recipientPhone","line1","line2","city","state","district","postalCode","country","deliveryNotes"],"properties":{"recipientName":{"type":"string","example":"李女士"},"recipientPhone":{"type":"string","example":"13800138000"},"line1":{"type":"string","example":"南京西路 100 号"},"line2":{"type":"string","example":"1 号楼 501"},"city":{"type":"string","example":"上海"},"state":{"type":"string","example":"上海市"},"district":{"type":"string","example":"静安区"},"postalCode":{"type":"string","example":"200040"},"country":{"type":"string","enum":["CN"]},"deliveryNotes":{"type":"string","example":"送达前电话联系"}}},"ReceiverInput":{"type":"object","required":["senderId","displayName","description","relationshipToSender","address"],"properties":{"senderId":{"type":"string"},"displayName":{"type":"string"},"description":{"type":"string"},"relationshipToSender":{"type":"string","example":"母亲"},"address":{"$ref":"#/components/schemas/Address"}}},"ReceiverPatch":{"type":"object","properties":{"description":{"type":"string"},"address":{"type":"object","required":["district"],"properties":{"city":{"type":"string"},"district":{"type":"string"},"deliveryNotes":{"type":"string"}}}}},"EventInput":{"type":"object","required":["senderId","receiverId","eventType","title","description","date","recurrence","tone","budget","active"],"properties":{"senderId":{"type":"string"},"receiverId":{"type":"string"},"eventType":{"type":"string","example":"birthday"},"title":{"type":"string","example":"生日"},"description":{"type":"string"},"date":{"type":"string","format":"date"},"recurrence":{"type":"string","enum":["none","yearly","monthly"]},"tone":{"type":"string","example":"warm"},"budget":{"type":"number","example":300},"active":{"type":"boolean","example":true}}},"EventPatch":{"type":"object","properties":{"date":{"type":"string","format":"date"},"budget":{"type":"number"},"active":{"type":"boolean"}}},"RecommendationRequest":{"type":"object","required":["senderId","receiverId","eventId","budget","tone"],"properties":{"senderId":{"type":"string"},"receiverId":{"type":"string"},"eventId":{"type":"string"},"budget":{"type":"number","example":300},"tone":{"type":"string","example":"warm"}}},"CheckoutInput":{"type":"object","required":["senderId","receiverId","eventId","selectedProductId","budget"],"properties":{"senderId":{"type":"string"},"receiverId":{"type":"string"},"eventId":{"type":"string"},"selectedProductId":{"type":"string"},"budget":{"type":"number"}}},"AgentContext":{"type":"object","required":["occasion"],"properties":{"query":{"type":"string"},"sender":{"type":"object","properties":{"senderMobile":{"type":"string"}}},"receiver":{"type":"object","properties":{"address":{"type":"object","required":["country"],"properties":{"recipientName":{"type":"string"},"recipientPhone":{"type":"string"},"line1":{"type":"string"},"city":{"type":"string"},"province":{"type":"string"},"district":{"type":"string"},"postalCode":{"type":"string"},"country":{"type":"string","enum":["CN"]}}}}},"occasion":{"type":"object","required":["eventType","currency"],"properties":{"eventType":{"type":"string"},"budget":{"type":"number"},"currency":{"type":"string","enum":["CNY"]}}},"delivery":{"type":"object","required":["country"],"properties":{"province":{"type":"string"},"city":{"type":"string"},"country":{"type":"string","enum":["CN"]}}}}},"RecommendedProduct":{"type":"object","required":["id","name","currency"],"properties":{"id":{"type":"string"},"name":{"type":"string"},"imageUrl":{"type":"string","format":"uri"},"price":{"type":"number"},"currency":{"type":"string","enum":["CNY"]}}},"RecommendationResponse":{"type":"object","required":["primary","backups","currency"],"properties":{"primary":{"$ref":"#/components/schemas/RecommendedProduct"},"backups":{"type":"array","items":{"$ref":"#/components/schemas/RecommendedProduct"}},"currency":{"type":"string","enum":["CNY"]}}},"AgentRegistration":{"type":"object","description":"所有字段可选。缺省值从 X-Agent-Fingerprint、User-Agent、Client Hints 与服务运行环境推断。每个 fingerprint 仅签发一次凭据；Bearer key 丢失后不能用 fingerprint 恢复，必须使用新的 fingerprint 重新注册。","properties":{"fingerprint":{"type":"string","description":"客户端生成并持久化；重复提交不会恢复或重发既有 Bearer key。"},"agent":{"type":"object","properties":{"name":{"type":"string"},"hostPlatform":{"type":"string"},"version":{"type":"string"}}},"runtime":{"type":"object","properties":{"platform":{"type":"string"},"arch":{"type":"string"},"workspacePath":{"type":"string"},"ci":{"type":"boolean"}}}},"example":{}},"PaymentSessionInput":{"type":"object","required":["checkoutSessionId","paymentMethod"],"properties":{"checkoutSessionId":{"type":"string"},"paymentMethod":{"type":"string","enum":["wechat_native"]}}},"CanceledProvider":{"type":"object","additionalProperties":false,"required":["name","mode","orderId","orderSn","rawStatus","normalizedStatus","lastSyncedAt"],"properties":{"name":{"type":"string","enum":["huawa"]},"mode":{"type":"string","enum":["draft"]},"orderId":{"type":"string","minLength":1},"orderSn":{"type":"string","minLength":1},"rawStatus":{"type":"string","const":"主动取消"},"normalizedStatus":{"type":"string","const":"canceled"},"lastSyncedAt":{"type":"string","format":"date-time"}}},"PublicOrder":{"type":"object","additionalProperties":false,"description":"订单查询只读取本地 SQLite 缓存，不触发供应商请求。provider_draft_created 仅表示花娃待发布草稿，不表示购买、接单或配送。canceled 表示缓存中已观察到供应商主动取消，不表示退款或结算结果。not_started 仅表示旧订单没有本地 provider/outbox 记录，不是花娃结果、排队或失败。","required":["id","senderId","receiverId","eventId","checkoutSessionId","bouquetName","deliveryDate","status","payment","fulfillment","provider","createdAt","updatedAt"],"allOf":[{"if":{"properties":{"fulfillment":{"properties":{"status":{"const":"canceled"}},"required":["status"]}},"required":["fulfillment"]},"then":{"properties":{"provider":{"$ref":"#/components/schemas/CanceledProvider"}}}},{"if":{"properties":{"provider":{"type":"object","properties":{"normalizedStatus":{"const":"canceled"}},"required":["normalizedStatus"]}},"required":["provider"]},"then":{"properties":{"fulfillment":{"properties":{"status":{"const":"canceled"}},"required":["status"]},"provider":{"$ref":"#/components/schemas/CanceledProvider"}}}}],"properties":{"id":{"type":"string"},"senderId":{"type":"string"},"receiverId":{"type":"string"},"eventId":{"type":"string"},"checkoutSessionId":{"type":"string"},"bouquetName":{"type":"string"},"deliveryDate":{"type":"string","format":"date"},"status":{"type":"string","enum":["paid"]},"payment":{"type":"object","additionalProperties":false,"required":["status","source"],"properties":{"status":{"type":"string","enum":["paid"]},"source":{"type":"string","enum":["wechat","simulated"]}}},"fulfillment":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"type":"string","enum":["not_started","queued","submitting","provider_draft_created","canceled","submission_unknown","failed"]},"lastError":{"type":"string","enum":["FULFILLMENT_CONFIRMATION_FAILED","FULFILLMENT_IDENTITY_CONFLICT","FULFILLMENT_SUBMISSION_FAILED","FULFILLMENT_INVALID_STATE","FULFILLMENT_SUBMISSION_UNKNOWN","FULFILLMENT_SYNC_FAILED","FULFILLMENT_UNSAFE_PROVIDER_STATE"],"description":"可选的供应商无关公开履约错误代码；不包含内部供应商标识或原始错误文本。"}}},"provider":{"anyOf":[{"type":"null"},{"type":"object","additionalProperties":false,"required":["name","mode","normalizedStatus"],"properties":{"name":{"type":"string","enum":["huawa"]},"mode":{"type":"string","enum":["draft"]},"orderId":{"type":"string"},"orderSn":{"type":"string"},"rawStatus":{"type":"string"},"normalizedStatus":{"type":"string","enum":["queued","submitting","provider_draft_created","submission_unknown","failed"]},"lastSyncedAt":{"type":"string","format":"date-time"}}},{"$ref":"#/components/schemas/CanceledProvider"}]},"createdAt":{"type":"string","format":"date-time"},"updatedAt":{"type":"string","format":"date-time"}}}}},"security":[{"bearerAuth":[]}]}