As Printess is a pure integration product one can use in any eCommerce System, landing page or mobile App we clearly have a set of comprehensive API’s to enable you to realize your business idea.
Once you have created yourself an account you will find some important API tokens (secret keys) in your Account in the Account Menu to the right of the Top Bar.
Once selected the Token Dialogue is shown where three different Tokens can be copied from:
Demo-Token The demo token is used for the editor and only allows loading of Templates and Snippets. With this Token no buyer data like images can be uploaded.
Shop-Token The shop token allows loading of Templates and Snippets, upload images and saving / loading the current layout
Service-Token The secret service token has access to the production API and can render PDFs or PNGs. It will be shown only on Accounts with administrative access.
Embedd Here you find an easy embedding example code for the current document. See Below Ebedd as iframe.
The service token should only get used on server side to process orders. With it billable orders can be started. To protect your account never embedd the service token into a web-site!
This is the most easy way to embedd an editor in any webpage or system. It just needs a few lines of code an you have an editor embedded in your website, your shop or wherever you can insert html.
Try it yourself: Just open any of your templates (Should have a configured Buyer Side). Open the token Window and click on Embedd. A ready made code example for this document with the shop token embedded and the template name integrated will get displayed.
Now visit one of the countless webpage test offerings e.g. click here to open codepen
Copy and paste the embedd code into the html window of codepen. And voila a your first buyer configurable Printess Document will be loaded and the editor in buyer mode will open.
The following parameters should get customized when embedding into your ecommerce infrastructure:
name - this parameter holds the template name to load. This Parameter can also take an ID of a customer edit and will then load the customer edited document (see below).
basketId - this should contain your user or basketID to allow users to upload images which are private to them / to this session
token - by default this is the Shop-Token (s.a.) if no upload should be possible you might like to change it into your Demo-Token
All parameters must be URL-encoded (e.g. a space will be represented by ‘%20’)
There is also a button for saving customer edits of the document just like an add to card button would do to save a customer order into a shoping basket. The return value of this API call is an ID under which this customer edit can either get ordered as a print file or get loaded again by supplying it to as template name, or if the editor is already open by using loadJson like in the example code.
The Printess Editor can also be used as a modern Web Component directly in a webpage. This will also make it possible to build your individual UI around the editor but still use the advanced Buyer Side configuration within the Editor. Please visit our GitHub page with more instructions and see working code examples.
Once a document is ready for production one can order print-ready files with the help of the Printess Backend API. To make testing and integration into any order processing backend easy we’ve created an OpenAPI for you, which can be used in Postman for example (and many more tools).