Attach Source Document
attach_documentAttach a PDF, JPG, or PNG source document to a purchase invoice, sale invoice, journal, or bank transaction. Replace existing documents when needed to meet RPS requirements.
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.
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. |