Fiscal Notes — Onboarding
Integration guide for the Fiscal Notes module. Before starting, complete the Connector registration and review the Authentication flow.
Flow overview
Phase 1: Activation & Binding
When a company activates the fiscal notes addon in the OlaClick panel:
- OlaClick creates a connection between the company and your connector with status
pending. - OlaClick creates a webhook configuration for that company, pointing to your registered webhook URL.
- OlaClick sends a
CONNECTION_CREATEDevent to your webhook.
The event's data field contains merchant_id, webhook_url, and subscribed_events. Store the merchant_id — it identifies the company and you'll need it for authentication.
Event reference:
CONNECTION_CREATED
Phase 2: KYC
The company sees your KYC iframe embedded in the OlaClick platform and submits their fiscal documents.
-
Implement the iframe — OlaClick embeds your URL with
company_idandcountryas query parameters. → See KYC Iframe -
Update the connection status — Once you validate (or reject) the documents, call the API to transition the connection. This endpoint requires a Connector Token (no
company_id).status: "active"→ KYC approved, emission flow is enabledstatus: "rejected"→ KYC rejected, no events will be sent
→ See Update Connection Status
API Reference:
PATCH /v1/conections/:id— Required scope:conections:write
You can update the connection status at any time. If you need to invalidate a previously approved KYC (expired certificates, compliance issues), call the same endpoint to transition back to rejected. While the connection is not active, OlaClick stops sending events and the connector can't generate company-scoped tokens.
Phase 3: Emission
Once the connection is active, OlaClick sends invoice requests to your webhook when orders are completed.
-
Receive the event — OlaClick delivers a
FISCAL_NOTES_REQUESTevent. Thedatafield containsorder_id,country_code, andelectronic_invoice_id.→ See Fiscal Note Requested
Event reference:
FISCAL_NOTES_REQUEST -
Fetch the order — The event only contains the
order_idreference. Call the API to get the full order (products, totals, payments, client info). This requires a Company Token (includecompany_idin the token request).→ See Get Order
API Reference:
GET /v1/orders/:id— Required scope:orders:read -
Confirm the result — After emitting (or failing to emit) the invoice with the fiscal authority, notify OlaClick. This requires a Company Token with
fiscal-notes:write.Outcome statusvalueDescription Invoice emitted COMPLETEDInclude invoice_numberfrom the fiscal authorityEmission failed REQUEST_ERRORInclude messagewith the failure reason→ See Notify Invoice
API Reference:
PATCH /v1/fiscal-notes/confirmation— Required scope:fiscal-notes:write
Phase 4: Cancellation
When a company cancels a previously issued invoice from the OlaClick panel:
-
Receive the event — OlaClick delivers a
FISCAL_NOTES_CANCELATION_REQUESTevent. The payload is identical toFISCAL_NOTES_REQUEST— only theevent_typediffers.→ See Receive Cancellation
Event reference:
FISCAL_NOTES_CANCELATION_REQUEST -
Confirm the result — After cancelling (or failing to cancel) the fiscal document with the authority, notify OlaClick using the same confirmation endpoint.
Outcome statusvalueDescription Cancellation succeeded CANCELLEDDocument cancelled with the fiscal authority Cancellation failed CANCELLED_ERRORInclude messagewith the failure reason→ See Confirm Cancellation
API Reference:
PATCH /v1/fiscal-notes/confirmation— Required scope:fiscal-notes:write
Always confirm after processing a webhook, whether it succeeded or failed. Without confirmation, the invoice stays in a transient state indefinitely.
Homologation
Complete the homologation process to get production access.
→ See Homologation
Required Scopes
| Scope | Level | Token type | Used for |
|---|---|---|---|
conections:write | connector | Connector Token | Update connection status (KYC) |
orders:read | company | Company Token | Fetch order data by ID |
fiscal-notes:write | company | Company Token | Confirm invoice emission/cancellation |