/api/attachments/
GET
URL: https://api.erplybooks.com/api/attachments
Query parameters:
- documentId
- changedSince – seconds ago. Meaning when you add 1000, then it searches seconds ago from current time
DELETE
URL: https://api.erplybooks.com/api/attachments/{attachmentId}
POST
URL: https://api.erplybooks.com/api/attachments
Json: {“documentId”:DocumentID,”filename”:”FileName.png”,”base64″:”data:image/png;base64,XXXXX”}
Adding attachments via API can be done in three ways:
- Add attachment to existing invoice (add documentId)
- Add attachment to Purchase Inbox (do not add documentId)
- Add attachment and create expense document instantly (fill all the possible fields)
If you want to create expense document instantly then make sure you add at least total field. If this has value then document is created.
FIELD NAME | TYPE | DESCRIPTION | REQUIRED |
---|---|---|---|
id | long | Attachment ID (internal) | |
documentId | long | Document ID (internal) | |
partnerDocumentId | String | DocumDocument ID (From external system)ent ID (From ERPLY) | |
attributeId | long | This is readable value and is returned when saving document to Purchase Inbox | |
filename | String | Name of the file | |
number | String | Invoice number. If missing then default value is “undefined” | |
contactName | String | Supplier name. If missing then default value is “undefined” | |
expenseType | String | Expense category. If filled then system finds corresponding expense account (by name/number) and fills invoice row description with given text | |
netTotal | decimal | Net total value of the document. If not available then by default total = netTotal and tax = 0 is used | |
total | decimal | Total value of the expense document. If you need to track VAT/GST then this is the total document value. NB: if you want to add attachment to invoice or Purchase Inbox then total must be null! | |
description | String | If available then used as expense description | |
taxRateId | long | If available then used as invoice tax rate | |
base64 | String | File in base 64 format |