HostFact API versie 3.1



Groepen

Debiteurgroepen, crediteurgroepen en productgroepen zijn te beheren via de controller 'group'.



add

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


Invoerparameters:
Veldnaam Waarde Omschrijving
GroupName string Groepnaam
Type 'debtor', 'creditor' of 'product' Type groep.
Items array array met ID's van de onderdelen die in de groep zitten.
Verplichte velden: Type

Voorbeeld invoer:
<?php

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

$api = new HostFactAPI();

$groupParams = array(
	'GroupName'  => 'Productgroep 1',
	'Type' 		=> 'product',
	'Items'     => array('1')
);

$response = $api->sendRequest('group', 'add', $groupParams);

print_r_pre($response);

?>

Voorbeeld uitvoer:
Array
(
    [controller] => group
    [action] => add
    [status] => success
    [date] => 2022-11-24T12:00:00+02:00
    [success] => Array
        (
            [0] => Productgroep 'Productgroep 1' is aangemaakt
        )

    [group] => Array
        (
            [Identifier] => 5
            [GroupName] => Productgroep 1
            [Type] => product
            [Items] => Array
                (
                    [1] => Array
                        (
                            [Identifier] => 1
                            [ProductCode] => P002
                            [ProductName] => Hosting small
                        )

                )

        )

)