HostFact API versie 3.1



Hosting

Hostingaccounts zijn te beheren via de controller 'hosting'.



updowngrade

Met behulp van deze functie is het mogelijk om een hosting account te up- of downgraden.
Voorbeeldbestand: /voorbeelden/hosting/hosting.updowngrade.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Identifier int De unieke ID van een hosting account
Username string De accountnaam (en gebruikersnaam)
Product int De unieke ID van het nieuwe product waar naar geupgrade wordt
ProductCode int Het productnummer van het nieuwe product waar naar geupgrade wordt
Periods int Factureer iedere: aantal periodes.
Standaard: huidig abonnement
Periodic string Factureer iedere: eenheid, zie variabelen-lijst.
Standaard: huidig abonnement
InvoiceCycle 'existing_period'
       of
'new_period'
Bepaalt de financiële afhandeling
Standaard: voorkeursinstelling

existing_period:
De periode tot het volgende facturatiemoment wordt gefactureerd. Daarna zal pas een volledige periode worden gefactureerd.
new_period:
Er wordt direct een volledige (nieuwe) periode gefactureerd. De resterende periode van het vorige abonnement zal in mindering worden gebracht.
CreateInvoice 'yes' of 'no' Dient er direct een factuur aangemaakt te worden?
Standaard: voorkeursinstelling
Verplichte velden: Identifier of Username, Product of ProductCode

Voorbeeld invoer:
<?php

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

$api = new HostFactAPI();

$hostingParams = array(
				'Username'      => 'activeaccount',
                'ProductCode'   => 'P002',
                'Periods'       => 1,
                'Periodic'      => 'm',
                'InvoiceCycle'  => 'new_period',
                'CreateInvoice' => 'yes'
);

$response = $api->sendRequest('hosting', 'updowngrade', $hostingParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => hosting
    [action] => updowngrade
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [success] => Array
        (
            [0] => Factuur [concept]0001 is bewerkt
            [1] => Up-/downgrade van hostingaccount activeaccount is doorgevoerd in HostFact en op de server.
        )

    [hosting] => Array
        (
            [Identifier] => 3
            [Username] => activeaccount
            [Debtor] => 1
            [DebtorCode] => DB0001
            [Domain] => activedomain.com
            [Server] => 1
            [Package] => 1
            [PackageName] => Hosting small
            [Comment] => 
            [Status] => 4
            [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-12-24
                    [EndPeriod] => 2023-01-24
                    [NextDate] => 2022-12-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] => Actief
                )

        )

)