Create documents
This guide describes how to create or upload invoices and credit notes in xTool — via the web interface or API.
Methods
| Method | Web | API |
|---|---|---|
| Form (model) | Documents → Create → choose format and direction → fill the form. | POST upload model (JSON body). |
| XML | Documents → Upload → select file; format can be specified or auto-detected. | POST upload XML with file or body. |
| Documents → Upload → select PDF. See Upload PDF. | — | |
| CSV import | Documents → Import → select xTool CSV file. | POST import CSV with file or body. See Import documents. |
| From template | Documents → Create → Create from Template. | — |
The result is a document with an id. You can then send it (Peppol, email), view it, or use validation/convert endpoints. See Document model and Formats.
Web: Create from form
- Documents → Create.
- Choose format (e.g. XRechnung UBL, Peppol BIS Billing) and direction (outbound / inbound).
- Fill in the required fields (seller, buyer, lines, amounts, etc.). Required fields depend on the format.
- Save. The document is created and appears in the list. You can then send it or edit it.
If your organisation has invoice templates, the Create page also shows Create from Template. Choose a template and click Use Selected Template. xTool opens the new document for editing so you can change the number, dates, and amounts.
If your organisation has partners, choose a Customer in the buyer section to copy name, address, identifiers, Peppol endpoint, and payment details into the form.
Web: Upload XML
- Documents → Upload.
- Select the XML file (or paste content if the interface allows).
- Optionally specify the format; otherwise it is detected from the file.
- Confirm. The document is created from the XML.
Web: Upload PDF
- Documents → Upload.
- Select a PDF file.
- Confirm. For ZUGFeRD / Factur-X, invoice data is taken from the file. For a scan or ordinary PDF, convert it later — see Upload PDF.
API: Upload model (JSON)
Send a POST request to the upload model endpoint with a JSON body that matches the format model for the chosen format.
Endpoint: POST /api/v2/documents/upload/model
Headers: x-api-key, Content-Type: application/json
Body: JSON according to the format (e.g. base model or minimal model). See Format models and Base model example.
The response contains the created document (including id). You can use this id for send, get, or list.
API: Upload XML
Send a POST request to the upload XML endpoint with the XML file or raw XML body.
Endpoint: POST /api/v2/documents/upload/xml
Headers: x-api-key, Content-Type: application/xml (or multipart if your client sends a file).
Body: XML invoice or credit note in a supported format (e.g. XRechnung UBL, Peppol BIS).
The response contains the created document (including id). Format is usually detected from the XML; some APIs allow specifying the format explicitly.
Next steps
- Upload and convert a PDF invoice — Upload PDF.
- Reuse invoice content — Invoice templates.
- Reuse a customer — Partners.
- Send document — Send via Peppol, Send by email.
- Validate before sending — Validate and convert.