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 an autónomo
and company for an empresa. If the answer has onboarding, the autónomo’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 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
Usecustomers and invoices.
1
Find the customer
2
Save the customer if they are new
3
Save an unnumbered draft
irpf_rate is for an autónomo 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 an autónomo’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.Report a problem or ask for work
Usesupport_tickets_create.
service_request and
put every detail in the description.