WeFact Hosting API versie 2.7



Facturen

Facturen zijn te beheren via de controller 'invoice'.



sendbyemail

Middels deze functie verstuurt u een factuur per e-mail.
Voorbeeldbestand: /voorbeelden/invoice/invoice.sendbyemail.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("../wefact_api.php");

$api = new WeFactAPI();

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

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

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => invoice
    [action] => sendbyemail
    [status] => success
    [date] => 2016-09-01T12:00:00+02:00
    [success] => Array
        (
            [0] => Factuur F0001 is per e-mail verzonden naar info@company.com
        )

    [invoice] => Array
        (
            [Identifier] => 2
            [InvoiceCode] => F0001
            [Debtor] => 1
            [DebtorCode] => DB0001
            [Status] => 2
            [SubStatus] => 
            [Date] => 2016-05-11
            [Term] => 14
            [PayBefore] => 2016-05-25
            [PaymentURL] => https://www.domain.com/klantenpaneel/betalen/?payment=F0001&key=2cdede516f9709ee8d304bc99628ffe2
            [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
            [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] => 2017-01-16
            [Sent] => 1
            [Reminders] => 0
            [ReminderDate] => 
            [Summations] => 0
            [SummationDate] => 
            [Authorisation] => no
            [PaymentMethod] => 
            [PayDate] => 
            [TransactionID] => 
            [Description] => 
            [Comment] => 
            [InvoiceLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 3
                            [Date] => 2016-07-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.50
                            [NoDiscountAmountExcl] => 150.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                    [1] => Array
                        (
                            [Identifier] => 4
                            [Date] => 2016-07-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] => 2016-07-14
                            [EndPeriod] => 2017-07-14
                            [ProductType] => 
                            [Reference] => 0
                            [NoDiscountAmountIncl] => 18.15
                            [NoDiscountAmountExcl] => 15.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                )

            [Created] => 2016-09-01 12:00:00
            [Modified] => 2016-09-01 12:00:00
            [Attachments] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 4
                            [Filename] => sample.pdf
                        )

                )

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

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

                )

        )

)