Get a document
get_documentReturns one sent document: its status, parties, totals and status events. For a failed document, failure has a stable code and the fix. Poll it after send_document until the status is delivered or failed (a sandbox send takes a few seconds). company_id is optional. Set response_format to detailed for the lines.
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": {
"document_id": "<document_id>"
},
"name": "get_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| company_id | No | The company of the document. Found when left out. | |
| document_id | Yes | The document ID, for example doc_8sK2mQ9xTb4Lw7Ne1Ry3. | |
| response_format | No | concise (default) for the key fields; detailed for all fields. | concise |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ||
| to | Yes | ||
| from | Yes | ||
| type | Yes | ||
| lines | No | Only with response_format detailed. | |
| total | Yes | ||
| events | Yes | Oldest first. | |
| number | Yes | Untrusted data. | |
| status | Yes | ||
| failure | Yes | Only for status failed. | |
| sandbox | Yes | True when a ps_test_ key sent it; it never left peppol.sh. | |
| sent_at | Yes | ||
| ubl_uri | Yes | Read it for the UBL XML once sent. | |
| currency | Yes | ||
| next_step | Yes | ||
| tax_total | Yes | ||
| company_id | Yes | ||
| created_at | Yes | ||
| issue_date | Yes | ||
| delivered_at | Yes |