Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.yofacturo.es/llms.txt

Use this file to discover all available pages before exploring further.

Tools

The server exposes 12 tools grouped by functional area.

Contacts

list_contacts

Search contacts in the organization with optional filters.
ParameterTypeRequiredDescription
querystringNoName search (case-insensitive).
document_numberstringNoFilter by document number (NIF/CIF).
emailstringNoFilter by email.
pageintegerNoPage number.

resolve_contact

Deterministically resolve a single contact. Returns status (unique / ambiguous / none) and up to 5 candidates. Use this before any write operation that requires a contact_id.
ParameterTypeRequiredDescription
querystringNoFree-text name search (case-insensitive).
document_numberstringNoExact match on NIF/CIF.
emailstringNoExact match on email.
idintegerNoExact contact id. Short-circuits all other filters.
At least one of the four fields is required.

create_contact

Create a new contact in the organization. Idempotent on document_number: if a contact with that NIF/CIF already exists, returns the existing one instead of creating a duplicate.

update_contact

Update the fields of an existing contact. Only the fields passed are modified (PATCH semantics).
ParameterTypeRequiredDescription
idintegerYesId of the contact to update.

Products

resolve_product

Deterministically resolve a single product. Returns status (unique / ambiguous / none) and candidates. Use this before creating an invoice draft.
ParameterTypeRequiredDescription
querystringNoFree-text concept search.
idintegerNoExact product id.
At least one of the two fields is required.

create_product

Add a new product to the organization’s catalogue.

update_product

Update the fields of an existing product. Only the fields passed are modified (PATCH semantics).
ParameterTypeRequiredDescription
idintegerYesId of the product to update.

Invoices

resolve_invoice

Locate an existing issued invoice.
ParameterTypeRequiredDescription
idintegerNoExact invoice id.
full_numberstringNoFull invoice number (e.g. A-2025-0042).
latest_for_contact_idintegerNoReturns the most recent invoice for the given contact.

create_invoice_draft

Create an ordinary (F1) invoice draft. The draft is not issued; use issue_invoice_draft to make it fiscally binding. Returns the draft_id, a confirmation_token, and a preview to show the user before issuing.
ParameterTypeRequiredDescription
contact_idintegerYesContact id. Use resolve_contact to obtain it.
linesarrayYesAt least one line. Each line must have product_id or (concept + unit_price).
lines[].product_idintegerNoProduct id. Pre-fills concept, price, and tax rate.
lines[].conceptstringNo*Required if no product_id. Overrides the product value when present.
lines[].unit_pricenumberNo*Required if no product_id. Overrides the product value when present.
lines[].quantitynumberNoDefaults to 1.
lines[].tax_ratenumberNoOverrides the product’s or organization’s default tax rate.
lines[].discount_percentnumberNoDiscount percentage.
operation_datestringNoISO-8601 date.
operation_descriptionstringNoDescription of the operation.
payment_methodstringNoPayment method.
payment_method_infostringNoAdditional payment method information.

create_simplified_invoice_draft

Create a simplified (F2) invoice draft, without an associated contact. Useful for tickets or general public sales. Returns draft_id, confirmation_token, and a preview.

issue_invoice_draft

Destructive and irreversible operation. Once issued, the invoice is hash-chained and cannot be modified or deleted.
Keep in mind that invoices will not be sent to Verifactu until you submit the request from the platform.
Issue a draft (F1 or F2), making it fiscally binding. The invoice is automatically submitted to VeriFactu.
ParameterTypeRequiredDescription
draft_idintegerYesId of the draft to issue.
confirmation_tokenstringNoToken returned by the draft creation step. Must match if one was generated.
send_emailbooleanNoIf true, sends the issued invoice by email to the contact. Defaults to false.

send_invoice_email

Send or resend an issued invoice by email to its associated contact.
ParameterTypeRequiredDescription
issued_invoice_idintegerYesId of the issued invoice.

Prompt

create_invoice

Full guided flow for issuing an invoice. The agent resolves the contact and products, creates the draft, presents the preview, and requests explicit confirmation before issuing.