{"openapi":"3.1.0","info":{"title":"POST /api/v1/onboarding/prepare-checkout","version":"1.0.0","description":"Create Stripe Checkout session for onboarding"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/onboarding/prepare-checkout":{"post":{"tags":["onboarding"],"summary":"Create Stripe Checkout session for onboarding","description":"Collects plan and add-on selections, creates a Stripe Checkout session with a 30-day trial. Business is NOT created until /complete is called.","operationId":"prepare_checkout_api_v1_onboarding_prepare_checkout_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareCheckoutRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrepareCheckoutResponse"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"detail":"Invalid request parameters"}}}},"409":{"description":"Conflict - Resource already exists","content":{"application/json":{"example":{"detail":"Resource already exists"}}}},"429":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"example":{"detail":"Rate limit exceeded"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PrepareCheckoutRequest":{"properties":{"account_type":{"type":"string","pattern":"^(self-managed|dz-managed|advisory-firm)$","title":"Account Type","description":"'self-managed', 'dz-managed', or 'advisory-firm'"},"business_name":{"type":"string","maxLength":255,"minLength":1,"title":"Business Name"},"mailbox":{"type":"string","maxLength":100,"minLength":1,"title":"Mailbox"},"default_currency":{"type":"string","maxLength":3,"title":"Default Currency","description":"Default business currency. Supported out of the box: USD, CAD, AUD, EUR, GBP.","default":"USD"},"tax_year_end_month":{"type":"integer","maximum":12.0,"minimum":1.0,"title":"Tax Year End Month","default":12},"selected_addons":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":50},{"type":"null"}],"title":"Selected Addons","description":"Optional list of addon slugs to include on the Stripe Checkout. Capped at 50 entries."},"trial_agreed":{"type":"boolean","const":true,"title":"Trial Agreed","description":"User has agreed to the 30-day free trial terms"},"firm_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Firm Name"},"firm_plan_tier":{"anyOf":[{"type":"string","pattern":"^(firm_starter|firm_professional|firm_enterprise)$"},{"type":"null"}],"title":"Firm Plan Tier","description":"Graduated firm plan tier (defaults to firm_starter)"},"ein":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Ein"},"logo_url":{"anyOf":[{"type":"string","maxLength":1024},{"type":"null"}],"title":"Logo Url"},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Address"},"num_full_time_accountants":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Num Full Time Accountants"},"num_part_time_accountants":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Num Part Time Accountants"},"current_tools":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Current Tools"},"success_path":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Success Path","description":"Optional path-only override (no host) to land on after Stripe Checkout. Defaults to /onboarding/complete."},"cancel_path":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Cancel Path","description":"Optional path-only override (no host) for cancelled checkout. Defaults to /welcome."}},"type":"object","required":["account_type","business_name","mailbox","trial_agreed"],"title":"PrepareCheckoutRequest","description":"Prepare a Stripe Checkout session for onboarding.\n\nCollects all onboarding data upfront. The business is NOT created yet --\nit will be created after the user completes Stripe Checkout."},"PrepareCheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["checkout_url","session_id"],"title":"PrepareCheckoutResponse","description":"Response with Stripe Checkout URL."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}