HostFact API versie 3.1



Inkoopfacturen

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



partpayment

Deze functie zal een deelbetaling verwerken. Komt het bedrag exact overeen met het openstaande bedrag, dan zal de factuur automatisch op betaald worden gezet.
Voorbeeldbestand: /voorbeelden/creditinvoice/creditinvoice.partpayment.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een inkoopfactuur
CreditInvoiceCode string Eigen interne inkoopfactuurnummer
AmountPaid float Het betaalde bedrag
Verplichte velden:Identifier of CreditInvoiceCode en AmountPaid

Voorbeeld invoer:
<?php

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

$api = new HostFactAPI();

$creditInvoiceParams = array(
				'CreditInvoiceCode'	=> 'CF0001',
				'AmountPaid'	=> 162.50
);

$response = $api->sendRequest('creditinvoice', 'partpayment', $creditInvoiceParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => creditinvoice
    [action] => partpayment
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [success] => Array
        (
            [0] => Deelbetaling bij factuur CF0001 is verwerkt
        )

    [creditinvoice] => Array
        (
            [Identifier] => 1
            [CreditInvoiceCode] => CF0001
            [InvoiceCode] => 2018-6422
            [Creditor] => 1
            [CreditorCode] => CD0001
            [Status] => 2
            [Date] => 2018-01-01
            [Term] => 0
            [AmountExcl] => 162.50
            [AmountIncl] => 196.63
            [AmountPaid] => 162.50
            [Authorisation] => no
            [Private] => 0.00
            [PrivatePercentage] => 0
            [ReferenceNumber] => 
            [PayDate] => 
            [InvoiceLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 1
                            [Number] => 1
                            [Description] => SLA contract #2
                            [PriceExcl] => 125
                            [TaxPercentage] => 21
                        )

                    [1] => Array
                        (
                            [Identifier] => 2
                            [Number] => 3
                            [Description] => Domains .com
                            [PriceExcl] => 12.5
                            [TaxPercentage] => 21
                        )

                )

            [Created] => 2022-11-24 11:00:00
            [Modified] => 2022-11-24 11:00:00
            [Attachments] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 3
                            [Filename] => sample.pdf
                        )

                )

            [Translations] => Array
                (
                    [Status] => Deels betaald
                )

        )

)