Developer's Guide - Faktury Online API

Guide of Faktury Online API usage and samples of source code

Before you start...

You need to know your API key. The API key is a 32-character string required for using the API. Never share your API key with anyone. You will find your unique API key in your profile, right after logging in, on the welcome page.

Creating a new invoice

API call for creating a new invoice:
https://www.faktury-online.com/api/nf?data={JSON}
The following tables list the parameters you can use to create a new invoice.

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
apitest optional parameter The apitest parameter specifies whether the created invoice is for testing purposes only. This parameter should be used only by developers implementing the Faktury Online API. The system will treat the created invoice as a test one and will delete it within 5 to 10 minutes. We recommend keeping this value enabled while testing your API implementation. Disable this value in production, otherwise the invoices will be deleted automatically.
Possible values: 1 or 0
Default value: 0
Supplier parameters:
The supplier can be selected either by the d_id parameter, referring to a supplier stored in the My companies list (option 1), or by filling in all the required details in the parameters (option 2).
Parameter Attribute Description
d_id option 1 / required parameter Supplier ID (you will find the ID in the My companies list).
d_name option 2 / required parameter Supplier's business name.
d_street option 2 / optional parameter Supplier's street.
d_city option 2 / optional parameter Supplier's city.
d_state option 2 / optional parameter Supplier's country.
d_zip option 2 / optional parameter Supplier's postal code.
d_ico option 2 / optional parameter Supplier's Company ID (IČO).
d_dic option 2 / optional parameter Supplier's Tax ID (DIČ).
d_icdph option 2 / optional parameter Supplier's VAT ID (IČ DPH).
d_vatpayer option 2 / optional parameter VAT payer.
Possible values:
VAT payer: 1
Non-VAT payer: 0
Default value: 0
d_viewpayer option 2 / optional parameter Show on the invoice whether the supplier is a VAT payer.
Possible values:
Yes: 1
No: 0
Default value: 1
d_info option 2 / optional parameter Supplier information.
d_bankaccount option 2 / optional parameter Supplier's bank account number.
d_bank option 2 / optional parameter Supplier's bank name.
d_iban option 2 / optional parameter Supplier's IBAN.
d_swift option 2 / optional parameter Supplier's SWIFT.
d_email option 2 / optional parameter Supplier's e-mail.
d_web option 2 / optional parameter Supplier's website.
d_phone option 2 / optional parameter Supplier's phone.
d_custom_key_1 option 2 / optional parameter Custom field no. 1 - key
d_custom_value_1 option 2 / optional parameter Custom field no. 1 - value
d_custom_key_2 option 2 / optional parameter Custom field no. 2 - key
d_custom_value_2 option 2 / optional parameter Custom field no. 2 - value
Customer parameters:
Parameter Attribute Description
o_name required parameter Customer's business name.
o_street optional parameter Customer's street.
o_city optional parameter Customer's city.
o_state optional parameter Customer's country.
o_zip optional parameter Customer's postal code.
o_ico optional parameter Customer's Company ID (IČO).
o_dic optional parameter Customer's Tax ID (DIČ).
o_icdph optional parameter Customer's VAT ID (IČ DPH).
o_email optional parameter Customer's e-mail.
o_name_d optional parameter Delivery address - business name.
o_street_d optional parameter Delivery address - street.
o_city_d optional parameter Delivery address - city.
o_state_d optional parameter Delivery address - country.
o_zip_d optional parameter Delivery address - postal code.
o_custom_key_1 option 2 / optional parameter Custom field no. 1 - key
o_custom_value_1 option 2 / optional parameter Custom field no. 1 - value
o_custom_key_2 option 2 / optional parameter Custom field no. 2 - key
o_custom_value_2 option 2 / optional parameter Custom field no. 2 - value
Invoice parameters:
Parameter Attribute Description
f_number optional parameter Invoice number. If not provided, the number is automatically incremented by 1 from the most recently created invoice (the issue date is decisive; the invoice number must be numeric).
f_vs optional parameter Variable symbol.
f_ks optional parameter Constant symbol.
f_date_issue optional parameter Issue date. In the YYYY-MM-DD format.
Default value: current date
f_date_delivery optional parameter Delivery date. In the YYYY-MM-DD format.
Default value: current date
f_date_due optional parameter Due date. In the YYYY-MM-DD format.
Default value: 14 days from the current date
f_date_payment optional parameter Date of the received payment for invoice type 5, in the YYYY-MM-DD format.
Default value: current date
f_issued_by optional parameter Invoice issued by.
f_order optional parameter Order number.
f_payment optional parameter Payment method.
Possible values:
Bank transfer: prevod
Postal order: poukazka
Cash: hotovost
Cash on delivery: dobierka
Cash register: pokladna
Online payment provider: eprovider
Payment card: karta
Offset (set-off): zapocet
Other: ina
Default value: prevod
f_note_above optional parameter Invoice note. Displayed above the invoice items.
f_note optional parameter Invoice note. Displayed below the invoice items. If the supplier is selected by the d_id parameter and f_note is empty, the note stored for that supplier is displayed.
f_internal_note optional parameter Internal note. For internal use only. It is not shown on the issued invoice; it is visible only in the document detail in the system.
f_logo optional parameter Logo display.
Possible values:
Not shown: 0
Shown: 1 (only if the supplier was loaded by d_id and has a logo stored)
f_stamp optional parameter Stamp display.
Possible values:
Not shown: 0
Shown: 1 (only if the supplier was loaded by d_id and has a stamp stored)
f_currency optional parameter Invoice currency. Currency code. The default value is EUR.
Default value: EUR
f_type optional parameter Invoice type.
Possible values:
1: invoice
2: proforma invoice
3: credit note
4: debit note
5: receipt for a received payment
Default value: 1
f_original_num required for invoice types 3 and 4 / optional parameter A credit note or a debit note must include a reference to the original document.
Default value: 0
f_paid optional parameter Amount already paid by non-tax advance payments. The value is not used in a receipt for a received payment.
Default value: 0
f_fullpaid optional parameter Forces the “ALREADY PAID” note in the document footer instead of the amount due. Use it when the document is already paid at the time of issue (e.g. prepayment, e-shop). It is independent of the f_paid parameter (amount paid by advance payments) and of the invoice payment status in the system.
Possible values:
0: not shown (default)
1: shows the “ALREADY PAID” note
Default value: 0
f_rounding optional parameter Rounding of the total amount due
Possible values:
0: no rounding
1: round up to a whole number
2: round down to a whole number
3: round to 5 hundredths (5 cents)
Default value: 0
f_style optional parameter Visual style of the invoice.
Possible values:
styl_1
styl_2
styl_3
styl_4
styl_5
styl_6
styl_7 (default designer template)
Default value: styl_1
f_language optional parameter Invoice language.
Possible values:
SK, CS, EN, DE, FR, ES, IT, HU, PL, RU, NO, DK
Default value: SK
f_qr optional parameter Show a payment QR code.
Possible values:
0: do not show
1: pay-by-square
2: SPD format
3: EPC format
Default value: 1
f_omit_stats optional parameter Exclude the value from statistics.
Possible values:
0: do not exclude
1: exclude
Default value: 0
f_custom optional parameter Any text information sent via the API. It is shown as a separate column in the Excel export.
text, max. 50 characters
f_vat_regime optional parameter VAT regime for the whole invoice.
Possible values:
0: Standard regime
1: Reverse charge
2: VAT exemption
Default value: 0
f_tags optional parameter A list (array) of tags from the My labels / tags list to be assigned to the document. Format:
Array
(
    [0] => Tag name 1
    [1] => Tag name 2
)
Invoice item parameters:
Parameter Attribute Description
p_text required parameter Invoice item text.
p_quantity required parameter Quantity. Number.
p_unit required parameter Unit of measure. For example kg, pcs, ...
p_price option 1 / optional parameter Price per unit of measure excluding tax. The price including VAT is calculated from this value. If this attribute is not provided, the p_pricevat attribute must be provided. For non-VAT payers this parameter is required.
p_vat optional parameter Tax in percent. Fill in only if the supplier is a VAT payer.
p_pricevat option 2 / optional parameter Price per unit of measure including tax. If this attribute is provided, the price excluding tax is calculated from it regardless of whether the p_price attribute was provided.
p_regime optional parameter VAT regime of the item. If the invoice is set to the standard VAT regime, the VAT regime can also be set separately for individual items.
Possible values:
0: Standard regime
1: Reverse charge
2: VAT exemption
Default value: 0
p_custom optional parameter Any text information sent via the API for the invoice item. It is shown as a separate column in the Excel export.
text, max. 50 characters
Data format before sending:
Array
(
    [key] => dJyMc*53@687*wGhofIWi!WDcEEQUdmj
    [email] => name@example.com
    [apitest] => 1
    [d] => Array
        (
            [d_name] => Moja spoločnosť s.r.o.
            [d_street] => Mostová 56
            [d_city] => Trenčín
            [d_zip] => 843 21
            [d_state] => Slovensko
            [d_ico] => 43226520
            [d_dic] => 2165052345
            [d_icdph] => SK2165052345
            [d_vatpayer] => 1
            [d_viewpayer] => 1
            [d_info] => Zapísaný v OR Trenčín, oddiel: Sro, vl.č.1234/X
            [d_bankaccount] => 1234567890/0200
            [d_bank] => VÚB banka
            [d_iban] => SK6702000000001234567890
            [d_swift] => SUBASKBX
            [d_email] => info@example.com
            [d_web] => www.example.com
            [d_phone] => +421 903 111 111
        )

    [o] => Array
        (
            [o_name] => Andrej Klačanský
            [o_street] => Štefánikova 455/2
            [o_city] => Martin
            [o_zip] => 876 54
            [o_state] => Slovensko
            [o_ico] => 
            [o_dic] => 
            [o_icdph] => 
            [o_email] => client@example.com
        )

    [f] => Array
        (
            [f_number] => 2024099
            [f_vs] => 2024099
            [f_ks] => 308
            [f_date_issue] => 2024-02-14
            [f_date_delivery] => 2024-02-14
            [f_date_due] => 2024-02-28
            [f_issued_by] => Moja spoločnosť s.r.o.
            [f_payment] => prevod
            [f_logo] => 1
            [f_stamp] => 0
            [f_currency] => EUR
            [f_type] => 1
            [f_paid] => 
            [f_rounding] => 0
            [f_style] => standard
            [f_language] => SK
            [f_qr] => 1
            [f_order] => OBJ-2017-514
            [f_tags] => Array
                (
                    [0] => VIP klient
                    [1] => Doprava zdarma
                )

        )

    [p] => Array
        (
            [0] => Array
                (
                    [p_text] => Maliarske práce
                    [p_quantity] => 3
                    [p_unit] => hod
                    [p_price] => 15
                    [p_vat] => 20
                )

            [1] => Array
                (
                    [p_text] => Upratovacie práce
                    [p_quantity] => 2
                    [p_unit] => hod
                    [p_vat] => 20
                    [p_pricevat] => 14.4
                )

        )

)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine, the invoice was created
2 Error The data parameter was not sent via the GET method.
3 Error The API key is missing or has an invalid number of characters.
4 Error The API key is not entered correctly.
5 Error The email parameter is missing.
6 Error The username or the API key is not correct.
7 Error The user does not exist.
8 Error The supplier ID or the supplier name must be provided.
9 Error Cancelled
10 Error The provided supplier ID is not correct.
11 Error The supplier name is missing.
12 Error The customer name is missing.
13 Error Invoice data is missing.
14 Error Invoice items are missing or not entered correctly.
15 Error Error in an invoice item, a required value is missing.
16 Error The quantity in an invoice item is not a number.
17 Error The price excluding tax in an invoice item is not a number.
18 Error The tax in percent is not entered correctly.
19 Error An invoice item has neither a price excluding tax nor a price including tax.
20 Error Unsupported invoice language.
21 Error An invoice item has no price excluding tax while the supplier is not a VAT payer.
22 Error The price including tax in an invoice item is not a number.
23 Error A credit note or a debit note must include a reference to the original document f_original_num.
24 Error The total amount of a credit note must be negative.
25 Error The received payment date f_date_payment in a receipt for a received payment is not entered correctly.
26 Error A receipt for a received payment must not contain the received advance payments value f_paid.
27 Error Invalid VAT regime, the value is out of the allowed range.
28 Error The selected VAT regime requires the supplier to be a VAT payer.
Sample source code:
<?php

