Wrapper for the '/sales' API. Please note that the Sales service might not be present in all servers.
List of all options:
...
Initialize service
Code Block |
---|
| TrivoreID sdk = TrivoreID.mgmtApiClient();
SalesServiceImpl salesService = new SalesServiceImpl(sdk.salesService());
|
|
Catalog management
Code Block |
---|
// get page with first five catalogs with the ownerId '1234'
Filter filter = Filter.equal("ownedId", "1234");
Page<Catalog> page = salesService.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 = salesService.createCatalog(catalog);
// update catalog
catalog.getCustomFields().put("key1", "value");
catalog.getCustomFields().put("key2", 2);
catalog = salesService.updateCatalog(catalog);
// get catalog
catalog = salesService.getCatalog(catalog.getId());
// delete catalog
salesService.deleteCatalog(catalog.getId()); |
|
...