Products Service (java)

Wrapper for the '/products' API. Please note that the Sales service might not be present in all servers.

List of all options:

Initialize service

TrivoreID sdk = TrivoreID.mgmtApiClient(); ProductsServiceImpl productsService = new ProductsServiceImpl(sdk.productsService());

Catalog management

// get page with first five catalogs with the ownerId '1234' Filter filter = Filter.equal("ownedId", "1234"); Page<Catalog> page = productsService.getAllCatalogs(new Criteria(filter, 0, 5)); // create new catalog Catalog catalog = new Catalog(); catalog.setOwnerId("1234"); catalog.setName("Example Catalog"); // the function returns catalog object with the generated id catalog = productsService.createCatalog(catalog); // update catalog catalog.getCustomFields().put("key1", "value"); catalog.getCustomFields().put("key2", 2); catalog = productsService.updateCatalog(catalog); // get catalog catalog = productsService.getCatalog(catalog.getId()); // delete catalog productsService.deleteCatalog(catalog.getId());

Pricing plan management

// get page with first five pricing plans that are enabled Filter filter = Filter.equal("enabled", true); Page<PricingPlan> page = productsService.getAllPricingPlans(new Criteria(filter, 0, 5)); // create new pricing plan PricingPlan pricingPlan = new PricingPlan(); pricingPlan.setOwnerId("1234"); pricingPlan.setTitle("Example Title"); // the function returns pricing plan object with the generated id pricingPlan = productsService.createPricingPlan(pricingPlan); // update pricing plan pricingPlan.getCustomFields().put("key1", "value"); pricingPlan.getCustomFields().put("key2", 2); pricingPlan = productsService.updatePricingPlan(pricingPlan); // get pricing plan pricingPlan = productsService.getPricingPlan(pricingPlan.getId()); // delete pricing plan productsService.deletePricingPlan(pricingPlan.getId());

Product management

Catalog and Item details

Service models

Catalog

CatalogItem

PricingPlan

Pricing

CodeDiscount

CustomerSegementDiscount

PaymentMethodDiscount

VariableDiscount

VolumeDiscount

Product

Validity

AllCatalogs

CatalogDetails

ProductDetails

PriceEvaluation

DiscountInfo

LocalisedDescription