// Príprava základných dát
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// V prípade, že budeme testovať API, zvolíme hodnotu 1
// Znamená to, že všetky vytvorené faktúry sa automaticky odstránia o 5 - 10 minút od vytvorenia
$data['apitest'] = 1; //hodnota môže byť 1 alebo 0


// Príprava dát dodávateľa
$dodavatel = [];

// Údaje dodávateľa môžeme použiť buď z uložených záznamov v zozname Moje spoločnosti
// alebo údaje dodávateľa vložíme zadaním dát.
// Ak použijeme existujúceho dodávateľa, vložíme iba jeho ID.
// $dodavatel['d_id'] = 123; // ID dodávateľa nájdeme v zozname Moje spoločnosti

// alebo (nie obe):
$dodavatel['d_name'] = "Moja spoločnosť s.r.o."; // Obchodný názov dodávateľa
$dodavatel['d_street'] = "Mostová 56"; // Ulica
$dodavatel['d_city'] = "Trenčín"; // Mesto
$dodavatel['d_zip'] = "843 21"; // PSČ
$dodavatel['d_state'] = "Slovensko"; // Štát
$dodavatel['d_ico'] = "43226520"; // IČO
$dodavatel['d_dic'] = "2165052345"; // DIČ
$dodavatel['d_icdph'] = "SK2165052345"; // IČDPH
$dodavatel['d_vatpayer'] = "1"; // Platiteľ DPH. Pokiaľ je dodávateľ platiteľom DPH ponechajte
// hodnotu 1, ak nie je platiteľom DPH, napíšte 0.
$dodavatel['d_viewpayer'] = "1"; //  Pokiaľ chcete zobraziť informáciu na faktúre,
// že dodávateľ je/nie je platiteľom DPH.
$dodavatel['d_info'] = "Zapísaný v OR Trenčín, oddiel: Sro, vl.č.1234/X"; //Info o dodávateľovi
$dodavatel['d_bankaccount'] = "1234567890/0200"; // Číslo účtu
$dodavatel['d_bank'] = "VÚB banka"; // Názov banky
$dodavatel['d_iban'] = "SK6702000000001234567890"; // IBAN
$dodavatel['d_swift'] = "SUBASKBX"; // SWIFT
$dodavatel['d_email'] = "info@example.com"; // E-mail
$dodavatel['d_web'] = "www.example.com"; // WEB
$dodavatel['d_phone'] = "+421 903 111 111"; // Telefón

// Pridanie dodávateľa k dátam:
$data['d'] = $dodavatel;


