HostFact API versie 3.1
Facturen
Facturen zijn te beheren via de controller 'invoice'.
download
Middels deze functie kunt u de factuur in PDF downloaden. De PDF wordt als Base64 encoded string teruggegeven.
Voorbeeldbestand: /voorbeelden/invoice/invoice.download.php
Invoerparameters:
| Veldnaam | Waarde | Omschrijving |
|---|---|---|
| Identifier | int | De unieke ID van een factuur |
| InvoiceCode | string | Het factuurnummer |
| FileType | 'pdf', 'ubl' of 'ublwithpdf' | Het type bestand zoals de factuur gedownload mag worden. Standaard: pdf. |
Voorbeeld invoer:
<?php
require_once("../hostfact_api.php");
$api = new HostFactAPI();
$invoiceParams = array(
'InvoiceCode' => 'F0001'
);
$response = $api->sendRequest('invoice', 'download', $invoiceParams);
print_r_pre($response);
?>Voorbeeld uitvoer:
Array
(
[controller] => invoice
[action] => download
[status] => success
[date] => 2022-11-24T12:00:00+02:00
[invoice] => Array
(
[Filename] => Factuur_F0001.pdf
[Base64] => JVBERi0xLj...UlRU9GCg==
)
)