Skip to Content

Stream events

GET
/v1/events

Your key's business's events in its environment, as server-sent events, from the moment it opens: the same events, in the same envelope, as the webhooks POST (id, type, timestamp, data, the resource as its GET answers it; every type and its data is in the document's webhooks). Each event is one message whose data is that JSON and whose id is the event's; they come in the order they were stored. A read_only key opens it too.

Resume with Last-Event-ID, which an EventSource sends by itself when it reconnects, or with since: the events after that one are sent first, from those kept (90 days), then the new ones. A stream opened without either starts after the business's newest event, whose id it sends first with no message, so a client that hears nothing still resumes from there. A comment line every 18 seconds keeps it open; after about 90 seconds it ends, with retry: 1000, and the client opens it again from its last event. A key holds at most 5 open at once: one more is 429 event_streams_exhausted with Retry-After.

Authorization

apiKey
headerAuthorizationBearer <token>

Your API key, which acts for the one business it was created for: fb_live_… keys work at api.fiscalbase.io and issue in live, and fb_sandbox_… keys work at api-sandbox.fiscalbase.io and issue in sandbox, on the simulated SRI. A key sent to the other host is refused with api_key_wrong_host, which names its host.

Query Parameters

since?string

The id of an event to start after, for a client that can't send Last-Event-ID.

Formatuuid
types?string

Only these event types, separated by commas, such as invoice.authorized,invoice.returned; every type when left out. One of invoice.authorized, invoice.returned, invoice.not_authorized, invoice.annulled, credit_note.authorized, credit_note.returned, credit_note.not_authorized, credit_note.annulled, debit_note.authorized, debit_note.returned, debit_note.not_authorized, debit_note.annulled, withholding.authorized, withholding.returned, withholding.not_authorized, withholding.annulled, delivery_note.authorized, delivery_note.returned, delivery_note.not_authorized, delivery_note.annulled, purchase_settlement.authorized, purchase_settlement.returned, purchase_settlement.not_authorized, purchase_settlement.annulled, import.completed, import.failed, received_document.created, received_document.updated, series.gap_detected, series.duplicate_detected, series.collision_detected, series.gap_settled, series.updated, business.issuing_updated. A test key can't ask for a received document's events (422 event_not_in_test): test keeps no received documents.

Header Parameters

last-event-id?string

The id of the last event received: the stream starts after it. It wins over since.

Formatuuid
Fiscalbase-Environment?string

The environment the call acts in. Required with a person's session; a key's own environment is the one that counts, so a key may leave it out, and naming another is 422 environment_mismatch.

Value in"sandbox""test""live"
Fiscalbase-Business?string

The business the call acts for. With a person's session, the one the call is about (without it, a call about one business is 422 business_required and a list covers every business of the organization); a key acts for its own, so naming another is 422 business_mismatch.

Formatuuid
Fiscalbase-Channel?string

Which of Fiscalbase's own integrations a key's call comes from, recorded as the channel of the documents it issues: a record, not a permission. Without it, api. A person's call is always console.

Value in"api""mcp"
Fiscalbase-Agent?string

The AI agent a key's call comes from, as its client names itself (the MCP server sets it); recorded with the request and shown in the console's request log.

Response Body

The stream: each event a message with its id and its envelope as data.

response?stringtext/event-stream

id: <event id> and data: {"id", "type", "timestamp", "data"} for each event, and : heartbeat comments.

Example Request
curl -X GET 'https://api.fiscalbase.io/v1/events'
Example Response
"string"