Skip to main content
Each use case below starts from something a person asks and lists the calls an assistant makes, in order. Every example is a tools/call request body. The identifiers are placeholders: use the ones your own company returns. The connection lists only the tools and actions the company’s plan, your role and the setup state allow. If a call here is not listed for you, read Permissions and approvals.

Confirm the company

Do this first on every new connection. company takes no arguments and changes nothing.
Check name and kind with the person. kind is freelancer for the self-employed and company for a company. If the answer has onboarding, the self-employed person’s setup is pending: go to Complete the fiscal profile.

Record a receipt or a supplier invoice

Use expenses. The file goes to Melso in three calls.
1

Ask for an upload link

Send the file’s name, type and exact size. Accepted types are PDF, JPEG, PNG, WebP and GIF, up to 15 MB.
The answer has upload_id, upload_url, the headers to send, expires_at and web_upload_url.
2

PUT the file to upload_url

Send the file’s exact bytes with the returned headers. This request goes to the upload link, not to the MCP endpoint.
3

Read the uploaded file

The file is read in the background. The answer has a job_id.
4

See what it became

The job is queued, done or failed. A finished job names the expense or the income it recorded, with its review codes.
Two failures ask you for something:
  • direction_unknown: ask whether the company issued or received the document, then queue it again with direction.
  • country_unknown: ask the supplier’s or customer’s country, then retry with counterparty_country and the direction the error names.
Queue the document again with what the person answered:
A client that cannot upload files shares web_upload_url instead. The person drops the files in the web app.

Record an invoice issued in another program

An invoice the company issued with another program, on a platform or before Melso is income the returns count, but Melso did not issue it. Record it from its PDF with the same calls as a receipt: Melso sees that the company is the issuer and records income. documents save only keeps a file and records nothing in the books, and invoices would issue a new invoice with another number. Ask for an upload link with expenses upload and PUT the file, as above. Then read it, saying what you already know:
The answer has a job_id, not the record. Call expenses_read document_status with it: a finished job has direction_recorded income and record.id, the income’s id. Keep that id, not the job_id. duplicate true means Melso already had this invoice (the same number, customer, date and total) and record names it: nothing was recorded twice, so sending an invoice again is safe. number_taken means another invoice is already recorded under that number. Your system holds the invoice’s exact figures. When Melso read one differently, correct it with income update, at the expected_version that income_read get returns:
Income recorded this way has no paid state: payments marks only invoices issued with Melso. To bring a whole year at once, a self-employed person’s book of issued invoices, as the other program exports it, goes through book_imports.

Record an expense from its details

When there is no file, record the expense by hand. total must equal subtotal plus vat_amount. Leave category out when you are not sure.
deductible defaults to unsure. It is a classification, not approval of a deduction.

Draft an invoice for a customer

Use contacts and invoices.
1

Find the customer

2

Save the customer if they are new

3

Save an unnumbered draft

irpf_rate is for a self-employed person who is a professional. A company’s invoice leaves it out. To change the draft before it is approved, call prepare again with the draft’s id.
4

Get the approval page

Show the person the preview and the approval_url. The owner issues the invoice there, in the signed-in web app.
5

Check the outcome later

request_approval returns a link, not an outcome. Do not say the invoice was issued until get shows it.

Correct an issued invoice

An issued invoice cannot be edited. correct prepares a corrective draft with the differences. A negative unit_price credits the original and a positive one increases it. The reason goes in notes, and it is required.
The original stays as it was. Then call request_approval with the corrective draft’s id, as in the previous use case.

Record a payment received

Use payments once the person confirms the invoice was paid in full.
It records money already received. It does not charge a card or move money, and there is no partial payment.

What is due this quarter

Use taxes.
Each entry has the form, its deadline, the last day to pay by direct debit and its status. It also says whether Melso calculates the form or only reminds. A calculated form carries a filing_id that links its return. For the amounts, list the calculated returns:
A return with is_preview true is an estimate. It has an amount only: no boxes, no approval page and no import file.