// Príprava dát odberateľa
$odberatel = [];
$odberatel['o_name'] = "Andrej Klačanský"; // Názov odberateľa
$odberatel['o_street'] = "Štefánikova 455/2"; // Ulica
$odberatel['o_city'] = "Martin"; // Mesto
$odberatel['o_zip'] = "876 54"; // PSČ
$odberatel['o_state'] = "Slovensko"; // Štát
$odberatel['o_ico'] = ""; // IČO
$odberatel['o_dic'] = ""; // DIČ
$odberatel['o_icdph'] = ""; // IČDPH
$odberatel['o_email'] = "client@example.com"; // Email odberateľa

// Pridanie odberateľa k dátam:
$data['o'] = $odberatel;


// Príprava fakturačných údajov
$faktura = [];

// Číslo faktúry môžeme zadať ručne:
$faktura['f_number'] = "2024099";
// Ak chceme vypočítať číslo faktúry automaticky, toto pole neuvedieme. Odporúča sa však
// mať zapnuté a nastavené automatické číslovanie faktúr pre vybraného dodávateľa.

$faktura['f_vs'] = "2024099"; // Variabilný symbol
$faktura['f_ks'] = "308"; // Konštantný symbol
$faktura['f_date_issue'] = '2024-02-14'; // Dátum vystavenia vo formáte RRRR-MM-DD
$faktura['f_date_delivery'] = '2024-02-14'; // Dátum dodania vo formáte RRRR-MM-DD
$faktura['f_date_due'] = '2024-02-28'; // Dátum splatnosti vo formáte RRRR-MM-DD
$faktura['f_issued_by'] = "Moja spoločnosť s.r.o.";  //Faktúru vystavil
$faktura['f_payment'] = "prevod";   //Druh plaby. Na výber sú "prevod", "poukazka",
// "hotovost", "dobierka", "registracna_pokladna", "ina",  "eprovider"
$faktura['f_logo'] = "1";   // Zobraziť logo dodávateľa. Iba v prípade, že bol
// dodávateľ vybraný pomocou ID a má uložené logo.
$faktura['f_stamp'] = "0";  // Nezobraziť pečiatku
$faktura['f_currency'] = "EUR";  //Mena faktúry
$faktura['f_type'] = "1";  // Faktúra
$faktura['f_paid'] = "";  // Už uhradená suma nedaňovými zálohami
$faktura['f_rounding'] = "0";  // Zaokrúhlenie - žiadne
$faktura['f_style'] = "standard";  // Štýl faktúry. Možnosti sú standard alebo classic
$faktura['f_language'] = "SK";   // Jazyk faktúry: SK, CZ, EN, DE, ES, IT, FR, HU, PL, NO, RU
$faktura['f_qr'] = "1";   // Zobraziť QR kód (PAY by square)
$faktura['f_order'] = "OBJ-2017-514";  //Číslo objednávky
$faktura['f_tags'] = ["VIP klient", "Doprava zdarma"];  //Priradiť označenia k faktúre

// Pridanie fakturačných údajov k dátam:
$data['f'] = $faktura;


// Príprava fakturačných položiek
$polozky = [];
// prvá položka:
$polozka = [];
$polozka['p_text'] = "Maliarske práce"; // Názov služby alebo tovaru
$polozka['p_quantity'] = "3"; // Množstvo
$polozka['p_unit'] = "hod"; // Merná jednotka
$polozka['p_price'] = "15"; // Cena za jednu jednotku bez DPH (Cena s DPH sa vypočíta)
$polozka['p_vat'] = "20"; // Daň v %
// priradenie k položkám:
$polozky[] = $polozka;

// druhá položka:
$polozka = [];
$polozka['p_text'] = "Upratovacie práce"; // Názov služby alebo tovaru
$polozka['p_quantity'] = "2"; // Množstvo
$polozka['p_unit'] = "hod"; // Merná jednotka
$polozka['p_vat'] = "20"; // Daň v %
$polozka['p_pricevat'] = "14.4"; // Cena za jednu jednotku vrátane DPH (Cena bez DPH sa vypočíta)
// priradenie k položkám:
$polozky[] = $polozka;

// priradenie fakturačných položiek k dátam:
$data['p'] = $polozky;

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/nf?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);

// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    echo "Uložené, nová faktúra má kód: " . $result['code'] . " <br />";
    echo "Číslo faktúry: " . $result['number'] . " <br />";
    echo "Faktúra vytvorená: " . $result['created'] . " <br />";
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}

Response:
Array
(
    [status] => 1
    [code] => 1a35b89cd48eaf8940a6409ff45a0cc5
    [number] => 2024099
    [created] => 2024-02-15 17:45:12
)

Session initialization

Session initialization is required for working with documents, for example displaying an invoice, paying an invoice, viewing a quote detail and so on. API call for session initialization:
https://www.faktury-online.com/api/init?data={JSON}

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine, the session was initialized
102 Error The data parameter was not sent via the GET method.
103 Error The API key is missing or has an invalid number of characters.
104 Error The API key is not entered correctly.
105 Error The email parameter is missing.
106 Error The username or the API key is not correct.
107 Error The user does not exist.
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);
$result = json_decode($output, true);


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    echo "Sedenie bolo vytvorené";
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}

Response:
Array
(
    [status] => 1
)

Displaying an invoice

A session must be initialized before this call (see above). API call for displaying an invoice:
https://www.faktury-online.com/api/zf?data={JSON}

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
code required parameter Invoice code (obtained from the API response when the invoice was created)
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
    [code] => 26915945a67c8b7ba74dac59c5badfbf
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine
202 Error The data parameter was not sent via the GET method.
203 Error The API key is missing or has an invalid number of characters.
204 Error The API key is not entered correctly.
205 Error The email parameter is missing.
206 Error No session has been initialized
207 Error The initialized session is not valid
208 Error The username or the API key is not correct.
209 Error The user does not exist.
210 Error The invoice code is missing.
211 Error The invoice code is not entered correctly.
212 Error Error while selecting the invoice
213 Error Error while rendering the invoice template
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
// vytvori subor cookie.txt, pozor na prava na zapis
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);
$result = json_decode($output, true);

// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// Kód faktúry:
$data['code'] = "14915945a66c8b7be74dac59c5badfbf";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/zf?data=' . urlencode($data_json);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);
$result = json_decode($output, true);
$url = $result['url'];
$cislo = $result['number'];


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// pre zobrazenie faktúry:
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="' . $cislo . '.pdf"');
header('Cache-Control: private, max-age=0, must-revalidate');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
echo curl_exec($ch);


/*
// pre download faktúry:
header('Content-Type: application/download');
header('Content-Disposition: inline; filename="'.$cislo.'.pdf"');
header('Cache-Control: private, max-age=0, must-revalidate');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
echo curl_exec($ch);
*/

Response:
Array
(
    [status] => 1
    [url] => https://www.faktury-online.com/faktury/detail-subor?f=26915945a67c8b7ba74dac59c5badfbf
    [number] => FA2019015
)

Paying an invoice

A session must be initialized before this call (see above). API call for marking an invoice as paid:
https://www.faktury-online.com/api/uf?data={JSON}

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
code required parameter Invoice code (obtained from the API response when the invoice was created)
date optional parameter Invoice payment date
Default value: 'current date'
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
    [code] => 26915945a67c8b7ba74dac59c5badfbf
    [date] => 2019-06-01
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine
302 Error The data parameter was not sent via the GET method.
303 Error The API key is missing or has an invalid number of characters.
304 Error The API key is not entered correctly.
305 Error The email parameter is missing.
306 Error No session has been initialized
307 Error The initialized session is not valid
308 Error The username or the API key is not correct.
309 Error The user does not exist.
310 Error The invoice code is missing.
311 Error The invoice code is not entered correctly.
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);
$result = json_decode($output, true);

// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// Kód faktúry:
$data['code'] = "14915945a66c8b7be74dac59c5badfbf";
// Dátum úhrady
$data['date'] = "2017-06-01"; // prípadne žiadny záznam pre nastavenie dnešného dňa úhrady

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/uf?data=' . urlencode($data_json);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);
$result = json_decode($output, true);


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    echo "Faktúra bola uhradená";
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}



Response:
Array
(
    [status] => 1
)

Invoice status and detail

A session must be initialized before this call (see above). API call for displaying the invoice status and detail:
https://www.faktury-online.com/api/status?data={JSON}

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
code required parameter Invoice code (obtained from the API response when the invoice was created)
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
    [code] => 26915945a67c8b7ba74dac59c5badfbf
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine
402 Error The data parameter was not sent via the GET method.
403 Error The API key is missing or has an invalid number of characters.
404 Error The API key is not entered correctly.
405 Error The email parameter is missing.
406 Error No session has been initialized
407 Error The initialized session is not valid
408 Error The username or the API key is not correct.
409 Error The user does not exist.
410 Error The invoice code is missing.
411 Error The invoice code is not entered correctly.
412 Error Error while selecting the invoice
413 Error Error while rendering the invoice template
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);

// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// Kód faktúry:
$data['code'] = "14915945a66c8b7be74dac59c5badfbf";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/status?data=' . urlencode($data_json);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    echo "Dodávateľ: {$result['supplier']} \n";
    echo "Dodávateľ IČO: {$result['supplier_ico']} \n";
    echo "Odberateľ / Zákazník: {$result['customer']} \n";
    echo "Odberateľ / Zákazník IČO: {$result['customer_ico']} \n";
    // Možnosti: faktura, zalohova_faktura, dobropis, danovy_doklad
    echo "Typ faktúry: {$result['invoice_type']} \n";
    echo "Číslo faktúry: {$result['invoice_number']} \n";
    echo "Suma bez DPH: {$result['invoice_amount']} \n";
    if (isset($result['invoice_amount_vat'])){
        echo "Suma s DPH: {$result['invoice_amount_vat']} \n";
    }
    echo "Mena: {$result['invoice_currency']} \n";
    echo "Dátum vystavenia: {$result['invoice_date_issue']} \n";
    echo "Dátum dodania: {$result['invoice_date_delivery']} \n";
    echo "Dátum splatnosti: {$result['invoice_date_due']} \n";
    // Možnosti: ano, nie, ciastocne
    echo "Faktúra uhradená: {$result['invoice_paid']} \n";
    if ($result['invoice_paid'] != 'nie'){
        echo "Uhradená suma: {$result['invoice_paid_amount']} \n";
        echo "Dátum úhrady: {$result['invoice_date_payment']} \n";
    }
    echo "Vlastné dáta z API: {$result['invoice_api_custom']} \n";
    if (isset($result['invoice_tags']) && is_array($result['invoice_tags'])){
        echo "Tagy faktúry: ";
        echo implode(", ",$result['invoice_tags']);
    }
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}



Response:
Array
(
    [status] => 1
    [supplier] => Moja firma s.r.o.
    [supplier_street] => Mostová 56
    [supplier_city] => Trenčín
    [supplier_zip] => 843 21
    [supplier_state] => Slovenská republika
    [supplier_ico] => 43226520
    [supplier_dic] => 2165052345
    [supplier_icdph] => SK2165052345
    [supplier_info] => Zapísaný v OR Trenčín, oddiel:Sro, vl.č.1234/X
    [supplier_bankaccount] => 
    [supplier_bank] => VÚB
    [supplier_iban] => SK1200000000001234567891
    [supplier_swift] => 
    [supplier_email] => info@example.com
    [supplier_phone] => +421 903 111 111
    [supplier_web] => www.example.com
    [supplier_custom_key_1] => Číslo licencie
    [supplier_custom_value_1] => LIC-6554/2022
    [supplier_custom_key_2] => 
    [supplier_custom_value_2] => 
    [customer] => Andrej Klačanský
    [customer_street] => Štefánikova 455/2
    [customer_city] => Martin
    [customer_zip] => 876 54
    [customer_state] => 
    [customer_ico] => 
    [customer_dic] => 
    [customer_icdph] => 
    [customer_email] => client@example.com
    [customer_info] => 
    [customer_delivery_name] => 
    [customer_delivery_street] => 
    [customer_delivery_city] => 
    [customer_delivery_zip] => 
    [customer_delivery_state] => 
    [customer_custom_key_1] => Telefón
    [customer_custom_value_1] => 5641655465
    [customer_custom_key_2] => 
    [customer_custom_value_2] => 
    [invoice_type] => faktura
    [invoice_number] => 2022-003
    [invoice_vs] => 2022003
    [invoice_ks] => 0308
    [invoice_payment_type] => prevod
    [invoice_currency] => EUR
    [invoice_date_issue] => 2022-01-01
    [invoice_date_delivery] => 2022-03-29
    [invoice_date_due] => 2022-04-12
    [invoice_order] => 
    [invoice_issued_by] => Martin Hrubý
    [invoice_note] => Poznámka pod položkami
    [invoice_note_above] => Poznámka nad položkami
    [invoice_amount] => 198
    [invoice_amount_vat] => 198
    [invoice_vat_reverse_c] => ano
    [invoice_paid_advanced] => 50
    [invoice_total_discount_perc] => 10
    [invoice_to_pay] => 148
    [invoice_paid] => ano
    [invoice_paid_amount] => 148
    [invoice_date_payment] => 2022-04-27
    [invoice_api_custom] => Test custom
    [invoice_language] => sk
    [items] => Array
        (
            [0] => Array
                (
                    [item_name] => Maliarske práce
                    [item_unit] => hod
                    [item_quantity] => 8
                    [item_unit_price] => 20
                    [item_unit_price_total] => 24
                    [item_vat_rate] => 20
                    [item_vat_total] => 32
                    [item_unit_price_vat] => 24
                    [item_unit_price_totla_vat] => 192
                    [item_api_custom] => 
                )

            [1] => Array
                (
                    [item_name] => Upratovacie práce
                    [item_unit] => hod
                    [item_quantity] => 4
                    [item_unit_price] => 15
                    [item_unit_price_total] => 18
                    [item_vat_rate] => 20
                    [item_vat_total] => 12
                    [item_unit_price_vat] => 18
                    [item_unit_price_totla_vat] => 72
                    [item_api_custom] => 
                )

        )

    [invoice_tags] => Array
        (
            [0] => Tag 1
            [1] => Tag 2
        )

)

List of invoices

