HostFact API versie 3.1
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 | Factureer iedere: aantal periodes |
| - Periodic | string | Factureer iedere: 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 |
Voorbeeld invoer:
<?php
require_once("../hostfact_api.php");
$api = new HostFactAPI();
$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] => 2022-11-24T12:00:00+02:00
[success] => Array
(
[0] => Er zijn 1 bestelregels toegevoegd
)
[order] => Array
(
[Identifier] => 1
[OrderCode] => B0001
[Debtor] => 1
[Date] => 2018-01-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] => 2018-01-14
[Number] => 1
[ProductCode] =>
[Description] => Setupfee
[PriceExcl] => 150
[TaxPercentage] => 21
[DiscountPercentage] => 0
[DiscountPercentageType] => line
[Periods] => 1
[Periodic] =>
[ProductType] =>
[Reference] => 0
[NoDiscountAmountIncl] => 181.5
[NoDiscountAmountExcl] => 150
[DiscountAmountIncl] => 0
[DiscountAmountExcl] => 0
)
[1] => Array
(
[Identifier] => 2
[Date] => 2018-01-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
[DiscountAmountIncl] => 0
[DiscountAmountExcl] => 0
)
[2] => Array
(
[Identifier] => 3
[Date] => 2022-11-24
[Number] => 1
[ProductCode] =>
[Description] => Additional fee
[PriceExcl] => 50
[TaxPercentage] => 21
[DiscountPercentage] => 0
[DiscountPercentageType] => line
[Periods] => 1
[Periodic] =>
[ProductType] =>
[Reference] => 0
[NoDiscountAmountIncl] => 60.5
[NoDiscountAmountExcl] => 50
[DiscountAmountIncl] => 0
[DiscountAmountExcl] => 0
)
)
[Created] => 2022-11-24 11:00:00
[Modified] => 2022-11-24 11:00:00
[Translations] => Array
(
[Country] => Nederland
[InvoiceMethod] => Per e-mail
[Template] => Factuur
[PaymentMethod] =>
[Status] => Ontvangen
)
[AmountDiscount] => 0
[AmountDiscountIncl] => 0
[UsedTaxrates] => Array
(
[0.21] => Array
(
[AmountExcl] => 205
[AmountTax] => 43.05
[AmountIncl] => 248.05
)
)
)
)