# Operational integrations

> Connect the systems that issue, collect, pay and feed Relvo — and understand what happens when one fails.

Source: https://app.relvoerp.com/docs/product/en/integrations/

Relvo is the system of record for your revenue, but it does not issue tax documents or move money on its own. For that it connects to external systems: the e-invoicing provider, the bank, the payment gateway and your own systems.

Every connection is an explicit object with credentials, a status and a log. Nothing is ever "implicitly connected".

## E-invoicing

In Chile, tax documents are issued with the SII (Chile's tax authority) through an authorized provider. Relvo prepares the document, sends it through the connected provider and stores the authority's response.

Every fiscal connection declares its **environment**: `sandbox` or `producción` (production). This is not a display label — it is a safety boundary. Documents from one environment never mix with those from the other, whether querying or issuing.

> **Caution: The authority rules the document, not your contract**
>
> If the SII rejects a document, the invoice moves to fiscal status `rejected` and must be corrected and resubmitted. If it stays `pending`, it has already been submitted: resubmitting it can produce a second document with its own folio number. The right path is to reconcile with the provider. See [the four axes of an invoice](https://app.relvoerp.com/docs/product/en/invoicing-collections.md#axis-2--fiscal-status).

### Fiscal sync

Besides issuing, Relvo can **read** from the SII what your company has issued: documents created in another system, before Relvo or in parallel. This feeds the collections portfolio and reconciliation with documents Relvo did not calculate.

Documents imported this way are tagged with their origin. That is what lets any report distinguish what Relvo calculated from what Relvo only recorded — and it is why a customer nobody created by hand may appear, flagged for review.

## Banks and movements

Connect the bank accounts whose movements you want to bring into Relvo. Credential validation and MFA happen inside a provider widget: **bank credentials never pass through Relvo's frontend and are never stored in Relvo**.

Once connected, the account is mapped to a ledger account and its movements feed reconciliation. If no connection is available, the alternative is to upload bank statements (*cartolas*) — the result in reconciliation is the same.

## Payment methods

A customer's payment method declares **through which channel the money is expected**. There are two worlds:

| Channel | Who executes the collection |
| --- | --- |
| Bank transfer, manual payment, self-collected | Relvo. There is no external system or credentials to connect. |
| External gateway | A connected payment provider, which executes the charge and reports the result. |

The distinction matters: only an external channel can become disconnected, require reconnection or fail because of credentials. A bank transfer does not "go down".

## Connection status

A connection is not just "active or not". Its status tells you what to do:

| Status | What it means |
| --- | --- |
| `active` | Operating |
| `syncing` | Pulling data right now |
| `auth_failed` · `requires_reconnect` | Invalid or expired credentials — requires human action |
| `rate_limited` | The provider is throttling; Relvo retries on its own |
| `disabled` · `inactive` | Deliberately turned off |
| `error` | Provider failure, with no user action pending |

`requires_reconnect` is the only one of these that halts the flow and does **not** resolve itself: someone has to re-authenticate.

## How data comes in

| Channel | Typical use |
| --- | --- |
| **API** | Your systems send usage events or read documents |
| **Inbound webhook** | The provider reports a change (payment received, document accepted) |
| **File upload** | Bank statements, historical usage, migrations |
| **Manual** | One-off entry from the interface |

Every ingestion is recorded as a run with its result — complete, partial or failed — and row-by-row detail. A partial upload is never silently lost: the rows that failed are identified so they can be corrected and reprocessed.

## API and tokens

API tokens are issued from Developers and carry **scopes** of the form `resource:action` — for example `usage_events:write`, `invoices:read`, `contracts:write`, `catalog:read`, `charging:read` (prices) or `customers:write`. Write implies read on the same resource: a token with `invoices:write` can also read invoices. Every operation in the reference declares the scopes it accepts in `x-required-scopes`, and having any one of them is enough. The token is sent as `Authorization: Bearer …` (`BearerAuth` scheme).

> **Caution: `full_access` is almost never the right token**
>
> `full_access` passes any scope check. It is fine for a quick test, not for a production system and **never** for an MCP client. Issue the narrowest scope the integrator needs: it is the difference between a leaked credential that reads usage and one that issues invoices.

A token is revoked, not edited. See the [authentication guide](https://app.relvoerp.com/docs/product/guides/authentication.md) and the [API reference](https://app.relvoerp.com/docs).

## Outbound webhooks

Relvo can notify your systems when something relevant happens. The available events are a closed, versioned catalog:

| Event | When it fires |
| --- | --- |
| `invoice.drafted` | An invoice draft was generated |
| `invoice.issued` | An invoice was issued |
| `invoice.fiscal_rejected` | The authority rejected the invoice |
| `credit_note.issued` · `debit_note.issued` | A note was issued |
| `credit_note.fiscal_rejected` · `debit_note.fiscal_rejected` | The authority rejected a note |
| `message.received` | An email arrived from a customer: a reply to a Relvo email or a new message |

Each endpoint has its own signing secret: **verify the signature before trusting the message body**. A newly created endpoint stays pending verification until it responds correctly, and it can be disabled (`/disable`) and re-enabled (`/enable`) without losing its configuration. The secret is rotated with `/rotate-secret`, and a failed delivery is resent with `/redeliver`. See the [webhooks guide](https://app.relvoerp.com/docs/product/guides/webhooks.md).

- [Integration guides](https://app.relvoerp.com/docs/product/guides/introduction.md): Authentication, idempotency, errors and webhooks, with examples.
- [MCP server](https://app.relvoerp.com/docs/product/guides/mcp.md): Connect an AI client to your Relvo data with narrowly scoped access.
- [Payments and reconciliation](https://app.relvoerp.com/docs/product/en/payments-reconciliation.md): What Relvo does with the bank movements it pulls in.
- [Charge calculations, pre-invoices and invoices](https://app.relvoerp.com/docs/product/en/invoicing-collections.md): The statuses that change when the tax authority responds.