A session must be initialized before this call (see above). The following URLs return lists of invoices.
All invoices created in the period:
https://www.faktury-online.com/api/list/created?data={JSON}
All invoices with an issue date in the period:
https://www.faktury-online.com/api/list/issued?data={JSON}
All invoices with a delivery date in the period:
https://www.faktury-online.com/api/list/delivered?data={JSON}
All invoices with a payment date in the period:
https://www.faktury-online.com/api/list/paid?data={JSON}
Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
from optional parameter Search date 'From'
Format: YYYY-MM-DD
to optional parameter Search date 'To'
Format: YYYY-MM-DD
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
    [from] => 2021-01-01
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine
502 Error The data parameter was not sent via the GET method.
503 Error The API key is missing or has an invalid number of characters.
504 Error The API key is not entered correctly.
505 Error The email parameter is missing.
506 Error No session has been initialized
507 Error The initialized session is not valid
508 Error The username or the API key is not correct.
509 Error The user does not exist.
510 Error Invalid URL.
511 Error The 'From' date is not entered correctly.
512 Error The 'To' date is not entered correctly.
513 Error The requested list could not be identified, probably an error in the URL.
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// Dáta v kalendárnom roku 2021
$data['from'] = '2021-01-01';
$data['to'] = '2021-12-31';
// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/list/paid?data=' . urlencode($data_json);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    $faktury = $result['invoices'];
    foreach ($faktury as $faktura) {
        echo "Kód: {$faktura['code']} \n";
        echo "Dodávateľ: {$faktura['supplier']} \n";
        echo "Dodávateľ IČO: {$faktura['supplier_ico']} \n";
        echo "Odberateľ / Zákazník: {$faktura['customer']} \n";
        echo "Odberateľ / Zákazník IČO: {$faktura['customer_ico']} \n";
        // Možnosti: faktura, zalohova_faktura, dobropis, danovy_doklad
        echo "Typ faktúry: {$faktura['invoice_type']} \n";
        echo "Číslo faktúry: {$faktura['invoice_number']} \n";
        echo "Suma bez DPH: {$faktura['invoice_amount']} \n";
        if (isset($faktura['invoice_amount_vat'])) {
            echo "Suma s DPH: {$faktura['invoice_amount_vat']} \n";
        }
        echo "Mena: {$faktura['invoice_currency']} \n";
        echo "Dátum vystavenia: {$faktura['invoice_date_issue']} \n";
        echo "Dátum dodania: {$faktura['invoice_date_delivery']} \n";
        echo "Dátum splatnosti: {$faktura['invoice_date_due']} \n";
        // Možnosti: ano, nie, ciastocne
        echo "Faktúra uhradená: {$faktura['invoice_paid']} \n";
        if ($faktura['invoice_paid'] != 'nie') {
            echo "Uhradená suma: {$faktura['invoice_paid_amount']} \n";
            echo "Dátum úhrady: {$faktura['invoice_date_payment']} \n";
        }
        echo "Vlastné dáta z API: {$faktura['invoice_api_custom']} \n";
        echo "Tagy: {$faktura['tags']} \n";
    }
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}



Response:
Array
(
    [status] => 1
    [invoices] => Array
        (
            [0] => Array
                (
                    [code] => 1a35b89cd48eaf8940a6409ff45a0cc5
                    [supplier] => Moja spoločnosť s.r.o.
                    [supplier_ico] => 43226520
                    [customer] => Andrej Klačanský
                    [customer_ico] => 40436097
                    [invoice_type] => faktura
                    [invoice_number] => 20210400
                    [invoice_amount] => 200
                    [invoice_amount_vat] => 240
                    [invoice_currency] => EUR
                    [invoice_date_issue] => 2021-01-10
                    [invoice_date_delivery] => 2021-01-10
                    [invoice_date_due] => 2021-01-25
                    [invoice_paid] => ano
                    [invoice_paid_amount] => 240
                    [invoice_date_payment] => 2021-01-19
                    [invoice_api_custom] => data z API
                    [tags] => Tag1 ,Tag2
                )

        )

)

Creating a new quote

