HostFact API versie 3.1
Overige diensten
Overige diensten zijn te beheren via de controller 'service'.
add
Middels deze functie is het mogelijk een overige dienst (abonnement) toe te voegen.
Voorbeeldbestand: /voorbeelden/service/service.add.php
Invoerparameters:
| Veldnaam | Waarde | Omschrijving |
|---|---|---|
| Debtor | int | De unieke ID van een debiteur |
| DebtorCode | string | Het debiteurnummer |
| Subscription | array | Abonnementsregel: |
| - Number | float | Aantal. Standaard: 1 |
| - NumberSuffix | string | Eenheid bijvoorbeeld: uur |
| - ProductCode | string | Het productnummer |
| - Description | text | Omschrijving |
| - PriceExcl | float | Prijs per stuk (excl. BTW) |
| - TaxPercentage | int | BTW percentage: 0 - 100 |
| - DiscountPercentage | float | Korting abonnement, percentage: 0 - 100 |
| - Periods | int | Factureer iedere: aantal periodes |
| - Periodic | string | Factureer iedere: eenheid, zie variabelen-lijst |
| - StartPeriod | date | Startdatum van de periode |
| - ContractPeriods | int | Afwijkende contractperiode. Aantal van de frequentie eenheid 'ContractPeriodic' |
| - ContractPeriodic | string | Afwijkende contractperiode. Frequentie eenheid, zie variabelen-lijst |
| - StartContract | date | Startdatum afwijkende contractperiode |
| - EndContract | date | Einddatum afwijkende contractperiode |
| - TerminationDate | date | De datum waarop het abonnement opgezegd wordt |
| - Reminder | 'yes', 'no' of '' | E-mail bij nieuwe facturatie van abonnement? Standaard: '' = Algemene instelling overnemen) |
| - InvoiceAuthorisation | 'yes' of 'no' | Automatische incasso? Standaard: 'yes' = voorkeur debtor |
Voorbeeld invoer:
<?php
require_once("../hostfact_api.php");
$api = new HostFactAPI();
$serviceParams = array(
'DebtorCode' => 'DB0001',
'Subscription' => array(
'ProductCode' => 'P001',
'Periods' => 1,
'Periodic' => 'm'
)
);
$response = $api->sendRequest('service', 'add', $serviceParams);
print_r_pre($response);
?>Voorbeeld uitvoer:
Array
(
[controller] => service
[action] => add
[status] => success
[date] => 2022-11-24T12:00:00+02:00
[success] => Array
(
[0] => Dienst is aangemaakt
)
[service] => Array
(
[Identifier] => 12
[Debtor] => 1
[DebtorCode] => DB0001
[Status] => active
[Subscription] => Array
(
[Number] => 1
[NumberSuffix] =>
[ProductCode] => P001
[Description] => Default product
[PriceExcl] => 250
[PriceIncl] => 302.5
[TaxPercentage] => 21
[DiscountPercentage] => 0
[Periods] => 1
[Periodic] => m
[StartPeriod] => 2022-11-24
[EndPeriod] => 2022-12-24
[NextDate] => 2022-11-10
[ContractPeriods] => 1
[ContractPeriodic] => m
[StartContract] => 2022-11-24
[EndContract] => 2022-12-24
[TerminationDate] =>
[Reminder] =>
[InvoiceAuthorisation] => yes
[AmountExcl] => 250
[AmountIncl] => 302.5
)
[Created] => 2022-11-24 11:00:00
[Modified] => 2022-11-24 11:00:00
)
)