Email invoice

Send a sales invoice by email to one or more addresses.

MCP tool alegra_write → email_invoice

write Confirm

Sends the invoice through Alegra's invoice email, so the client receives the message of the template "Correo de envío de facturas de venta". Only the subject can be set per call; without one Alegra uses a default subject. The invoice goes out as the original unless as_copy is true. Fails with a not-found error when the invoice does not exist. Calling it twice sends two emails. By default you confirm each call; you can switch that off for this tool.

Parameters

Parameters: email_invoice
NameTypeDescription
invoice_id string required string Invoice ID from list_invoices.
emails array required array Recipient addresses, even for one recipient.
subject string string Email subject. Default: the subject Alegra sets.
send_copy_to_me boolean boolean true also sends a copy to your own address. Default: false.
as_copy boolean boolean true sends the invoice marked as a copy. Default: false, the original.

tools/call

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "alegra_write",
    "arguments": {
      "operation": "email_invoice",
      "arguments": {
        "invoice_id": "1038",
        "emails": [
          "accounts@northwind.example"
        ],
        "subject": "Reminder: invoice FV-0038 is overdue",
        "send_copy_to_me": true
      }
    }
  }
}

Example response

JSON

{
  "content": [
    {
      "type": "text",
      "text": "{ ... same JSON as structuredContent ... }"
    }
  ],
  "structuredContent": {
    "invoice_id": "1038",
    "sent_to": [
      "accounts@northwind.example"
    ],
    "subject": "Reminder: invoice FV-0038 is overdue",
    "copy_sent_to_you": true,
    "sent": true
  },
  "isError": false
}

Sign in once. Your agent does the rest.

Sign up and add the apps you need. Free 7-day trial with 2,000 credits, no card needed.