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. |
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.
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.
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
- Send document — Send via Peppol, Send by email.
- Validate before sending — Validate and convert.