Explain a return and hand over its approval

1

Read the return

Use the boxes and the review codes to explain each figure.
2

Get the approval page

Share approval_url. The owner authorizes the exact version there. For an estimate the answer has approval_required false and no link: say it is an estimate.
Authorization opens a case for Melso’s professionals to review and file. Do not tell the person the return is filed until its status is filed. Do not ask them to file an included return themselves.

Get the AEAT import file

Available for the 303, 130, 111 and 115.
The answer has filename, content_type and content_base64. Write the decoded bytes unchanged. The file is preparation: it is not an authorization and not proof of filing.

Fix a record

Read the record first. update needs the expected_version you read, and a stale version is refused.
Income works the same way. vat_lines replaces every current line.
Updating an expense clears its review codes and resets any earlier review.

Delete a duplicate

Ask the person to confirm first.
The file stays in the company’s documents. The call is refused when a tax return that covers the record’s date was already approved or filed. Do not retry it: the person makes that correction in the web app.

Complete the fiscal profile

Use fiscal_profile. It is listed for the company’s owner or an admin, and it is the tool to use while a self-employed person’s setup is pending.
1

See what is missing

2

Save whether they are already registered

3

Save what the person told you

Send every field from one message in one call.
The answer is the whole profile. errors names each refused field, deduced names what the server filled in so you can confirm it, and missing lists what is still required. Valid fields are saved even when another is refused.
A company has no guided setup, and the Melso team sets it up. A self-employed person can also finish in the web app’s guided setup. See Setup and fiscal profile.

Explain the corporate tax

For a company with accounting, use accounting.
The result goes from the accounting result to what is left to pay, with the rate that applies, the 202 instalments it sets and review codes to check. To show where a figure comes from, read the trial balance or the journal of one account, such as accounting_read with {"action": "journal", "account": "473"}. What the books cannot say, such as a non-deductible fine or the capitalization reserve, is saved with corporate_tax_update at the version you read. The owner still approves the 200 in the app, and Melso’s professionals file it.

Ask Melso’s professionals for a procedure

Use gestiones. Read the kinds first: what this company can ask for, the details each kind needs and how it is paid.
Then open the case. submit sends it at once when the plan covers it:
Follow the case with get. When the professionals ask for something, answer every item with answer; when their draft is ready, request_approval returns the page where the owner approves it. A kind sold once, such as incorporating an S.L., returns a payment_url instead: the owner pays in the web app before Melso starts.

Incorporate an S.L.

When the person wants to set up a Spanish limited company (constituir una S.L. o una S.L.U.), open a case of the kind constitucion_sl with gestiones. A self-employed person or a company can ask for it. Read its details_schema with kinds first. The request needs the candidate names, the activity, the share capital, the partners and the management body. Ask the person for the capital and never suggest an amount.
The new S.L. gets a company of its own in Melso, and the draft is saved there: the answer names it in company and carries payment_required and a payment_url. This kind is paid once. The owner reviews the request and pays in the Melso web app, and Melso receives the case once the payment is confirmed. A connection works in one company, so this one stays with the company that asked. To follow the incorporation from the assistant, connect the new S.L.’s company. There update changes the request while it is unpaid, and details holds only the fields that change:
After the payment, each person partner verifies their identity through their own link. partner is the position in details.partners, starting at 0. Send verification_url to that partner, and never ask for photos of an identity document in the chat.
Melso’s professionals then reserve the name at the Registro Mercantil Central, prepare the bylaws and the deed, coordinate the notary and register the company. No draft is approved in the app: the partners approve the incorporation by signing the deed at the notary. get in gestiones_read returns milestones, the steps done, and pending_milestones, those still to come.

Report a problem or ask for work

Use support_tickets_create.
For work that no tool covers, such as a registration, use service_request and put every detail in the description.
Filing the same title again within 24 hours returns the ticket already filed. Never put passwords, certificates or other secrets in a ticket.