HostFact API versie 3.1



Domain

Domeinnamen zijn te beheren via de controller 'domain'.



add

Middels deze functie is het mogelijk een domeinnaam toe te voegen.
Voorbeeldbestand: /voorbeelden/domain/domain.add.php


Invoerparameters:
Veldnaam Waarde Omschrijving
Domain string Domeinnaam (zonder extensie)
Tld string Extensie
Registrar int De unieke ID van een registrar
Debtor int De unieke ID van een debiteur
DebtorCode string Het debiteurnummer
HostingID int De unieke ID van een hosting account
DirectServerCreation 'yes' of 'no' Indien domeinnaam gekoppeld wordt aan bestaand hosting account ('HostingID' ingevuld), moet deze additionele domeinnaam ook doorgegeven worden aan de hosting server? Standaard: 'no'
RegistrationDate date Registratiedatum
ExpirationDate date Verloopdatum
AuthKey string Autorisatiecode
DNS1 string Nameserver 1
DNS2 string Nameserver 2
DNS3 string Nameserver 3
DNSTemplate int ID van een DNS template, ID's kunnen opgehaald worden via de listdnstemplates functie. Alleen beschikbaar als de module 'DNS beheer' geactiveerd is.
OwnerHandle int Houder contact: unieke ID van een contact
AdminHandle int Administratief contact: unieke ID van een contact
TechHandle int Technisch contact: unieke ID van een contact
Comment string Opmerking
Status int Domeinnaam 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
Verplichte velden: Debtor of DebtorCode, Domain en Tld.
Bij facturatie (HasSubscription = yes): ProductCode of bij geen ProductCode zijn Description en PriceExcl verplicht

* Indien geen nameservers mee worden gegeven, wordt gekeken of de debiteur voorkeursnameservers heeft, anders van server indien een hostingaccount, anders registrar nameservers.

Voorbeeld invoer:
<?php

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

$api = new HostFactAPI();

$domainParams = array(
					'DebtorCode' 	=> 'DB0001',
					'Domain'		=> 'example',
					'Tld'			=> 'com',
					'Registrar'			=> 1,
					
					'HasSubscription'	=> 'yes',
					'Subscription'	=> array(
											'ProductCode'	=> 'P003'
											)
);

$response = $api->sendRequest('domain', 'add', $domainParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => domain
    [action] => add
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [warning] => Array
        (
            [0] => De domeinnaam example.com bestaat al in HostFact
        )

    [domain] => Array
        (
            [Identifier] => 3
            [Domain] => example
            [Tld] => com
            [Debtor] => 1
            [DebtorCode] => DB0001
            [HostingID] => 0
            [Status] => 1
            [RegistrationDate] => 
            [ExpirationDate] => 
            [Registrar] => 1
            [DNS1] => ns1.example.com
            [DNS2] => ns2.example.com
            [DNS3] => 
            [DNS1IP] => 
            [DNS2IP] => 
            [DNS3IP] => 
            [DNSTemplate] => 0
            [OwnerHandle] => 1
            [AdminHandle] => 1
            [TechHandle] => 1
            [DomainAutoRenew] => on
            [Comment] => 
            [Created] => 2022-11-24 11:00:00
            [Modified] => 2022-11-24 11:00:00
            [RegistrarInfo] => Array
                (
                    [Identifier] => 1
                    [Class] => registrarclass
                    [Name] => Example registrar
                    [Testmode] => 1
                    [DefaultDNSTemplate] => 0
                    [AdminHandle] => 0
                    [TechHandle] => 0
                )

            [Subscription] => Array
                (
                    [Number] => 1
                    [NumberSuffix] => 
                    [ProductCode] => P003
                    [Description] => Domain example.com
                    [PriceExcl] => 15
                    [PriceIncl] => 18.15
                    [TaxPercentage] => 21
                    [DiscountPercentage] => 0
                    [Periods] => 1
                    [Periodic] => j
                    [StartPeriod] => 2022-11-24
                    [EndPeriod] => 2023-11-24
                    [NextDate] => 2022-11-10
                    [ContractPeriods] => 1
                    [ContractPeriodic] => j
                    [StartContract] => 2022-11-24
                    [EndContract] => 2023-11-24
                    [TerminationDate] => 
                    [Reminder] => 
                    [InvoiceAuthorisation] => yes
                    [AmountExcl] => 15
                    [AmountIncl] => 18.15
                )

            [Translations] => Array
                (
                    [RegistrarName] => Example registrar
                    [Status] => Wachten op actie
                )

        )

)