Send a document
send_documentSends an invoice or a credit note over Peppol from JSON (POST /v1/documents). Call validate_document first. idempotency_key is required: a retry with the same key does not send twice. With a ps_test_ key (sandbox) it sends at once and costs no credit. With a ps_live_ key it sends a real document and uses 1 credit, in two calls: the first call returns a preview and a confirmation_handle and sends nothing; show the preview to the user, and only after the user approves, call again with the same arguments plus confirm: true and the confirmation_handle (valid 10 minutes). Live sends work only when the workspace setting "Allow live sends from MCP" is on. The tool is marked destructive for Live; the mark cannot change with the key, so a host can ask the user to approve a sandbox send too.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"number": "<number>",
"issue_date": "<issue_date>",
"from": "<from>",
"to": "<to>",
"lines": "<lines>",
"idempotency_key": "<idempotency_key>",
"company_id": "<company_id>"
},
"name": "send_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| to | Yes | ||
| from | Yes | A sender or recipient party on a document. A party needs a `tax_id`, a `peppol_id`, or both. | |
| note | No | Optional note to include on the document | |
| type | No | ||
| lines | Yes | ||
| vatex | No | VAT exemption reason code (BT-121) from the VATEX code list, e.g. `VATEX-EU-132`. Applies at document level only. | |
| number | Yes | Your document number (e.g., "INV-2026-001") | |
| charges | No | Document-level charges (BG-21) — additions applied before tax. | |
| confirm | No | Live only. Leave out on the first call: it returns a preview and a confirmation_handle, and sends nothing. Set to true on the second call, after the user approved the preview. | |
| currency | No | ||
| due_date | No | ||
| tax_code | No | Document VAT category code (BT-118), e.g. `S` (standard), `Z` (zero), `E` (exempt), `AE` (reverse charge). Defaults to `S`, or `Z` when every line is zero-rated. | |
| allowances | No | Document-level allowances (BG-20) — deductions applied before tax. | |
| amount_due | No | Amount due for payment (BT-115), in the document currency. Use it for a document that is paid, fully or in part, before you send it: `0` for a fully prepaid document. Allowed on both `invoice` and `credit_note`. The value must be from `0` up to the document total with VAT (BT-112) plus `rounding_amount`, with at most two decimals. A value above that is refused with a 422 `amount_due_exceeds_total`. The prepaid amount (BT-113, `cbc:PrepaidAmount`) is not an input: it is the total with VAT plus `rounding_amount` less `amount_due`. If you omit the field, the amount due is the total with VAT plus `rounding_amount`, and the document has no prepaid amount. | |
| company_id | Yes | The company that sends, for example com_9fJ2kQ7bTx0Lm4Ne1Ry8. | |
| issue_date | Yes | ||
| vatex_note | No | VAT exemption reason text (BT-120). Applies at document level only. | |
| attachments | No | ||
| sales_order | No | Sales order reference (BT-14), `cac:OrderReference/cbc:SalesOrderID`: the seller's own order number. Without `purchase_order`, the `cbc:ID` of the order reference is `NA`. | |
| payment_means | No | How the document should be paid: one method, one reference, and one or more accounts. Use `accounts` for a bankgiro or plusgiro number or for more than one account. `iban` and `bic` are the older form of one `iban` account: they give a 400 together with `accounts`. An account number is required (BR-61, Payment account identifier BT-84): `iban` or `accounts`, for every `method`. When both are absent and `from` is the company of `company_id`, the `iban` of the company fills `iban` when, with spaces and dashes removed, it is a valid IBAN (15 to 34 characters, two letters, and the IBAN check digits). The compact value is stored. A `bic`, `method` and `reference` you send are kept, so `GET /v1/documents/{id}` and the UBL show it. With no account number after that, the document is rejected with `payment_account_required` (422, `param` `payment_means`) before any charge. A document without `payment_means` is not checked. Required by Peppol when seller and buyer are both in Germany (DE-R-001): without `payment_means` the document is rejected with `de_domestic_fields_missing` (422). | |
| invoice_period | No | Invoicing period (BG-14) — the service or billing date range. | |
| purchase_order | No | Purchase order reference (BT-13), `cac:OrderReference/cbc:ID`: the number of the buyer's purchase order. | |
| buyer_reference | No | Buyer reference (BT-10), `cbc:BuyerReference`: the reference the buyer asks for, for example a cost centre or a Leitweg-ID. It is not copied to `cac:OrderReference/cbc:ID` (BT-13): send a purchase order in `purchase_order`. Without `buyer_reference`, a document gets `purchase_order`, else `to.identifier`, else `Unknown` as BT-10. Required in two cases. When seller and buyer are both in Germany (DE-R-015): without it the document is rejected with `de_domestic_fields_missing` (422). When the receiver is a German public body (a `0204` Peppol ID): it holds the Leitweg-ID, and without it the document is rejected with `buyer_reference_required` (422). | |
| idempotency_key | Yes | Required. A unique key for this document, for example its number. A retry with the same key returns the first document and does not send again. | |
| rounding_amount | No | Rounding amount (BT-114, `cbc:PayableRoundingAmount`), in the document currency: the signed amount that rounds the amount due, for example to whole kronor. Allowed on both `invoice` and `credit_note`, for any seller country and currency. The amount due (BT-115) is the total with VAT (BT-112) less the prepaid amount (BT-113) plus `rounding_amount`. `total` does not include it. With an `amount_due`, send the rounded amount: an `amount_due` equal to the total, with a rounding that is not `0`, is refused with a 422 `amount_due_excludes_rounding` when the rounding is positive, and with a 422 `amount_due_exceeds_total` when it is negative. The value has at most two decimals and must be below `1.00` either way. A value of `1.00` or more, or one that takes the total below `0`, is refused with a 422 `rounding_amount_out_of_range`. With `0` the document has no rounding amount in the UBL. | |
| preceding_invoice | No | Preceding invoice reference — the earlier invoice this document corrects, for example the invoice a credit note credits. Allowed on both `invoice` and `credit_note`; one reference per document. The value is an opaque reference that you supply. It is not looked up or checked against an earlier peppol.sh document. It is emitted as `cac:BillingReference/cac:InvoiceDocumentReference`. | |
| confirmation_handle | No | Live only. The confirmation_handle of the preview. It works once, for 10 minutes, with the same API key and the same document. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | ||
| sent | Yes | True when the document was accepted for sending. | |
| preview | Yes | Live only: the document as it will be sent. Its text comes from the document, not from peppol.sh. | |
| document | Yes | ||
| expires_at | Yes | ||
| credit_cost | Yes | ||
| credits_remaining | Yes | The credit balance of the workspace after this call. | |
| confirmation_handle | Yes |