API call for creating a new quote:
https://www.faktury-online.com/api/ncp?data={JSON}
The following table lists the parameters you can use to create a new quote.

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
apitest optional parameter The apitest parameter specifies whether the created quote is for testing purposes only. This parameter should be used only by developers implementing the Faktury Online API. The system will treat the created quote as a test one and will delete it within 5 to 10 minutes. We recommend keeping this value enabled while testing your API implementation. Disable this value in production, otherwise the quotes will be deleted automatically.
Possible values: 1 or 0
Default value: 0
Supplier parameters:
The supplier can be selected either by the d_id parameter, referring to a supplier stored in the My companies list (option 1), or by filling in all the required details in the parameters (option 2).
Parameter Attribute Description
d_id option 1 / required parameter Supplier ID (you will find the ID in the My companies list).
d_name option 2 / required parameter Supplier's business name.
d_street option 2 / optional parameter Supplier's street.
d_city option 2 / optional parameter Supplier's city.
d_state option 2 / optional parameter Supplier's country.
d_zip option 2 / optional parameter Supplier's postal code.
d_ico option 2 / optional parameter Supplier's Company ID (IČO).
d_dic option 2 / optional parameter Supplier's Tax ID (DIČ).
d_icdph option 2 / optional parameter Supplier's VAT ID (IČ DPH).
d_vatpayer option 2 / optional parameter VAT payer.
Possible values:
VAT payer: 1
Non-VAT payer: 0
Default value: 0
d_viewpayer option 2 / optional parameter Show on the quote whether the supplier is a VAT payer.
Possible values:
Yes: 1
No: 0
Default value: 1
d_info option 2 / optional parameter Supplier information.
d_bankaccount option 2 / optional parameter Supplier's bank account number.
d_bank option 2 / optional parameter Supplier's bank name.
d_iban option 2 / optional parameter Supplier's IBAN.
d_swift option 2 / optional parameter Supplier's SWIFT.
d_email option 2 / optional parameter Supplier's e-mail.
d_web option 2 / optional parameter Supplier's website.
d_phone option 2 / optional parameter Supplier's phone.
d_custom_key_1 option 2 / optional parameter Custom field no. 1 - key
d_custom_value_1 option 2 / optional parameter Custom field no. 1 - value
d_custom_key_2 option 2 / optional parameter Custom field no. 2 - key
d_custom_value_2 option 2 / optional parameter Custom field no. 2 - value
Customer parameters:
Parameter Attribute Description
o_name required parameter Customer's business name.
o_street optional parameter Customer's street.
o_city optional parameter Customer's city.
o_state optional parameter Customer's country.
o_zip optional parameter Customer's postal code.
o_ico optional parameter Customer's Company ID (IČO).
o_dic optional parameter Customer's Tax ID (DIČ).
o_icdph optional parameter Customer's VAT ID (IČ DPH).
o_email optional parameter Customer's e-mail.
o_name_d optional parameter Delivery address - business name.
o_street_d optional parameter Delivery address - street.
o_city_d optional parameter Delivery address - city.
o_state_d optional parameter Delivery address - country.
o_zip_d optional parameter Delivery address - postal code.
o_custom_key_1 optional parameter Custom field no. 1 - key
o_custom_value_1 optional parameter Custom field no. 1 - value
o_custom_key_2 optional parameter Custom field no. 2 - key
o_custom_value_2 optional parameter Custom field no. 2 - value
Quote parameters:
Parameter Attribute Description
po_rounding optional parameter Rounding of the total amount due
Possible values:
0: no rounding
1: round up to a whole number
2: round down to a whole number
3: round to 5 hundredths (5 cents)
Default value: 0
po_number optional parameter Quote number. If not provided, the number is automatically incremented by 1 from the most recently created quote (the issue date is decisive; the quote number must be numeric).
po_date_issue optional parameter Issue date. In the YYYY-MM-DD format.
Default value: current date
po_date_expiration optional parameter Quote validity date. In the YYYY-MM-DD format.
po_issued_by optional parameter Quote issued by.
po_note_above optional parameter Quote note. Displayed above the items.
po_note optional parameter Quote note. Displayed below the items. If the supplier is selected by the d_id parameter and po_note is empty, the note stored for that supplier is displayed.
po_internal_note optional parameter Internal note. For internal use only. It is not shown on the quote; it is visible only in the document detail in the system.
po_logo optional parameter Logo display.
Possible values:
Not shown: 0
Shown: 1 (only if the supplier was loaded by d_id and has a logo stored)
po_stamp optional parameter Stamp display.
Possible values:
Not shown: 0
Shown: 1 (only if the supplier was loaded by d_id and has a stamp stored)
po_currency optional parameter Quote currency.
Default value: EUR
po_language optional parameter Quote language.
Possible values:
SK, CS, EN, DE, FR, ES, IT, HU, PL, RU, NO, DK
Default value: SK
po_custom optional parameter Any text information sent via the API. It is shown as a separate column in the Excel export.
text, max. 50 characters
po_tags optional parameter A list (array) of tags from the My labels / tags list to be assigned to the document. Format:
Array
(
    [0] => Tag name 1
    [1] => Tag name 2
)
Quote item parameters:
Parameter Attribute Description
p_text required parameter Quote item text.
p_quantity required parameter Quantity. Number.
p_unit required parameter Unit of measure. For example kg, pcs, ...
p_price option 1 / optional parameter Price per unit of measure excluding tax. The price including VAT is calculated from this value. If this attribute is not provided, the p_pricevat attribute must be provided. For non-VAT payers this parameter is required.
p_vat optional parameter Tax in percent. Fill in only if the supplier is a VAT payer.
p_pricevat option 2 / optional parameter Price per unit of measure including tax. If this attribute is provided, the price excluding tax is calculated from it regardless of whether the p_price attribute was provided.
p_custom optional parameter Any text information sent via the API for the quote item. It is shown as a separate column in the Excel export.
text, max. 50 characters
Data format before sending:
Array
(
    [key] => dJyMc*53@687*wGhofIWi!WDcEEQUdmj
    [email] => name@example.com
    [apitest] => 1
    [d] => Array
        (
            [d_name] => Moja spoločnosť s.r.o.
            [d_street] => Mostová 56
            [d_city] => Trenčín
            [d_zip] => 843 21
            [d_state] => Slovenská republika
            [d_ico] => 43226520
            [d_dic] => 2165052345
            [d_icdph] => SK2165052345
            [d_vatpayer] => 1
            [d_viewpayer] => 0
            [d_info] => Zapísaný v OR Trenčín,oddiel:Sro, vl.č.1234/X
            [d_bankaccount] => 1234567890/0200
            [d_bank] => VÚB
            [d_iban] => 
            [d_swift] => 
            [d_email] => info@example.com
            [d_web] => www.example.com
            [d_phone] => +421 903 111 111
        )

    [o] => Array
        (
            [o_name] => Andrej Klačanský
            [o_street] => Štefánikova 455/2
            [o_city] => Martin
            [o_zip] => 876 54
            [o_state] => 
            [o_ico] => 
            [o_dic] => 
            [o_icdph] => 
            [o_email] => client@example.com
        )

    [po] => Array
        (
            [po_number] => 2022099
            [po_date_issue] => 2022-01-01
            [po_date_expiration] => 2022-01-15
            [po_issued_by] => Martin Hrubý
            [po_note] => Nezáväzná cenová ponuka platná 15 dní.
            [po_currency] => EUR
            [po_language] => SK
            [po_tags] => Array
                (
                    [0] => VIP klient
                    [1] => Doprava zdarma
                )

        )

    [p] => Array
        (
            [0] => Array
                (
                    [p_text] => Diamantový kotúč na obklady
                    [p_quantity] => 8
                    [p_unit] => ks
                    [p_price] => 15
                    [p_vat] => 20
                    [p_pricevat] => 20
                )

            [1] => Array
                (
                    [p_text] => Sada nylónových drôtených kief
                    [p_quantity] => 10
                    [p_unit] => ks
                    [p_price] => 12.50
                    [p_vat] => 20
                    [p_pricevat] => 15
                )

        )

)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine, the quote was created
602 Error The data parameter was not sent via the GET method.
603 Error The API key is missing or has an invalid number of characters.
604 Error The API key is not entered correctly.
605 Error The email parameter is missing.
606 Error The username or the API key is not correct.
607 Error The user does not exist.
608 Error The supplier ID or the supplier name must be provided.
609 Error The provided supplier ID is not correct.
610 Error The supplier name is missing.
611 Error The customer name is missing.
612 Error Quote data is missing.
613 Error Quote items are missing or not entered correctly.
614 Error Error in an item, a required value is missing.
615 Error The quantity in a quote item is not a number.
616 Error The price excluding tax in an item is not a number.
617 Error The tax in percent is not entered correctly.
618 Error An item has neither a price excluding tax nor a price including tax.
619 Error Unsupported quote language.
620 Error An item has no price excluding tax while the supplier is not a VAT payer.
621 Error The price including tax in an item is not a number.
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// V prípade, že budeme testovať API, zvolíme hodnotu 1
// Znamená to, že všetky vytvorené cenové ponuky sa automaticky odstránia o 5 - 10 minút
$data['apitest'] = 1; //hodnota môže byť 1 alebo 0


// Príprava dát dodávateľa
$dodavatel = [];

// Dodávateľa môžeme použiť už existujúceho (uloženého v zozname Moje spoločnosti)
// alebo dodávateľa vytvoríme ručne vložením dát.
// Ak použijeme existujúceho dodávateľa, vložíme iba jeho ID:
// $dodavatel['d_id'] = 123; // ID dodávateľa nájdeme v zozname Moje spoločnosti

// alebo (nie obe):
$dodavatel['d_name'] = "Moja spoločnosť s.r.o."; // Obchodný názov dodávateľa
$dodavatel['d_street'] = "Mostová 56"; // Ulica
$dodavatel['d_city'] = "Trenčín"; // Mesto
$dodavatel['d_zip'] = "843 21"; // PSČ
$dodavatel['d_state'] = "Slovenská republika"; // Štát
$dodavatel['d_ico'] = "43226520"; // IČO
$dodavatel['d_dic'] = "2165052345"; // DIČ
$dodavatel['d_icdph'] = "SK2165052345"; // IČDPH
$dodavatel['d_vatpayer'] = "1"; // Platca DPH. Pokiaľ je dodávateľ platca DPH ponechajte hodnotu 1,
// ak nie je platca DPH, napíšte 0.
$dodavatel['d_viewpayer'] = "1"; //  Pokiaľ chcete zobraziť informáciu v cenovej ponuke,
// že dodávateľ je platcom/neplatcom DPH.
$dodavatel['d_info'] = "Zapísaný v OR Trenčín, oddiel:Sro, vl.č.1234/X"; //Info o dodávateľovi
$dodavatel['d_bankaccount'] = ""; // Číslo účtu
$dodavatel['d_bank'] = "VÚB"; // Názov banky
$dodavatel['d_iban'] = "SK1200000000001234567891"; // IBAN
$dodavatel['d_swift'] = ""; // SWIFT
$dodavatel['d_email'] = "info@example.com"; // E-mail
$dodavatel['d_web'] = "www.example.com"; // WEB
$dodavatel['d_phone'] = "+421 903 111 111"; // Telefón

// Pridanie dodávateľa k dátam:
$data['d'] = $dodavatel;


// Príprava dát odberateľa
$odberatel = [];
$odberatel['o_name'] = "Andrej Klačanský"; // Názov odberateľa
$odberatel['o_street'] = "Štefánikova 455/2"; // Ulica
$odberatel['o_city'] = "Martin"; // Mesto
$odberatel['o_zip'] = "876 54"; // PSČ
$odberatel['o_state'] = ""; // Štát
$odberatel['o_ico'] = ""; // IČO
$odberatel['o_dic'] = ""; // DIČ
$odberatel['o_icdph'] = ""; // IČDPH
$odberatel['o_email'] = "client@example.com"; // Email odberateľa

