{"openapi":"3.1.0","info":{"title":"GET /api/v1/credit/events","version":"1.0.0","description":"Poll the credit event feed"},"servers":[{"url":"https://api.ondayzero.com","description":"Production"}],"paths":{"/api/v1/credit/events":{"get":{"tags":["credit"],"summary":"Poll the credit event feed","description":"Every credit event in order, from a cursor. Pass the returned `next_cursor` as `after` on the following call. This is the polling half of event delivery — the same events are pushed to any registered webhook endpoint, so a partner may use either or both, and replay through this feed after an outage.","operationId":"list_credit_events_api_v1_credit_events_get","parameters":[{"name":"after","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Return events after this sequence number.","title":"After"},"description":"Return events after this sequence number."},{"name":"event_types","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated event types to include.","title":"Event Types"},"description":"Comma-separated event types to include."},{"name":"credit_line_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credit Line Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"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_CreditEventFeedResponse_"}}}},"401":{"description":"Unauthorized - Authentication required","content":{"application/json":{"example":{"detail":"Not authenticated"}}}},"403":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"example":{"detail":"Not enough permissions"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"CreditEventFeedResponse":{"properties":{"events":{"items":{"$ref":"#/components/schemas/CreditEventResponse"},"type":"array","title":"Events"},"next_cursor":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More","default":false}},"type":"object","title":"CreditEventFeedResponse","description":"A page of events plus the cursor to resume from.\n\nCursor-based rather than offset-based: a partner storing only\n`next_cursor` can resume exactly after an outage, which is the\nproperty webhooks alone cannot offer."},"CreditEventResponse":{"properties":{"id":{"type":"string","title":"Id"},"sequence_no":{"type":"integer","title":"Sequence No","description":"Monotonic per business. Pass the last one back as `after`."},"event_type":{"type":"string","title":"Event Type"},"credit_line_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Credit Line Id"},"program_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Program Id"},"payload":{"additionalProperties":true,"type":"object","title":"Payload"},"occurred_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Occurred At"},"delivered_via_webhook":{"type":"boolean","title":"Delivered Via Webhook","default":false}},"type":"object","required":["id","sequence_no","event_type","payload"],"title":"CreditEventResponse","description":"One event on the credit feed."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"SuccessEnvelope_CreditEventFeedResponse_":{"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/CreditEventFeedResponse"},{"type":"null"}]}},"additionalProperties":true,"type":"object","title":"SuccessEnvelope[CreditEventFeedResponse]"},"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":[]}]}