Skip to main content
Samples for the partner REST API at https://api.melso.ai/v1. Replace the identifiers with values from your own company. A partner key is a secret for your server: do not put it in a browser or a log. Each sample is labeled with the same words as Availability. A planned sample matches the published contract and is not callable yet. A live sample still needs a partner key (private beta). Without one, the API answers 401.

Create a company

Planned. POST /companies is not callable yet. setup_request register_autonomo or incorporate_sl would ask professionals to register the autónomo or incorporate an S.L. The live way to ask for that work, once the company exists, is a case.
Node.js 22. The call is planned, so a key that exists today is not enough for a 201.

Read a calculated modelo 303

Live in the app and MCP taxes. Private beta on REST. Melso calculates the 303 from the company’s records. There is no endpoint that you call to “run” the calculation. While the filing window is open, a draft is recalculated as records change.
A draft includes boxes, amount and version. An is_estimate of true means the tax service is not active: there are no boxes and no approval page. The AEAT import file is preparation, not a filing.

Approval

Live, and a person decides. This returns the signed-in page where the owner authorizes one exact version. Sending the link does not approve anything. A partner key that calls POST .../approve receives 403 person_required. Attesting an approval from your own interface is planned.
Share approval_url with the owner. A changed draft needs a new link and a new decision. Authorizing opens the case in which professionals review and file that version.

Filing receipt

Live to read the return. Manual-assisted to file it. There is no partner call that submits the 303 to the AEAT. After professionals file, read the return again. status filed and filed_at are the live record. filing.reference is the número de justificante, filing.csv is the código seguro de verificación, and filing.receipt is the PDF. The OpenAPI schema marks filing as preview, so that object’s fields can still change.
POST .../mark-filed records that the company filed the return itself. It is not how Melso’s filing is proved. The webhook tax_return.filed is planned.

Affiliation on Sistema RED

Planned and manual-assisted. This asks Melso to send an employee’s alta, baja or variación to the TGSS. It is not callable yet. It is not the autónomo’s own RETA registration: that live path is the case below.
The employee needs tax_id, social_security_number and employment filled. An alta has to reach the TGSS before the employee starts. The snippet stops before sending: the operation is not callable yet.

Invoice and Verifactu

Live. Saving the draft is private beta on REST. Issuing, which registers the invoice with VERI*FACTU or TicketBAI, is a person’s decision in the app. A partner key does not issue.
The owner opens approval_url and issues that version. Issuing registers it with VERI*FACTU in the common territory and the Canary Islands, or with TicketBAI in Álava, Bizkaia and Gipuzkoa. The legal PDF exists once pdf_ready is true.

Alta de autónomo y constituir una SL

Live and manual-assisted. Read the kind’s details_schema before sending details. constitucion_sl is paid by the owner before Melso starts when that kind is a one-off service, and the response then carries payment_url. submit: true sends a covered case to professionals.
The same cases are available to a signed-in person through MCP gestiones. Professionals do the registration and the incorporation. The case is done when its status is done and it carries the administration’s external_reference.