Integration with your administration (optional implementation)

To simplify and automate processes that occur after order creation, we have prepared an API that can be integrated directly into your e-commerce administration.

Currently, you can activate an invoice and obtain a PDF link. We are also preparing an API for invoice cancellation, returns, and invoice item modifications.

Invoice Activation

You can activate an invoice not only through our administration but also via the API when shipping the goods. We recommend triggering the activation, for example, when changing the order status to "Shipped".

Implementation Method

When using the PHP library, simply call the Twisto::activateInvoice method.

After activating the invoice, you will receive the following response:

{ "pdf_url": "https://api.twisto.cz/invoice/jsukzkf8qb24a0w92gh0b5ragdixz5yf2jv3xiq72deol3v6yp/10100001.pdf" }

Example usage

<?php // stačí zavolat metodu activateInvoice a vrátí se url přímo na PDF fakturu $twisto = new Twisto\Twisto(); $twisto->setPublicKey(''); $twisto->setSecretKey(''); // vámi získané invoice_id z databáze $invoice_id = '10100001' try { // url na pdf si můžete uložit a přidat na něj odkaz do vaší administrace $pdf_url = $twisto->activateInvoice($invoice_id); } catch (Twisto\Error $e) { // faktura mohla být např. zrušena jen v Twisto administraci, neexpedujte prosím takovou objednávku na vaší straně } ?>