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.
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
Useexpenses. 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
job_id.4
See what it became
queued, done or failed. A finished job names the expense or
the income it recorded, with its review codes.direction_unknown: ask whether the company issued or received the document, then queue it again withdirection.country_unknown: ask the supplier’s or customer’s country, then retry withcounterparty_countryand the direction the error names.
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:
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:
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
Usecontacts 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
approval_url. The owner issues the
invoice there, in the signed-in web app.5
Check the outcome later
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.
request_approval with the corrective
draft’s id, as in the previous use case.
Record a payment received
Usepayments once the person confirms the invoice was
paid in full.
What is due this quarter
Usetaxes.
filing_id that links its return.
For the amounts, list the calculated returns:
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
2
Get the approval page
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.filed. Do not ask
them to file an included return themselves.
Get the AEAT import file
Available for the 303, 130, 111 and 115.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.
vat_lines replaces every current line.
Delete a duplicate
Ask the person to confirm first.Complete the fiscal profile
Usefiscal_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.Explain the corporate tax
For a company with accounting, useaccounting.
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
Usegestiones. Read the kinds first: what this
company can ask for, the details each kind needs and how it is paid.
submit sends it at once when the plan covers it:
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 kindconstitucion_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.
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:
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.
get in
gestiones_read returns milestones, the steps
done, and pending_milestones, those still to come.
Report a problem or ask for work
Usesupport_tickets_create.
service_request and
put every detail in the description.