{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/programs/{program_id}/integration-guide","version":"1.0.0","description":"Integration blueprint and code snippets for a program"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/programs/{program_id}/integration-guide":{"get":{"tags":["credit"],"summary":"Integration blueprint and code snippets for a program","description":"Returns the tailored integration steps and ready-to-run cURL, TypeScript and Python snippets for connecting an external system to this credit program (`open_line`, `connect_bank`, `ingest_settlements`, `record_payment`, `consume_events`), along with the program's card issuer, bank feed provider, event delivery mode and paired sandbox business id.","operationId":"get_program_integration_guide","parameters":[{"name":"program_id","in":"path","required":true,"schema":{"type":"string","description":"The program's id.","title":"Program Id"},"description":"The program's 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"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuccessEnvelope_CreditIntegrationGuideResponse_"}}}},"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":"get_program_integration_guide_api_v1_credit_programs__program_id__integration_guide_get"}}},"components":{"schemas":{"CreditIntegrationGuideResponse":{"properties":{"program_id":{"type":"string","title":"Program Id","description":"The program's id."},"slug":{"type":"string","title":"Slug","description":"The program's slug."},"display_name":{"type":"string","title":"Display Name","description":"The program's display name."},"business_id":{"type":"string","title":"Business Id","description":"The operator business id."},"sandbox_business_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sandbox Business Id","description":"The paired sandbox business id, when provisioned."},"lending_model":{"type":"string","title":"Lending Model","description":"`per_transaction` or `cycle_draw`."},"issuing_provider":{"type":"string","title":"Issuing Provider","description":"Card issuer adapter (`ramp`, `brex`, `stripe_issuing`, `lithic`, `external`, `mock`)."},"card_management":{"type":"string","title":"Card Management","description":"`dayzero` or `partner`."},"bank_feed_provider":{"type":"string","title":"Bank Feed Provider","description":"`stripe_fc_bigquery`, `direct_push`, or `plaid_hosted_link`."},"event_delivery_mode":{"type":"string","title":"Event Delivery Mode","description":"`polling`, `webhook`, or `both`."},"portal_frame_ancestors":{"items":{"type":"string"},"type":"array","title":"Portal Frame Ancestors","description":"HTTPS origins allowed to iframe-embed `/p/credit/{token}?embed=1`."},"steps":{"items":{"$ref":"#/components/schemas/CreditIntegrationGuideStep"},"type":"array","title":"Steps","description":"Ordered integration steps with cURL, TypeScript, and Python snippets."}},"type":"object","required":["program_id","slug","display_name","business_id","lending_model","issuing_provider","card_management","bank_feed_provider","event_delivery_mode"],"title":"CreditIntegrationGuideResponse","description":"Self-serve connection guide and code snippets for a credit program."},"CreditIntegrationGuideStep":{"properties":{"step":{"type":"string","title":"Step","description":"Stable step identifier, e.g. `open_line`."},"title":{"type":"string","title":"Title","description":"Human-readable step title."},"description":{"type":"string","title":"Description","description":"What this step does in the partner's system."},"method":{"type":"string","title":"Method","description":"HTTP method (`GET`, `POST`, `PATCH`)."},"path":{"type":"string","title":"Path","description":"API path under `/api/v1`."},"curl_snippet":{"type":"string","title":"Curl Snippet","description":"Ready-to-run cURL example for this program."},"typescript_snippet":{"type":"string","title":"Typescript Snippet","description":"Ready-to-run TypeScript fetch example for this program."},"python_snippet":{"type":"string","title":"Python Snippet","description":"Ready-to-run Python httpx example for this program."}},"type":"object","required":["step","title","description","method","path","curl_snippet","typescript_snippet","python_snippet"],"title":"CreditIntegrationGuideStep","description":"One integration step tailored to a program's configuration."},"SuccessEnvelope_CreditIntegrationGuideResponse_":{"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/CreditIntegrationGuideResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditIntegrationGuideResponse]"},"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":[]}]}