TECTRA Ltd’s Offer API is an internal microservice that utilizes a simple syntax for parsing the positions of a quotation to a customer, and generates a print-ready view with manually-customizable fields (customer, payment terms, recipient, lead time, etc.)
How it works
All of the fields can also be populated with a GET request to the API, which makes it possible to generate ready-to-PDF offers straight from the data in the company’s standardized pricing spreadsheet .
- The “shopping cart” of the offer is represented as comma-separated strings that are easily parsed:
[item code] | [!MPN] x[quantity] @[unit price]
- The item descriptions are pulled from the ProductItems API
- The company information is pulled from the VATcheck API , which pulls from GSIS (the Greek Secretariat for Information Systems)
- The rest of the information is passed as query parameters to a GET endpoint, and this makes the API callable from LibreOffice with the
WEBSERVICE()
function - Thanks to Bootstrap 5 theming, the print-only view of the generated offer matches the company’s document template of 20+ years
Evolved functionality
Since its inception in June 2022, I have further developed the system and made it interoperable with other APIs/microservices of the company:
-
The system embeds a QR code with a ULID on every page of the offer that leads to TECtrack (deployed at track.tectra.gr ), another service I developed for order tracking (see example ) that uses FastAPI in the frontend, Django Ninja and Django Admin for the business backend, and Yggdrasil for tunneling between them.
-
In case a further customization of the offer is required, an ODT template (including the QR code) is customized on the fly using relatorio and the API makes it downloadable with a FastAPI StreamingResponse .