// Pridanie odberateľa k dátam:
$data['o'] = $odberatel;


// Príprava údajov cenovej ponuky
$cenovaPonuka = [];

// Číslo cenovej ponuky môžeme zadať ručne:
$cenovaPonuka['po_number'] = "2022099";
// Ak chceme vypočítať číslo automaticky, toto pole neuvedieme
$cenovaPonuka['po_date_issue'] = '2022-01-01'; // Dátum vystavenia vo formáte RRRR-MM-DD
$cenovaPonuka['po_date_expiration'] = '2022-01-15'; // Dátum platnosti vo formáte RRRR-MM-DD
$cenovaPonuka['po_issued_by'] = "Martin Hrubý";  //Ponuku vystavil
$cenovaPonuka['po_logo'] = "1";  // Zobraziť logo dodávateľa. Iba v prípade, že bol dodávateľ
// vybraný pomocou ID a má priradené logo
$cenovaPonuka['po_stamp'] = "1";  // Zobraziť pečiatku dodávateľa. Iba v prípade, že bol
// dodávateľ vybraný pomocou ID a má priradenú pečiatku
$cenovaPonuka['po_currency'] = "EUR";  // Mena cenovej ponuky
$cenovaPonuka['po_language'] = "SK";   // Jazyk cenovej ponuky
$cenovaPonuka['po_tags'] = ["VIP klient", "Doprava zdarma"];  // Priradiť označenia k ponuke

// Pridanie údajov ponuky k dátam:
$data['po'] = $cenovaPonuka;


// Príprava položiek ponuky
$polozky = [];
// prvá položka:
$polozka = [];
$polozka['p_text'] = "Diamantový kotúč na obklady"; // Názov služby alebo tovaru
$polozka['p_quantity'] = "8"; // Množstvo
$polozka['p_unit'] = "ks"; // Merná jednotka
$polozka['p_price'] = "15"; // Cena za jednu jednotku bez DPH (Cena s DPH sa vypočíta)
$polozka['p_vat'] = "20"; // Daň v %
// priradenie k položkám:
$polozky[] = $polozka;

// druhá položka:
$polozka = [];
$polozka['p_text'] = "Sada nylónových drôtených kief"; // Názov služby alebo tovaru
$polozka['p_quantity'] = "10"; // Množstvo
$polozka['p_unit'] = "ks"; // Merná jednotka
$polozka['p_vat'] = "20"; // Daň v %
$polozka['p_pricevat'] = "15"; // Cena za jednu jednotku vrátane DPH (Cena bez DPH sa vypočíta)
// priradenie k položkám:
$polozky[] = $polozka;

// priradenie položiek k dátam:
$data['p'] = $polozky;


// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/ncp?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);

// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    echo "Uložené, nová cenová má kód: " . $result['code'] . " <br />";
    echo "Číslo cenovej ponuky: " . $result['number'] . " <br />";
    echo "Cenová ponuka vytvorená: " . $result['created'] . " <br />";
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}

Response:
Array
(
    [status] => 1
    [code] => ca9658a5448a945059f44658bac985e5
    [number] => 2022099
    [created] => 2022-01-01 09:49:05
)

Displaying a quote

A session must be initialized before this call (see above). API call for displaying a quote:
https://www.faktury-online.com/api/zcp?data={JSON}

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
code required parameter Quote code (obtained from the API response when the quote was created)
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
    [code] => aa9025bc0094c88445daa22b90eff3b
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine
702 Error The data parameter was not sent via the GET method.
703 Error The API key is missing or has an invalid number of characters.
704 Error The API key is not entered correctly.
705 Error The email parameter is missing.
706 Error No session has been initialized
707 Error The initialized session is not valid
708 Error The username or the API key is not correct.
709 Error The user does not exist.
710 Error The quote code is missing.
711 Error The quote code is not entered correctly.
712 Error Error while selecting the quote
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
// vytvori subor cookie.txt, pozor na prava na zapis
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);
$result = json_decode($output, true);

// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// Kód cenovej ponuky:
$data['code'] = "14915945a66c8b7be74dac59c5badfbf";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/zcp?data=' . urlencode($data_json);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);
$result = json_decode($output, true);
$url = $result['url'];
$cislo = $result['number'];


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// pre zobrazenie cenovej ponuky:
header('Content-Type: application/pdf');
header('Content-Disposition: inline; filename="' . $cislo . '.pdf"');
header('Cache-Control: private, max-age=0, must-revalidate');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
echo curl_exec($ch);


/*
// pre download cenovej ponuky:
header('Content-Type: application/download');
header('Content-Disposition: inline; filename="'.$cislo.'.pdf"');
header('Cache-Control: private, max-age=0, must-revalidate');
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
echo curl_exec($ch);
*/

Response:
Array
(
    [status] => 1
    [url] => https://www.faktury-online.com/cenove-ponuky/detail-subor?cp=26915945a67c8b7ba74dac59c5badfbf
    [number] => 2022099
)

Quote status and detail

A session must be initialized before this call (see above). API call for displaying the quote status and detail:
https://www.faktury-online.com/api/cp-status?data={JSON}

Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
code required parameter Quote code (obtained from the API response when the quote was created)
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
    [code] => ae47ece062b0021144d768446b071fee
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine
802 Error The data parameter was not sent via the GET method.
803 Error The API key is missing or has an invalid number of characters.
804 Error The API key is not entered correctly.
805 Error The email parameter is missing.
806 Error No session has been initialized
807 Error The initialized session is not valid
808 Error The username or the API key is not correct.
809 Error The user does not exist.
810 Error The quote code is missing.
811 Error The quote code is not entered correctly.
812 Error Error while selecting the quote
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "vJyMc*4@2754*wGhofIWi!QDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);

// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// Kód cenovej ponuky:
$data['code'] = "ae47ece062b0021144d768446b071fee";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/cp-status?data=' . urlencode($data_json);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    echo "Dodávateľ: {$result['supplier']} \n";
    echo "Dodávateľ IČO: {$result['supplier_ico']} \n";
    echo "Odberateľ / Zákazník: {$result['customer']} \n";
    echo "Odberateľ / Zákazník IČO: {$result['customer_ico']} \n";
    echo "Číslo cenovej ponuky: {$result['offer_number']} \n";
    echo "Suma bez DPH: {$result['offer_amount']} \n";
    if (isset($result['offer_amount_vat'])){
        echo "Suma s DPH: {$result['offer_amount_vat']} \n";
    }
    echo "Mena: {$result['offer_currency']} \n";
    echo "Dátum vystavenia: {$result['offer_date_issue']} \n";
    echo "Dátum platnosti: {$result['offer_date_expiration']} \n";
    echo "Vlastné dáta z API: {$result['offer_api_custom']} \n";
    if (isset($result['offer_tags']) && is_array($result['offer_tags'])){
        echo "Tagy cenovej ponuky: ";
        echo implode(", ",$result['offer_tags']);
    }
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}



