HostFact API versie 3.1
Bestelling
Bestellingen zijn te beheren via de controller 'order'.
edit
Met behulp van deze functie is het mogelijk om een bestelling te bewerken.
Alleen ingevoerde parameters worden gewijzigd.
Voorbeeldbestand: /voorbeelden/order/order.edit.php
Invoerparameters:
| Veldnaam | Waarde | Omschrijving |
|---|---|---|
| Identifier | int | De unieke ID van een bestelling |
| OrderCode | string | Het bestelnummer Geef deze parameter niet mee wanneer het bestelnummer automatisch bepaald mag worden. |
| Debtor | int | De unieke ID van een debiteur |
| DebtorCode | string | Het debiteurnummer |
| Date | datetime | De datum van de bestelling |
| Term | int | Betaaltermijn in dagen |
| Discount | float | Korting (totale factuur): percentage 0 - 100 |
| IgnoreDiscount | '0' of '1' | Kortingsmodule negeren (0 = nee en 1 = ja) Standaard: 0 |
| Coupon | string | Kortings actiecode/coupon |
| VatCalcMethod | 'excl' of 'incl' | BTW rekenen op basis van exclusief of inclusief BTW? Standaard: gebruikt administratie instelling |
| CompanyName | string | Debiteur: bedrijfsnaam |
| Sex | 'm', 'f', 'd' of 'u' | Debiteur: geslacht. Standaard: 'm' |
| Initials | string | Debiteur: voornaam |
| SurName | string | Debiteur: achternaam |
| Address | string | Debiteur: adres |
| ZipCode | string | Debiteur: postcode |
| City | string | Debiteur: plaats |
| Country | string | Debiteur: land, zie variabelen-lijst |
| EmailAddress | string | Debiteur: e-mailadres |
| InvoiceMethod | int | Factuur verzendmethode, zie variabelen-lijst. Standaard: voorkeur debiteur |
| Template | int | Factuur template ID. Standaard: debiteur instelling |
| Authorisation | 'yes' of 'no' | Automatische incasso, standaard: voorkeur debiteur |
| Paid | '0' of '1' | Is de bestelling betaald (0 = nee en 1 = ja) Standaard: 0 |
| PaymentMethod | string | Betaalmethode hoe de bestelling is betaald, zie variabelen-lijst |
| TransactionID | string | Transactie ID van (online) betaling |
| IPAddress | string | IP-adres van debiteur |
| Comment | text | Opmerking |
| Status | int | Bestelstatus, zie variabelen-lijst. Standaard: 0 (Ontvangen) |
| OrderLines | array | Bestelregel: |
| - Identifier | int | De unieke ID van een regel |
| - 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 |
| - DiscountPercentageType | 'line' of 'subscription' | Type korting (enkel bestelregel of later ook voor abonnement) |
| - 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 |
| - ProductType | string | Gekoppelde dienst: domain, hosting of ssl. Standaard: leeg |
| - Reference | int | Het kenmerk van de gekoppelde dienst |
* Debiteurgegevens worden automatisch ingevuld door de variabele 'Debtor' of 'DebtorCode'.
** Factuurregel: Indien 'ProductCode' wordt meegegeven worden automatisch de 'Description', 'PriceExcl', 'TaxPercentage', 'PeriodicType', 'Periods', 'Periodic' en 'StartPeriod' ingevuld.
Voorbeeld invoer:
<?php
require_once("../hostfact_api.php");
$api = new HostFactAPI();
$orderParams = array(
'Identifier' => 1,
'OrderLines' => array(
array(
'Identifier' => 1,
'Description' => 'Free domain example.com',
'PriceExcl' => 0
)
)
);
$response = $api->sendRequest('order', 'edit', $orderParams);
print_r_pre($response);
?>Voorbeeld uitvoer:
Array
(
[controller] => order
[action] => edit
[status] => success
[date] => 2022-11-24T12:00:00+02:00
[order] => Array
(
[Identifier] => 1
[OrderCode] => B0001
[Debtor] => 1
[Date] => 2018-01-14 14:10:51
[Term] => 14
[AmountExcl] => 5.00
[AmountTax] => 1.05
[AmountIncl] => 6.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] => Free domain example.com
[PriceExcl] => 0
[TaxPercentage] => 21
[DiscountPercentage] => 0
[DiscountPercentageType] => line
[Periods] => 1
[Periodic] =>
[ProductType] =>
[Reference] => 0
[NoDiscountAmountIncl] => 0
[NoDiscountAmountExcl] => 0
[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
)
)
[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] => 5
[AmountTax] => 1.05
[AmountIncl] => 6.05
)
)
)
)