HostFact API versie 3.1



Inkoopfacturen

Inkoopfacturen (van crediteuren) zijn te beheren via de controller 'creditinvoice'.



attachment add

Middels deze functie voegt u een bijlage toe aan een bestaande inkoopfactuur. Deze functie is beschikbaar voor een inkoopfactuur in alle statussen.
Voorbeeldbestand: /voorbeelden/attachment/attachment.creditinvoice.add.php


Invoerparameters:
Veldnaam Waarde Omschrijving
ReferenceIdentifier int De unieke ID van een inkoopfactuur
CreditInvoiceCode string Het interne inkoopfactuurnummer
Type string Bij inkoopfactuur altijd 'creditinvoice'
Filename string De bestandsnaam
Base64 text Base64 encoded string
Verplichte velden: ReferenceIdentifier of CreditInvoiceCode, Type, Filename en Base64

Voorbeeld invoer:
<?php

require_once("../hostfact_api.php");

$api = new HostFactAPI();

$attachmentParams = array(
				'CreditInvoiceCode'	=> 'CF0001',
				'Type'				=> 'creditinvoice',
				'Filename'			=> 'sample.pdf',
				'Base64'			=> 'JVBERi0xLj...UlRU9GCg=='
);

$response = $api->sendRequest('attachment', 'add', $attachmentParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => attachment
    [action] => add
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [success] => Array
        (
            [0] => Het bestand 'sample.pdf' is toegevoegd als bijlage bij de inkoopfactuur
        )

)