HostFact API versie 3.1



Facturen

Facturen zijn te beheren via de controller 'invoice'.



partpayment

Middels deze functie kunt u een deelbetaling verwerken bij een factuur. Indien de deelbetaling overeenkomt met het openstaande bedrag wordt de factuur naar status 'Betaald' (= 4) gezet. Deze functie is niet bruikbaar bij een conceptfactuur.
Voorbeeldbestand: /voorbeelden/invoice/invoice.partpayment.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een factuur
InvoiceCode string Het factuurnummer
AmountPaid float Bedrag reeds ontvangen
PayDate date Betaaldatum van de deelbetaling
Verplichte velden:Identifier of InvoiceCode en AmountPaid

Voorbeeld invoer:
<?php

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

$api = new HostFactAPI();

$invoiceParams = array(
				'Identifier'	=> 2,
				'AmountPaid'	=> 5.25
);

$response = $api->sendRequest('invoice', 'partpayment', $invoiceParams);

print_r_pre($response);

?>

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

    [invoice] => Array
        (
            [Identifier] => 2
            [InvoiceCode] => F0001
            [Debtor] => 1
            [DebtorCode] => DB0001
            [Status] => 3
            [SubStatus] => 
            [Date] => 2018-01-11
            [Term] => 14
            [PayBefore] => 2018-01-25
            [PaymentURL] => http://company.com/klantenpaneel/betalen/?payment=F0001&key=a98a856c384112268c1495d806ceea82
            [AmountExcl] => 165.00
            [AmountTax] => 34.65
            [AmountIncl] => 199.65
            [TaxRate] => 0
            [Compound] => no
            [AmountPaid] => 5.25
            [Discount] => 0
            [VatCalcMethod] => excl
            [IgnoreDiscount] => no
            [Coupon] => 
            [ReferenceNumber] => 
            [CompanyName] => Company X
            [TaxNumber] => NL123456789B01
            [Sex] => m
            [Initials] => John
            [SurName] => Jackson
            [Address] => Keizersgracht 100
            [ZipCode] => 1015 AA
            [City] => Amsterdam
            [Country] => NL
            [EmailAddress] => info@company.com
            [InvoiceMethod] => 0
            [Template] => 1
            [SentDate] => 
            [Sent] => 0
            [Reminders] => 0
            [ReminderDate] => 
            [Summations] => 0
            [SummationDate] => 
            [Authorisation] => no
            [PaymentMethod] => 
            [PayDate] => 
            [TransactionID] => 
            [Description] => 
            [Comment] => 
            [InvoiceLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 3
                            [Date] => 2018-01-14
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => 
                            [Description] => Setupfee
                            [PriceExcl] => 150
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                            [ProductType] => 
                            [Reference] => 0
                            [NoDiscountAmountIncl] => 181.5
                            [NoDiscountAmountExcl] => 150
                            [DiscountAmountIncl] => 0
                            [DiscountAmountExcl] => 0
                        )

                    [1] => Array
                        (
                            [Identifier] => 4
                            [Date] => 2018-01-14
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => P003
                            [Description] => Domain example.com
                            [PriceExcl] => 15
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [PeriodicID] => 7
                            [Periods] => 1
                            [Periodic] => j
                            [StartPeriod] => 2018-01-14
                            [EndPeriod] => 2018-01-14
                            [ProductType] => 
                            [Reference] => 0
                            [NoDiscountAmountIncl] => 18.15
                            [NoDiscountAmountExcl] => 15
                            [DiscountAmountIncl] => 0
                            [DiscountAmountExcl] => 0
                        )

                )

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

                )

            [Translations] => Array
                (
                    [Status] => Deels betaald
                    [Country] => Nederland
                    [InvoiceMethod] => Per e-mail
                    [Template] => Factuur
                    [PaymentMethod] => 
                )

            [AmountDiscount] => 0
            [AmountDiscountIncl] => 0
            [UsedTaxrates] => Array
                (
                    [0.21] => Array
                        (
                            [AmountExcl] => 165
                            [AmountTax] => 34.65
                            [AmountIncl] => 199.65
                        )

                )

        )

)