{"openapi":"3.0.3","info":{"title":"EnsureBack Public API","version":"0.1.0","description":"EnsureBack Public API. Merchants use this to create protected Stripe Checkout sessions with a policy snapshot."},"servers":[{"url":"https://ensureback.com"}],"tags":[{"name":"Public","description":"Public merchant-facing API"},{"name":"Platform-held Payments","description":"Supported platform-held payment integration status and lifecycle APIs"}],"components":{"securitySchemes":{"EnsureBackApiKey":{"type":"apiKey","in":"header","name":"x-ensureback-api-key","description":"Public API key provided by EnsureBack merchant dashboard. Send as header: x-ensureback-api-key: <key>"}},"schemas":{"ProtectedCheckoutLineItem":{"type":"object","required":["price","quantity"],"properties":{"price":{"type":"string","description":"Stripe Price ID (price_...)","example":"price_123"},"quantity":{"type":"integer","minimum":1,"example":1}},"additionalProperties":false},"ProtectedCheckoutCreateRequest":{"type":"object","required":["successUrl","cancelUrl","lineItems"],"properties":{"successUrl":{"type":"string","description":"Where to redirect after successful payment","example":"https://merchant.com/success"},"cancelUrl":{"type":"string","description":"Where to redirect after canceled payment","example":"https://merchant.com/cancel"},"lineItems":{"type":"array","items":{"$ref":"#/components/schemas/ProtectedCheckoutLineItem"}},"orderRef":{"type":"string","nullable":true,"description":"Merchant order reference (optional)","example":"ORDER-1001"},"customerEmail":{"type":"string","nullable":true,"description":"Prefill customer email in Stripe Checkout (optional)","example":"buyer@example.com"},"policyId":{"type":"string","nullable":true,"description":"Optional. If omitted, EnsureBack resolves merchant's active policy (or website policy).","example":"pol_abc"},"websiteDomain":{"type":"string","nullable":true,"description":"Optional override domain for whitelist check. If omitted, EnsureBack uses request origin/referer.","example":"9002-firebase-studio-1762263429653.cluster-6aufaxcfanfh2quaz7stglulic.cloudworkstations.dev"}},"additionalProperties":false},"ProtectedCheckoutCreateResponse":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true},"merchantId":{"type":"string","example":"fzqy9XSAWCWYsXbiucfzwyYnCdV2"},"stripeAccountId":{"type":"string","example":"acct_123"},"website":{"type":"object","properties":{"id":{"type":"string","example":"site_123"},"domain":{"type":"string","example":"example.com"},"name":{"type":"string","example":"My Store"}}},"policy":{"type":"object","properties":{"policyId":{"type":"string","example":"pol_abc"},"version":{"type":"integer","example":3},"snapshotId":{"type":"string","example":"polsnap_001"},"holdDays":{"type":"integer","example":7}}},"sessionId":{"type":"string","example":"cs_test_123"},"checkoutUrl":{"type":"string","nullable":true,"example":"https://checkout.stripe.com/c/pay/cs_test_123"},"error":{"type":"string","nullable":true},"message":{"type":"string","nullable":true}}},"ErrorResponse":{"type":"object","required":["ok","error"],"properties":{"ok":{"type":"boolean","example":false},"error":{"type":"string","example":"unauthorized"},"message":{"type":"string","example":"Invalid API key"},"details":{"type":"object","nullable":true}}}}},"security":[{"EnsureBackApiKey":[]}],"paths":{}}