> ## 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.

# Constituir una SL por API — Incorporate an S.L.

> Let your customers start a limited company from your product: Melso's professionals incorporate the S.L. and you follow every step through one case.

> [!NOTE]
>
> The incorporation case (`constitucion_sl`) is a **live capability**: Melso's
> professionals incorporate S.L.s requested from the Melso app and its MCP
> server today. Creating the company with its setup from your platform, partner
> payment, attested approval and the `company.registered` event are
> **preview**. See [Availability](https://docs.melso.ai/api/availability.md).

Founders who open an account with you before their company exists can
incorporate it from your product. You send what the founders decided once;
Melso's professionals do the rest and come back only when someone has to
decide, provide a document or sign.

## What is included

Melso reserves the name at the Registro Mercantil Central, drafts the bylaws
and the deed, arranges the notary signing, registers the company with the
Registro Mercantil and obtains its tax ID and census registration. Notary and
Registro Mercantil fees, the name reservation and the BORME publication are
included. The share capital, digital certificates and the partners' powers of
attorney are not.

## Who does what

| Step | Who | Through the API |
| - | - | - |
| Name reservation at the Registro Mercantil Central | Melso, from `names` | `case.updated` |
| Capital deposit certificate | The bank where the company's account is opened | [Answer an information request](https://docs.melso.ai/api/reference/cases/answer-case-request.md) |
| Bylaws and deed draft | Melso | `case.approval_requested` |
| Approving the deed draft | The owner | [Attest a case approval](https://docs.melso.ai/api/reference/cases/attest-case-approval.md), or the approval link |
| Signing the deed before the notary | The partners and the administrators, in person | Never a call |
| Registro Mercantil, tax ID and census | Melso | `case.updated`, then `case.completed` |

## A company in incorporation

The S.L. is a company of its own from the moment it is asked for. Until the
Registro grants its legal name and tax ID it holds only its incorporation
case: no books, invoices or taxes. The request, its payment, the conversation
and the deed all belong to it.

## The flow

**1. Create the company with its setup**

[Create a company](https://docs.melso.ai/api/reference/companies/create-company.md) of kind
`company` with `setup_request` `incorporate_sl`. It has no tax ID yet, so
leave `fiscal_profile` out. `setup_details` follow `CaseDetailsConstitucionSL`:

```bash theme={null}
curl https://api.melso.ai/v1/companies \
  -H "Authorization: Bearer $MELSO_API_KEY" \
  -H "Idempotency-Key: cus_52011-setup" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "company",
    "name": "Estudio Norte",
    "external_id": "cus_52011",
    "owner": {"name": "Pablo Ruiz Ortega", "email": "pablo@example.com", "phone": "+34600000001", "locale": "es"},
    "setup_request": "incorporate_sl",
    "setup_payer": "partner",
    "setup_details": {
      "name_ending": "sl",
      "names": ["Estudio Norte", "Norte Diseño", "Estudio Norte Creativo"],
      "activity": "Diseño gráfico y comunicación visual para empresas",
      "capital": 3000,
      "share_value": 1,
      "partners": [
        {"type": "person", "name": "Pablo Ruiz Ortega", "tax_id": "12345678Z", "share_percent": 60, "administrator": true, "has_certificate": true},
        {"type": "person", "name": "Ana Vidal Soler", "tax_id": "87654321X", "share_percent": 40, "administrator": false, "has_certificate": false}
      ],
      "registered_office": {"street_type": "Calle", "street": "Alcalá", "number": "120", "postal_code": "28009", "municipality": "Madrid", "province": "Madrid"}
    },
    "services": ["invoicing", "bookkeeping", "tax_returns"]
  }'
```

The stakes add up to exactly 100 and `capital` is a multiple of
`share_value`. The response carries `setup.case_id`, the `constitucion_sl`
case. The incorporation is sold once: with `setup_payer` `partner` your
partner account pays it and the case goes straight to Melso. With `owner`,
the case carries `payment_url` and starts once the owner pays.

**2. Send the capital deposit certificate**

For a contribution in money, the capital is deposited in an account in the
company's name before the deed is signed, and the bank certifies it. Melso asks
for the certificate with `case.information_requested`, as a `document` item.
If your product holds that account, send it without waiting for the person:
[upload it](https://docs.melso.ai/api/reference/documents/upload-document.md) and
[answer the item](https://docs.melso.ai/api/reference/cases/answer-case-request.md) with its
`file_id`.

```json theme={null}
{
  "request_id": "3d5f7a9c-1b2e-4c6d-8e0f-2a4b6c8d0e1f",
  "answers": [
    {"item_id": "capital_deposit_certificate", "file_id": "8a6c4e2f-0b1d-4f3a-9c5e-7d9f1b3a5c7e"}
  ]
}
```

The same request may ask for the partners' identity documents.

**3. Get the deed draft approved**

When the bylaws and the deed are drafted you receive
`case.approval_requested`. [Get the case](https://docs.melso.ai/api/reference/cases/get-case.md):
the drafts are in `documents` and the version is `current_version`. The
owner approves that exact version, either:

* **in your product**: show the drafts, collect the approval with your own
  authentication, and
  [attest it](https://docs.melso.ai/api/reference/cases/attest-case-approval.md):

  ```json theme={null}
  {
    "expected_version": 2,
    "approver": {"name": "Pablo Ruiz Ortega", "email": "pablo@example.com", "role": "owner", "tax_id": "12345678Z", "external_user_id": "usr_3k9d2"},
    "evidence": {
      "approved_at": "2026-11-20T16:03:12Z",
      "ip_address": "203.0.113.24",
      "user_agent": "Mozilla/5.0",
      "authentication": "strong_customer_authentication",
      "shown_document_sha256": "4b1e7c9a2d5f8e0b3c6a9d2f5e8b1c4a7d0e3f6b9c2a5d8e1f4b7c0a3d6e9f2b"
    }
  }
  ```

* **or on Melso's page**: send the owner the
  [approval link](https://docs.melso.ai/api/reference/cases/create-case-approval-link.md).

The case moves to `filing` and you receive `case.approved`. To change the
draft instead, [add a message](https://docs.melso.ai/api/reference/cases/add-case-message.md) with
`changes` `true`; Melso sends a new version and the earlier one can no longer
be approved.

**4. Sign before the notary**

Melso arranges the notary and writes through the case with the date. The
partners and the administrators sign the deed in person. That signature is
theirs: no API call stands in for it.

**5. Hear that the company exists**

Melso registers the deed with the Registro Mercantil, obtains the tax ID and
registers the company in the census. The case reaches `done` with the
`external_reference` of the registration, and its documents hold the
registered deed. You receive `case.completed`, then `company.registered`:
the company has the legal name and tax ID the Registro granted.

The company then becomes an ordinary empresa once Melso's team turns its tax
service on: [mandates](https://docs.melso.ai/api/companies.md#mandates),
[invoicing setup](https://docs.melso.ai/api/reference/invoicing-setup/get-invoicing-status.md) and its
tax calendar. If an administrator must register as an autónomo, open an
`alta` for them as in [Register an autónomo](https://docs.melso.ai/api/guides/register-autonomo.md).

## Events, in order

| Event | Meaning for your product |
| - | - |
| `case.updated` | The case moved: name reserved, notary arranged, deed registered. |
| `case.information_requested` | A document or an answer is needed: the capital certificate, an identity document. |
| `case.approval_requested` | A deed draft to approve, at `current_version`. |
| `case.approved` | The owner approved it; Melso proceeds to the notary and the registries. |
| `case.completed` | Incorporated. The registered deed is on the case. |
| `company.registered` | The company has its tax ID; show it as active. |

Events can arrive out of order. Read the case again with
[Get a case](https://docs.melso.ai/api/reference/cases/get-case.md) before you act on one.

## What an approval is, and is not

An attested approval is your statement that the owner approved one exact
version, with the evidence. It requires a partner agreement that defines who
may approve and how you authenticate them. It does not sign the deed, and a
version that changed after the person saw it is refused. See
[Approvals and filing](https://docs.melso.ai/api/approvals.md).


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