WeFact Hosting API versie 2.7



Bestelling

Bestellingen zijn te beheren via de controller 'order'.



orderline add

Middels deze functie voegt u een bestelregel toe aan een bestaande bestelling.
Voorbeeldbestand: /voorbeelden/order/orderline.add.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een bestelling
OrderCode string Het bestelnummer
OrderLines array Bestelregel:
- Date date     Datum. Standaard: vandaag
- Number float     Aantal. Standaard: 1
- ProductCode string     Productnummer
- Description text     Omschrijving
- PriceExcl float     Prijs per stuk (excl. BTW)
- DiscountPercentage float     Korting bestelregel, percentage: 0 - 100
- TaxPercentage float     BTW percentage: 0 - 100
- PeriodicType 'once' of 'period'     Periodiek factureren?
    Standaard: 'once' (eenmalig)
- Periods int     Aantal van de frequentie eenheid 'Periodic'
- Periodic string     Frequentie eenheid, zie variabelen-lijst
- StartPeriod date     Startdatum van de periode
- ProductType string     Gekoppelde dienst: domain, hosting of ssl.
    Standaard: leeg
- Reference int     Het kenmerk van de gekoppelde dienst
Verplichte velden: Identifier of OrderCode en OrderLines (minimaal 1)

Voorbeeld invoer:
<?php

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

$api = new WeFactAPI();

$orderLineParams = array(
					'OrderCode' 		=> 'B0001',
					
					'OrderLines' 		=> array(
						array(
							'Description'	=> 'Additional fee',
							'PriceExcl'	=> 50
						)
					)
);

$response = $api->sendRequest('orderline', 'add', $orderLineParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => orderline
    [action] => add
    [status] => success
    [date] => 2016-09-01T12:00:00+02:00
    [success] => Array
        (
            [0] => Er zijn 1 bestelregels toegevoegd
        )

    [order] => Array
        (
            [Identifier] => 1
            [OrderCode] => B0001
            [Debtor] => 1
            [Date] => 2016-07-14 14:10:51
            [Term] => 14
            [AmountExcl] => 205.00
            [AmountTax] => 43.05
            [AmountIncl] => 248.05
            [Discount] => 0
            [VatCalcMethod] => excl
            [IgnoreDiscount] => no
            [Coupon] => 
            [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
            [Authorisation] => no
            [PaymentMethod] => 
            [Paid] => 0
            [TransactionID] => 
            [IPAddress] => 
            [Comment] => 
            [Status] => 0
            [OrderLines] => Array
                (
                    [0] => Array
                        (
                            [Identifier] => 1
                            [Date] => 2016-07-14
                            [Number] => 1
                            [ProductCode] => 
                            [Description] => Setupfee
                            [PriceExcl] => 150
                            [TaxPercentage] => 21
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [Periods] => 1
                            [Periodic] => 
                            [ProductType] => 
                            [Reference] => 0
                            [NoDiscountAmountIncl] => 181.50
                            [NoDiscountAmountExcl] => 150.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                    [1] => Array
                        (
                            [Identifier] => 2
                            [Date] => 2016-07-14
                            [Number] => 1
                            [ProductCode] => 
                            [Description] => Second product
                            [PriceExcl] => 5
                            [TaxPercentage] => 21
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [Periods] => 1
                            [Periodic] => 
                            [ProductType] => 
                            [Reference] => 0
                            [NoDiscountAmountIncl] => 6.05
                            [NoDiscountAmountExcl] => 5.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                    [2] => Array
                        (
                            [Identifier] => 3
                            [Date] => 2017-01-16
                            [Number] => 1
                            [ProductCode] => 
                            [Description] => Additional fee
                            [PriceExcl] => 50
                            [TaxPercentage] => 21
                            [DiscountPercentage] => 0
                            [DiscountPercentageType] => line
                            [Periods] => 1
                            [Periodic] => 
                            [ProductType] => 
                            [Reference] => 0
                            [NoDiscountAmountIncl] => 60.50
                            [NoDiscountAmountExcl] => 50.00
                            [DiscountAmountIncl] => 0.00
                            [DiscountAmountExcl] => 0.00
                        )

                )

            [Created] => 2016-09-01 12:00:00
            [Modified] => 2016-09-01 12:00:00
            [Translations] => Array
                (
                    [Country] => Nederland
                    [InvoiceMethod] => Per e-mail
                    [Template] => Factuur
                    [PaymentMethod] => 
                    [Status] => Ontvangen
                )

            [AmountDiscount] => 0.00
            [AmountDiscountIncl] => 0.00
            [UsedTaxrates] => Array
                (
                    [0.21] => Array
                        (
                            [AmountExcl] => 205.00
                            [AmountTax] => 43.05
                            [AmountIncl] => 248.05
                        )

                )

        )

)