HostFact API versie 3.1



Facturen

Facturen zijn te beheren via de controller 'invoice'.



credit

Middels deze functie kunt u bestaande facturen crediteren. De factuur krijgt de status
'Vervallen' (= 9) en er ontstaat een nieuwe creditfactuur (status '8').
Wilt u een conceptfactuur verwijderen, gebruik dan de functie 'delete'.
Voorbeeldbestand: /voorbeelden/invoice/invoice.credit.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een factuur
InvoiceCode string Het factuurnummer
Verplichte velden: Identifier of InvoiceCode

Voorbeeld invoer:
<?php

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

$api = new HostFactAPI();

$invoiceParams = array(
				'InvoiceCode'	=> 'F0001'
);

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

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => invoice
    [action] => credit
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [success] => Array
        (
            [0] => Factuur F0001 is gecrediteerd en op status 'vervallen' gezet
            [1] => Factuur F0004 is succesvol aangemaakt
        )

    [invoice] => Array
        (
            [Identifier] => 6
            [InvoiceCode] => F0004
            [Debtor] => 1
            [DebtorCode] => DB0001
            [Status] => 8
            [SubStatus] => 
            [Date] => 2022-11-24
            [Term] => 14
            [PayBefore] => 2022-12-08
            [PaymentURL] => 
            [AmountExcl] => -165.00
            [AmountTax] => -34.65
            [AmountIncl] => -199.65
            [TaxRate] => 0
            [Compound] => no
            [AmountPaid] => 0.00
            [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] => 5
            [SentDate] => 
            [Sent] => 0
            [Reminders] => 0
            [ReminderDate] => 
            [Summations] => 0
            [SummationDate] => 
            [Authorisation] => no
            [PaymentMethod] => 
            [PayDate] => 
            [TransactionID] => 
            [Description] => 
            [Comment] => 
            [InvoiceLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 113
                            [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] => 114
                            [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
                        )

                    [2] => Array
                        (
                            [Identifier] => 115
                            [Date] => 2022-11-24
                            [Number] => 1
                            [NumberSuffix] => 
                            [ProductCode] => 
                            [Description] => Corresponderende factuur: F0001
                            [PriceExcl] => 0
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [TaxPercentage] => 21
                            [PeriodicID] => 0
                            [Periods] => 1
                            [Periodic] => 
                            [StartPeriod] => 
                            [EndPeriod] => 
                            [ProductType] => 
                            [Reference] => 0
                            [NoDiscountAmountIncl] => 0
                            [NoDiscountAmountExcl] => 0
                            [DiscountAmountIncl] => 0
                            [DiscountAmountExcl] => 0
                        )

                )

            [Created] => 2022-11-24 11:00:00
            [Modified] => 2022-11-24 11:00:00
            [Translations] => Array
                (
                    [Status] => Creditfactuur
                    [Country] => Nederland
                    [InvoiceMethod] => Per e-mail
                    [Template] => Creditfactuur
                    [PaymentMethod] => 
                )

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

                )

        )

)