Attach Source Document
attach_documentAttach a PDF, JPG, or PNG source document to a purchase invoice, sale invoice, journal, or bank transaction, with optional replacement if one already exists.
Instructions
Attach a source document (PDF/JPG/PNG) to a purchase invoice, sale invoice, journal, or bank transaction. A record holds one document: an existing one is refused (document_exists) unless replace_existing=true, which overwrites it. RPS requires a source document on every accounting entry; manual journals and directly-booked transactions need one 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": {
"entity_type": "<entity_type>",
"id": "<id>",
"file_path": "<file_path>"
},
"name": "attach_document"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | ID of the record to attach the document to. | |
| file_name | No | Name for the uploaded document; defaults to the source file's name. The file's extension is kept. | |
| file_path | Yes | Absolute path to the source document (PDF/JPG/PNG), or inline content as base64:<data> or base64:<ext>:<data>. | |
| entity_type | Yes | Which record the source document belongs to. | |
| replace_existing | No | Overwrite a document already attached to the record (the old file is lost). Default false: refuse with document_exists. |