{"openapi":"3.1.0","info":{"title":"UGCPouch API","version":"0.1.0","description":"Phase 1 escrow API. Stripe Connect holds funds, KYC, and payouts. This Worker mirrors state and never keeps a withdrawable balance of its own. Test-mode keys only while LIVE_MONEY_ENABLED is false."},"servers":[{"url":"https://ugcpouch.dev","description":"Sandbox / API"}],"tags":[{"name":"meta"},{"name":"sellers"},{"name":"escrows"},{"name":"disputes"},{"name":"webhooks"}],"paths":{"/health":{"get":{"tags":["meta"],"summary":"Liveness and money-mode gate","responses":{"200":{"description":"Ready"},"503":{"description":"Test key missing or invalid"}}}},"/openapi.json":{"get":{"tags":["meta"],"summary":"OpenAPI document","responses":{"200":{"description":"OK"}}}},"/llms.txt":{"get":{"tags":["meta"],"summary":"Agent-readable summary","responses":{"200":{"description":"OK"}}}},"/v1/config":{"get":{"tags":["meta"],"summary":"Publishable key and fee (test mode only)","responses":{"200":{"description":"OK"},"503":{"description":"Not ready"}}}},"/v1/sellers/onboard":{"post":{"tags":["sellers"],"summary":"Start US Express (Accounts v2) onboarding. Minors require a guardian attestation.","parameters":[{"name":"X-Pouch-User","in":"header","required":true,"schema":{"type":"string"}},{"name":"X-Pouch-App","in":"header","required":true,"schema":{"type":"string","enum":["verifyugc","ugcmarket","ugcadaptr","pouch"]}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contactEmail","dateOfBirth"],"properties":{"contactEmail":{"type":"string"},"displayName":{"type":"string"},"dateOfBirth":{"type":"string","description":"YYYY-MM-DD"},"country":{"type":"string","enum":["US"]},"returnUrl":{"type":"string"},"refreshUrl":{"type":"string"},"guardian":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"attestation":{"type":"boolean"}}}}}}}},"responses":{"201":{"description":"Onboarding link"},"403":{"description":"Guardian required"}}}},"/v1/sellers/me":{"get":{"tags":["sellers"],"summary":"Seller Connect status","responses":{"200":{"description":"OK"}}}},"/v1/escrows":{"post":{"tags":["escrows"],"summary":"Create a manual-capture PaymentIntent hold for a ready seller","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["sellerUserId","amountCents"],"properties":{"sellerUserId":{"type":"string"},"amountCents":{"type":"integer","minimum":50},"description":{"type":"string"}}}}}},"responses":{"201":{"description":"Created, includes clientSecret"}}}},"/v1/escrows/{id}":{"get":{"tags":["escrows"],"summary":"Get escrow (parties only)","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"}}}},"/v1/escrows/{id}/deliver":{"post":{"tags":["escrows"],"summary":"Seller marks delivery; starts buyer accept deadline","responses":{"200":{"description":"OK"}}}},"/v1/escrows/{id}/accept":{"post":{"tags":["escrows"],"summary":"Buyer accepts delivery and releases funds","responses":{"200":{"description":"OK"}}}},"/v1/escrows/{id}/release":{"post":{"tags":["escrows"],"summary":"Capture the hold and transfer seller payout minus the flat fee","responses":{"200":{"description":"OK"}}}},"/v1/escrows/{id}/refund":{"post":{"tags":["escrows"],"summary":"Cancel or refund the hold","responses":{"200":{"description":"OK"}}}},"/v1/escrows/{id}/dispute":{"post":{"tags":["disputes"],"summary":"Open a dispute","responses":{"201":{"description":"Created"}}}},"/v1/disputes":{"post":{"tags":["disputes"],"summary":"Open a dispute by escrow id","responses":{"201":{"description":"Created"}}}},"/v1/disputes/{id}/evidence":{"post":{"tags":["disputes"],"summary":"Add evidence","responses":{"200":{"description":"OK"}}}},"/v1/admin/disputes/{id}/resolve":{"post":{"tags":["disputes"],"summary":"Sky's final say. Requires X-Admin-Key. Audit-logged.","parameters":[{"name":"X-Admin-Key","in":"header","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["decision"],"properties":{"decision":{"type":"string","enum":["release","refund","split"]},"note":{"type":"string"},"split":{"type":"object","properties":{"buyerCents":{"type":"integer"},"sellerCents":{"type":"integer"}}}}}}}},"responses":{"200":{"description":"Resolved"}}}},"/v1/webhooks/stripe":{"post":{"tags":["webhooks"],"summary":"Stripe Connect webhook. Verifies Stripe-Signature with STRIPE_CONNECT_WEBHOOK_SECRET.","responses":{"200":{"description":"OK"},"400":{"description":"Bad signature"}}}}}}