HostFact API versie 3.1
Producten
Producten zijn te beheren via de controller 'product'.
edit
Met behulp van deze functie is het mogelijk om een product te bewerken.
Alleen ingevoerde parameters worden gewijzigd.
Voorbeeldbestand: /voorbeelden/product/product.edit.php
Invoerparameters:
Veldnaam | Waarde | Omschrijving |
---|---|---|
Identifier | int | De unieke ID van een product |
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( 'Identifier' => '1', 'PriceExcl' => 50.75 ); $response = $api->sendRequest('product', 'edit', $productParams); print_r_pre($response); ?>
Voorbeeld uitvoer:
Array ( [controller] => product [action] => edit [status] => success [date] => 2022-11-24T12:00:00+02:00 [product] => Array ( [Identifier] => 1 [ProductCode] => P002 [ProductName] => Hosting small [ProductKeyPhrase] => Hosting small [ProductDescription] => [NumberSuffix] => [PriceExcl] => 50.75 [PricePeriod] => m [TaxPercentage] => 21 [Cost] => 0 [ProductType] => hosting [ProductTld] => [PackageID] => 1 [HasCustomPrice] => no [CustomPrices] => [Groups] => Array ( [2] => Array ( [id] => 2 [GroupName] => Hosting bestelformulier ) ) [Created] => 2022-11-24 11:00:00 [Modified] => 2022-11-24 11:00:00 [Translations] => Array ( [ProductType] => Webhosting [PricePeriod] => maand ) ) )