When buying services or goods, if a self billed document is needed, you are required to issue a “Proof of Expenditure Bill”.
This guide demonstrates how to create a “Proof of Expenditure” / non-liable Issuer bill, for individual suppliers in Greece (myDATA document type “3.1 Proof of Expenditure Bill”)
- The guide assumes you’re working on a new Elorus organization, so this step can be omitted.
First lets create a supplier so there is someone to get billed from. In a business context, contacts are individuals or businesses whom you transact with; typically your clients, leads, suppliers and partners. Since Elorus will let you manage your sales as well as your expenses, a contact may represent either a client or a supplier (or even both).
curl -X POST -H "Content-Type: application/json" -H "Authorization: Token ~Your-API-key~" -H "X-Elorus-Organization: ~Your-Organization-ID~" https://api.elorus.com/v1.1/contacts/ -d '{"client_type": "1", "company":"Προμηθευτής", "vat_number":"9876543210", "addresses":[{"address":"Theofilopoulou 13", "city":"Athens", "zip":"11743", "country": "GR", "ad_type": "bill"}], "is_client": false, "is_supplier":true}'
Filter e.g. by “company”, to get the contact ID. Retrieved contact ID in this case is “2608266726156011067”.
curl -X GET -H "Content-Type: application/json" -H "Authorization: Token ~Your-API-key~" -H "X-Elorus-Organization: ~Your-Organization-ID~" https://api.elorus.com/v1.1/contacts/?company="Προμηθευτής"
In this case, a “Proof of Expenditure” document type will be needed. There is no “Proof of Expenditure” document type pre-created and API does not support document type creation. So in order to create it, use of Elorus' UI is mandatory.
Search by “title”, to get the document type ID. Retrieved document type ID in this case is “2569066492662384486”.
curl -X GET -H "Content-Type: application/json" -H "Authorization: Token ~Your-API-key~" -H "X-Elorus-Organization: ~Your-Organization-ID~" https://api.elorus.com/v1.1/documenttypes/?search="Τίτλος Κτήσης"&search_fields=title
This document is not subject to VAT.
The final step, is to create the Bill itself. The list below describes all the needed fields.
curl -X POST -H "Content-Type: application/json" -H "Authorization: Token ~Your-API-key~" -H "X-Elorus-Organization: ~Your-Organization-ID~" "https://api.elorus.com/v1.1/bills/" -d '{"self_billed":"true", "draft": "true", "calculator_mode": "total", "documenttype":"2569066492662384486", "mydata_document_type": "3.1", "supplier":"2608266726156011067", "items": [{"expense_category": "2491779621532468668", "title": "Αναβάθμιση λογισμικού", "unit_total": "12.4", "quantity": "2", "mydata_classification_category": "category2_1", "mydata_classification_type": "E3_102_002"}], "paid_on_receipt": "12.4", "payment_method": "3"}'