Response:
Array
(
    [status] => 1
    [supplier] => Moja firma s.r.o.
    [supplier_street] => Uličná 123
    [supplier_city] => Bratislava
    [supplier_zip] => 811 05
    [supplier_state] => Slovensko
    [supplier_ico] => 12345678
    [supplier_dic] => 2131154505
    [supplier_icdph] => 
    [supplier_info] => Spol. zapísaná v OR Okresného súdu Bratislava I, Oddiel: Sro, Vložka č. 11111/B
    [supplier_bankaccount] => 2100501234/8330
    [supplier_bank] => Fio banka, a.s.
    [supplier_iban] => SK6583300000002100501234
    [supplier_swift] => FIOZSKBAXXX
    [supplier_email] => email@moja-spolocnost.sk
    [supplier_phone] => 0911 111 222
    [supplier_web] => www.moja-spolocnost.sk
    [supplier_custom_key_1] => 
    [supplier_custom_value_1] => 
    [supplier_custom_key_2] => 
    [supplier_custom_value_2] => 
    [customer] => Môj klient, s.r.o.
    [customer_street] => Krátka 123
    [customer_city] => Trenčín
    [customer_zip] => 911 01
    [customer_state] => 
    [customer_ico] => 12345678
    [customer_dic] => 2020301111
    [customer_icdph] => SK2020301111
    [customer_email] => info@isset.sk
    [customer_info] => 
    [customer_custom_key_1] => ID klienta
    [customer_custom_value_1] => 156516
    [customer_custom_key_2] => 
    [customer_custom_value_2] => 
    [offer_number] => 2022002
    [offer_amount] => 183.69
    [offer_amount_vat] => 215.75
    [offer_total_discount_perc] => 10
    [offer_currency] => EUR
    [offer_date_issue] => 2021-10-01
    [offer_date_expiration] => 2021-10-25
    [offer_note] => Poznámka pod položkami
    [offer_note_above] => Poznámka nad položkami
    [offer_api_custom] => 
    [offer_language] => sk
    [items] => Array
        (
            [0] => Array
                (
                    [item_name] => Položka 1
                    [item_unit] => ks
                    [item_quantity] => 1
                    [item_unit_price] => 100.3
                    [item_unit_price_total] => 120.36
                    [item_vat_rate] => 20
                    [item_vat_total] => 20.06
                    [item_unit_price_vat] => 120.36
                    [item_unit_price_totla_vat] => 120.36
                    [item_api_custom] => 
                )

            [1] => Array
                (
                    [item_name] => Popis druhej položky
                    [item_unit] => ks
                    [item_quantity] => 5
                    [item_unit_price] => 15.5645
                    [item_unit_price_total] => 18.67
                    [item_vat_rate] => 20
                    [item_vat_total] => 15.56
                    [item_unit_price_vat] => 18.67
                    [item_unit_price_totla_vat] => 93.38
                    [item_api_custom] => 
                )

            [2] => Array
                (
                    [item_name] => Popis tretej položky
                    [item_unit] => ks
                    [item_quantity] => 2
                    [item_unit_price] => 12.99
                    [item_unit_price_total] => 12.99
                    [item_vat_rate] => 0
                    [item_vat_total] => 0
                    [item_unit_price_vat] => 12.99
                    [item_unit_price_totla_vat] => 25.98
                    [item_api_custom] => 
                )

        )

    [offer_tags] => Array
        (
            [0] => Tag 1
            [1] => Tag 2
        )

)

List of quotes

A session must be initialized before this call (see above). The following URLs return lists of quotes.
All quotes created in the period:
https://www.faktury-online.com/api/cp-list/created?data={JSON}
All quotes with an issue date in the period:
https://www.faktury-online.com/api/cp-list/issued?data={JSON}
Basic parameters:
Parameter Attribute Description
key required parameter API key.
email required parameter E-mail (or username) you use to log in to Faktury Online.
from optional parameter Search date 'From'
Format: YYYY-MM-DD
to optional parameter Search date 'To'
Format: YYYY-MM-DD
Data format before sending:
Array
(
    [key] => vJyMc*4@2754*wGhofIWi!QDcEEQUdmj
    [email] => name@example.com
    [from] => 2022-01-01
    [to] => 2022-01-31
)


List of return codes:
Status ID Meaning Description
1 OK Everything went fine
902 Error The data parameter was not sent via the GET method.
903 Error The API key is missing or has an invalid number of characters.
904 Error The API key is not entered correctly.
905 Error The email parameter is missing.
906 Error No session has been initialized
907 Error The initialized session is not valid
908 Error The username or the API key is not correct.
909 Error The user does not exist.
910 Error Invalid URL.
911 Error The 'From' date is not entered correctly.
912 Error The 'To' date is not entered correctly.
913 Error The requested list could not be identified, probably an error in the URL.
Sample source code:
<?php

// Príprava základných dát:
$data = [];

// Váš API kľúč:
$data['key'] = "dJyMc*53@687*wGhofIWi!WDcEEQUdmj";

// Váš email (príp. používateľské meno):
$data['email'] = "name@example.com";

// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);

// Inicializácia sedenia
$url = 'https://www.faktury-online.com/api/init?data=' . urlencode($data_json);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_COOKIESESSION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
$output = curl_exec($ch);


// Výsledok:
$result = json_decode($output, true);
if ($result['status'] != 1) {
    throw new Exception("Vyskytla sa chyba č. " . $result['status']);
}

// Dáta v kalendárnom roku 2022
$data['from'] = '2022-01-01';
$data['to'] = '2022-12-31';
// Dáta sa uložia do formátu JSON:
$data_json = json_encode($data);


// Dáta sa odošlú:
$url = 'https://www.faktury-online.com/api/cp-list/issued?data=' . urlencode($data_json);
curl_setopt($ch, CURLOPT_URL, $url);
$output = curl_exec($ch);



// Výsledok:
$result = json_decode($output, true);
if ($result['status'] == 1) {
    $cenovePonuky = $result['offers'];
    foreach ($cenovePonuky as $cenovaPonuka) {
        echo "Kód: {$cenovaPonuka['code']} \n";
        echo "Dodávateľ: {$cenovaPonuka['supplier']} \n";
        echo "Dodávateľ IČO: {$cenovaPonuka['supplier_ico']} \n";
        echo "Odberateľ / Zákazník: {$cenovaPonuka['customer']} \n";
        echo "Odberateľ / Zákazník IČO: {$cenovaPonuka['customer_ico']} \n";
        echo "Číslo cenovej ponuky: {$cenovaPonuka['offer_number']} \n";
        echo "Suma bez DPH: {$cenovaPonuka['offer_amount']} \n";
        if (isset($cenovaPonuka['offer_amount_vat'])) {
            echo "Suma s DPH: {$cenovaPonuka['offer_amount_vat']} \n";
        }
        echo "Mena: {$cenovaPonuka['offer_currency']} \n";
        echo "Dátum vystavenia: {$cenovaPonuka['offer_date_issue']} \n";
        echo "Dátum platnosti: {$cenovaPonuka['offer_date_expiration']} \n";
        echo "Vlastné dáta z API: {$cenovaPonuka['offer_api_custom']} \n";
        echo "Tagy: {$cenovaPonuka['tags']} \n";
    }
} else {
    echo "Vyskytla sa chyba č." . $result['status'];
}



Response:
Array
(
    [status] => 1
    [offers] => Array
        (
            [0] => Array
                (
                    [code] => ae47ece062b0021144d768446b071fee
                    [supplier] => Moja spoločnosť s.r.o.
                    [supplier_ico] => 43226520
                    [customer] => Andrej Klačanský
                    [customer_ico] => 40436097
                    [offer_number] => 20220123
                    [offer_amount] => 200
                    [offer_amount_vat] => 240
                    [offer_currency] => EUR
                    [offer_date_issue] => 2022-01-10
                    [offer_date_expiration] => 2021-01-25
                    [offer_api_custom] => data z API
                    [tags] => Tag1 ,Tag2
                )

        )

)