> ## Documentation Index
> Fetch the complete documentation index at: https://docs.melso.ai/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Melso MCP: https://mcp.melso.ai/mcp (OAuth; one company per connection). Documentation-search MCP: https://docs.melso.ai/mcp; it does not act on customer accounts.
>
> Use the live tool list and respect company membership. Ask the person to approve the exact invoice or tax return version in the signed-in app. Melso's professionals prepare and file included returns after approval; an AI assistant does not file. A prepared file or an approval is not evidence of filing: only the AEAT's reference and receipt are. Keep credentials out of chat and logs.

# Companies and mandates

> Add the autónomos and empresas you serve, complete their fiscal profile, and get the mandates that let Melso's professionals act for them.

## Companies

A company is one taxpayer: an autónomo (`freelancer`) or an empresa
(`company`). Everything else in the API belongs to exactly one company.

| | Autónomo (`freelancer`) | Empresa (`company`) |
| - | - | - |
| Tax ID | DNI or NIE | CIF |
| Income tax | Quarterly 130 and the annual income tax return (100), as a case | Corporate tax 200 and its 202 instalments |
| Books | Income and expense books | Full accounting: journal, trial balance, annual accounts |
| Banking and accounting endpoints | Not available | Available |
| Employees | Possible | Possible |

Create a company with [Create a company](/api/reference/companies/create-company)
(preview). Give it an owner: the person who approves its invoices and returns.

## Fiscal profile

The fiscal profile decides what Melso calculates: which forms the company
files, how often, and with which rules.

| Field | Why it matters |
| - | - |
| `tax_id`, `legal_name`, `address`, `postal_code` | The identity on every invoice and return. The postal code sets the tax territory. |
| `tax_territory` | `comun`, a foral territory (`alava`, `bizkaia`, `gipuzkoa`, `navarra`), `canarias`, `ceuta` or `melilla`. It decides the administration and the forms. |
| `vat_regime` | General, recargo de equivalencia, simplified or exempt; IGIC in the Canary Islands. |
| `activity_type`, `iae_code` | Professional or business activity, and the IAE heading. |
| `irpf_method` | Direct estimation (simplified or normal) or modules, for an autónomo. |
| `is_large_company`, `vat_sii` | Monthly filing and SII, which change the calendar. |

[Update the fiscal profile](/api/reference/companies/update-fiscal-profile)
saves what is valid and reports the rest in `errors`; `tax_missing` and
`invoice_missing` say what is still needed. Melso calculates returns in full
for the common territory under general VAT; other profiles appear in the
calendar as reminders and are reviewed by Melso's team first.

Rather than collecting tax details yourself, you can send the owner to
Melso's hosted onboarding with
[Create an onboarding link](/api/reference/companies/create-onboarding-link)
(preview).

## Mandates

<Info>
  Preview.
</Info>

Melso's professionals act before an administration only under the company's
representation. A mandate grants it for one administration and a list of
procedures:

| Administration | Procedures | What Melso can then do |
| - | - | - |
| AEAT | `tax_returns`, `notifications`, `certificates`, `census` | File returns, read the electronic mailbox, obtain certificates, file the 036 or 037 |
| TGSS | `affiliation`, `contributions`, `notifications`, `certificates` | Altas, bajas and variaciones; contribution settlements through the Sistema RED |
| SEPE | `contracts`, `company_certificates` | Contrat@ and Certific\@2 |

<Steps>
  <Step title="Request it">
    [Request a mandate](/api/reference/mandates/create-mandate) with the
    signer, who is the company's legal representative or the autónomo. The response
    carries a `signing_url`.
  </Step>

  <Step title="The signer signs">
    Send the signer to `signing_url`. They review the procedures and sign. The
    mandate becomes `signed` and you receive `mandate.signed`.
  </Step>

  <Step title="Melso registers it">
    Melso registers the representation with the administration. The mandate
    becomes `active` and you receive `mandate.activated`. If the administration
    refuses it, the mandate is `rejected` with the reason.
  </Step>
</Steps>

Until a mandate is `active`, Melso calculates and prepares but does not act
before that administration. The company can revoke a mandate at any time.

## Invoicing authorization

To issue invoices, a company is registered as an issuer with VERI\*FACTU (AEAT)
or TicketBAI (Álava, Bizkaia, Gipuzkoa). The owner authorizes it once. See
[Invoicing setup](/api/reference/invoicing-setup/get-invoicing-status).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.