HostFact API versie 3.1
Hosting
Hostingaccounts zijn te beheren via de controller 'hosting'.
add
Middels deze functie is het mogelijk een hosting account toe te voegen.
Voorbeeldbestand: /voorbeelden/hosting/hosting.add.php
Invoerparameters:
Veldnaam | Waarde | Omschrijving |
---|---|---|
Username | string | De accountnaam (en gebruikersnaam) Geef deze parameter niet mee wanneer de accountnaam automatisch bepaald mag worden. |
Debtor | int | De unieke ID van een debiteur |
DebtorCode | string | Het debiteurnummer |
Domain | string | Domeinnaam |
Password | string | Wachtwoord |
Server | int | De unieke ID van een server |
Package | int | De unieke ID van een voorgedefinieerd hostingpakket |
DirectCreation | 'yes' of 'no' | Direct aanmaken op de server? Standard 'no' |
Comment | string | Commentaar |
Status | string | Hostingaccount status, zie variabelen-lijst. Standaard: 1 (wachten op actie) |
HasSubscription | 'yes' of 'no' | Dienst factureren (abonnement)? Standaard: 'no' |
Subscription | array | Abonnement: |
- 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 |
Bij facturatie (HasSubscription = yes): ProductCode of bij geen ProductCode zijn Description en PriceExcl verplicht
Voorbeeld invoer:
<?php require_once("../hostfact_api.php"); $api = new HostFactAPI(); $hostingParams = array( 'DebtorCode' => 'DB0001', 'Username' => 'example2', 'Domain' => 'example2.com', 'Package' => 1, 'HasSubscription' => 'yes', 'Subscription' => array( 'ProductCode' => 'P002' ) ); $response = $api->sendRequest('hosting', 'add', $hostingParams); print_r_pre($response); ?>
Voorbeeld uitvoer:
Array ( [controller] => hosting [action] => add [status] => success [date] => 2022-11-24T12:00:00+02:00 [hosting] => Array ( [Identifier] => 5 [Username] => example2 [Debtor] => 1 [DebtorCode] => DB0001 [Domain] => example2.com [Server] => 1 [Package] => 1 [PackageName] => Hosting small [Comment] => [Status] => 1 [Created] => 2022-11-24 11:00:00 [Modified] => 2022-11-24 11:00:00 [Subscription] => Array ( [Number] => 1 [NumberSuffix] => [ProductCode] => P002 [Description] => Hosting small [PriceExcl] => 25 [PriceIncl] => 30.25 [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] => 25 [AmountIncl] => 30.25 ) [PackageInfo] => Array ( [Identifier] => 1 [Name] => Hosting small [Type] => normal [Template] => yes [TemplateName] => [BandWidth] => [DiscSpace] => [Domains] => [SubDomains] => [Domainpointers] => [MySQLDatabases] => [EmailAccounts] => ) [ServerInfo] => Array ( [Identifier] => 1 [Name] => Example server [Panel] => hostingclass [Location] => https://localhost [Port] => 1234 [IP] => [AdditionalIP] => [Settings] => [DefaultDNSTemplate] => 1 [SSOSupport] => url ) [Translations] => Array ( [Status] => Wachten op actie ) ) )