When selling goods to private individuals, you are required to issue a “Sales receipt” (myDATA document type 11.1). Typically, sales receipts must be specially marked for taxation purposes. Elorus integrates with SoftOne EINVOICING, a certified provider of electronic invoicing services, to issue legally stamped receipts.
- The guide assumes you’re working on a new Elorus organization, so this step can be omitted.
First lets create a contact so there is someone to bill. Since the case is a “Retail Sales Receipt” no VAT number is needed and only minimal contact information will be used. 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": "4", "first_name": "Πελάτης", "last_name":"Λιανικής", "is_client": true, "is_supplier":false}'
Search e.g. by “first_name” & “last_name”, to get the contact ID. Retrieved contact ID in this case is “2476845216061982422”.
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/?search="Πελάτης Λιανικής"&search_fields=first_name,last_name
In this case, a “Retail Sales Receipt” document type will be needed. There is no “Retail Sales Receipt” 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 “2476894925484984004”.
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
By default there are some taxes preset in Elorus. Usually 24% tax is used for Greece “Retail Sales Receipt” so the preset tax will be retrieved and used. In case there is a need for a new tax to be created, use of Elorus' UI is mandatory.
Optional steps to create new tax:
Search by “percentage”, to get the tax ID. Retrieved tax ID in this case is “2476911428611605999”. Make sure that “aade_type”:1 is in the response packet.
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/taxes/?search="24"&search_fields=percentage
The final step, is to create the Receipt 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/invoices/ -d '{"calculator_mode": "total", "currency_code": "EUR", "exchange_rate": "1.000000", "client": "2476845216061982422", "date": "2022-5-11", "draft": true, "documenttype": "2476894925484984004", "mydata_document_type": "11.1", "items": [{"title": "Γάντια Εργασίας", "unit_total": "12.4", "quantity": "1", "taxes": ["2476911428611605999"], "mydata_classification_category": "category1_2", "mydata_classification_type": "E3_561_003"}], "paid_on_receipt": "12.4", "payment_method": "3"}'