{"openapi":"3.1.0","info":{"title":"POST /api/v1/credit/lines/{credit_line_id}/disclosures","version":"1.0.0","description":"Generate a disclosure now"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/lines/{credit_line_id}/disclosures":{"post":{"tags":["credit"],"summary":"Generate a disclosure now","description":"Generates a disclosure on the line's current terms and limit (`kind`: `offer` or `limit_change`) from the approved template, under the program's policy. Refused when the policy is off or its disclosure mode is `off`, or when no approved template exists. Operator action.","operationId":"credit_create_line_disclosure","parameters":[{"name":"credit_line_id","in":"path","required":true,"schema":{"type":"string","title":"Credit Line Id"}},{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}},{"name":"x-business-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Business-Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisclosureCreateRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditDisclosureResponse_"}}}},"400":{"description":"Bad Request - Invalid input","content":{"application/json":{"example":{"error":"validation_error","message":"Validation failed: due_date: Input should be a valid date","errors":{"due_date":"Input should be a valid date"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - Missing or expired token, an MCP OAuth token used against the REST API, or no access to this business","content":{"application/json":{"example":{"error":"unauthorized","message":"Authentication required","code":"AUTH_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"error":"forbidden","message":"You don't have permission to access this resource","code":"AUTH_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not Found - Resource does not exist","content":{"application/json":{"example":{"error":"not_found","message":"Resource not found","code":"NOT_FOUND_001","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"},"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"},"example":{"error":"validation_error","message":"Validation failed: amount: Input should be a valid integer","errors":{"amount":"Input should be a valid integer"},"code":"GEN_002","request_id":"3f0e7c2a-9b4d-4e1a-8c6f-2d5b7a1e9c30"}}}}},"x-fastapi-operation-id":"credit_create_line_disclosure_api_v1_credit_lines__credit_line_id__disclosures_post"}}},"components":{"schemas":{"CreditDisclosureResponse":{"properties":{"id":{"type":"string","title":"Id","description":"The disclosure."},"credit_line_id":{"type":"string","title":"Credit Line Id","description":"The line."},"program_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Program Id","description":"Its program."},"kind":{"type":"string","title":"Kind","description":"`offer`, `limit_change` or `terms_change`."},"trigger":{"type":"string","title":"Trigger","description":"`line_opened`, `limit_increase`, `manual` or `terms_change`."},"status":{"type":"string","title":"Status","description":"`generated`, `pending_acknowledgement`, `acknowledged`, `superseded`, `overridden` (an operator activated the line without the merchant's acknowledgement), `not_required`, or `queued` (a terms-change disclosure the nightly sweep generates)."},"jurisdiction":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Jurisdiction","description":"The template's jurisdiction."},"template_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Template Version","description":"The template version used."},"figures":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Figures","description":"The figures printed, in cents and basis points. A terms-change disclosure also carries `changed_terms`, the program fields that changed, and `applies_from`, the first posting date the new terms apply to: a purchase that posted before it keeps its own terms."},"assumptions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Assumptions","description":"What the figures assume, in words."},"required":{"type":"boolean","title":"Required","description":"Whether the policy called for a document."},"requirement_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirement Reason","description":"Why, or why not."},"requires_acknowledgement":{"type":"boolean","title":"Requires Acknowledgement","description":"The merchant must acknowledge it on the portal.","default":false},"pdf_sha256":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Sha256","description":"SHA-256 of the stored PDF; the download matches it."},"pdf_size_bytes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Pdf Size Bytes","description":"The PDF's size."},"previous_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Previous Limit Cents","description":"The limit before the change."},"limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit Cents","description":"The limit the figures were computed on."},"held_limit_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Held Limit Cents","description":"An increase held until acknowledgement; the old limit holds."},"limit_applied_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Limit Applied At","description":"When a held increase was applied."},"delivered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Delivered At","description":"When the merchant first opened it."},"delivery_channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Channel","description":"`portal`."},"acknowledged_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Acknowledged At","description":"When."},"acknowledged_portal_session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Acknowledged Portal Session Id","description":"The portal link it was acknowledged through."},"superseded_by_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Superseded By Id","description":"The disclosure that replaced it."},"superseded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Superseded At","description":"When."},"created_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By","description":"Who generated it."},"withdrawn_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Withdrawn Reason","description":"Why a held increase was withdrawn or not applied: a later limit change went through, the line was suspended or closed, an operator withdrew it, or the line was activated by override."},"held_increase_blocked_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Held Increase Blocked Reason","description":"Why the held increase cannot be applied now (the program's limit envelope narrowed past it, or the line is suspended or closed). Null when acknowledging would apply it, or nothing is held."},"override_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Override Reason","description":"Why an operator activated the line without the acknowledgement."},"overridden_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Overridden At","description":"When."},"overridden_by_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Overridden By User Id","description":"The operator who overrode it."},"created_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created At","description":"When."}},"type":"object","required":["id","credit_line_id","kind","trigger","status","required"],"title":"CreditDisclosureResponse","description":"One disclosure generated for a line."},"DisclosureCreateRequest":{"properties":{"kind":{"type":"string","enum":["offer","limit_change"],"title":"Kind","description":"`offer` (the line's terms) or `limit_change` (the current limit).","default":"offer"}},"additionalProperties":false,"type":"object","title":"DisclosureCreateRequest","description":"Generate a disclosure for a line now."},"SuccessEnvelope_CreditDisclosureResponse_":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"data":{"anyOf":[{"$ref":"#/components/schemas/CreditDisclosureResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditDisclosureResponse]"},"ErrorResponse":{"title":"ErrorResponse","type":"object","description":"Envelope returned by every non-2xx response. Branch on `code` (stable) rather than `message` (human-readable, may change).","required":["error","message","code"],"properties":{"error":{"type":"string","description":"Error category: `validation_error`, `unauthorized`, `forbidden`, `not_found`, `conflict`, `rate_limited`, `server_error`, or `service_unavailable`."},"message":{"type":"string","description":"Human-readable explanation, safe to show to end users."},"code":{"type":"string","description":"Stable machine-readable code in `CATEGORY_NNN` form (e.g. `NOT_FOUND_006`, `AUTH_010`, `GEN_002`)."},"request_id":{"type":"string","description":"Correlation id for support requests. Echoes the `x-request-id` request header when one was supplied."},"errors":{"type":"object","additionalProperties":{"type":"string"},"description":"Field-level validation messages keyed by field name. Present on 400/422 validation failures only."}}}},"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API Token","description":"API token authentication. Format: `Bearer dz_...`"}}},"security":[{"BearerAuth":[]}]}