HostFact API versie 3.1
Producten
Producten zijn te beheren via de controller 'product'.
add
Middels deze functie is het mogelijk een product toe te voegen.
Voorbeeldbestand: /voorbeelden/product/product.add.php
Invoerparameters:
Veldnaam | Waarde | Omschrijving |
---|---|---|
ProductCode | string | Het productnummer Geef deze parameter niet mee wanneer het productnummer automatisch bepaald mag worden. |
ProductName | string | Productnaam |
ProductKeyPhrase | text | Omschrijving op factuur |
ProductDescription | text | Uitgebreide (interne) omschrijving |
NumberSuffix | string | Eenheid bijvoorbeeld: Kg. |
PriceExcl | float | Prijs per stuk (excl. BTW) |
PricePeriod | string | Zie variabelen-lijst. Standaard: '' (= eenmalig) |
TaxPercentage | float | BTW percentage: 0 - 100 |
ProductType | string | Producttype: domain|hosting|other(|ssl|vps). Standaard: other |
ProductTld | ProductTld | Domein extensie |
Groups | array | array met ID's van productgroepen of lege string voor geen productgroepen |
HasCustomPrice | 'no' of 'period' | Gebruik afwijkende prijzen bij verschillende periodes. Standaard: no |
CustomPrices | array | Afwijkende prijzen & periodes |
- Periods | int | Factureer iedere: aantal periodes |
- Periodic | string | Factureer iedere: eenheid, zie variabelen-lijst |
- PriceExcl | float | Prijs per stuk (excl. BTW) |
- PriceIncl | float | Prijs per stuk (incl. BTW) |
Voorbeeld invoer:
<?php require_once("../hostfact_api.php"); $api = new HostFactAPI(); $productParams = array( 'ProductName' => 'Product 1', 'ProductKeyPhrase' => 'Product decription for invoice', 'PriceExcl' => '100' ); $response = $api->sendRequest('product', 'add', $productParams); print_r_pre($response); ?>
Voorbeeld uitvoer:
Array ( [controller] => product [action] => add [status] => success [date] => 2022-11-24T12:00:00+02:00 [product] => Array ( [Identifier] => 6 [ProductCode] => P006 [ProductName] => Product 1 [ProductKeyPhrase] => Product decription for invoice [ProductDescription] => [NumberSuffix] => [PriceExcl] => 100 [PricePeriod] => [TaxPercentage] => 21 [Cost] => 0 [ProductType] => other [ProductTld] => [PackageID] => 0 [HasCustomPrice] => no [CustomPrices] => [Groups] => Array ( ) [Created] => 2022-11-24 11:00:00 [Modified] => 2022-11-24 11:00:00 [Translations] => Array ( [ProductType] => Algemeen [PricePeriod] => eenmalig ) ) )