target = context.getApi().getPricingApi().createCostCode(target);
if (defaultPrices != null && !defaultPrices.isEmpty()) {
CostCodeCurrenciesDto costcodecurrencies = new CostCodeCurrenciesDto();
for (CostCodePrice ccp : defaultPrices) {
CostCodeCurrencyDto costcodecurrency = new CostCodeCurrencyDto();
Currency currency = ccp.getCurrency();
costcodecurrency.addLink(new RESTLink("currency", currency.unwrap().getEditLink().getHref()));
costcodecurrency.setPrice(ccp.getPrice());
costcodecurrencies.add(costcodecurrency);
}
context.getApi().getPricingApi().updateCostCodeCurrencies(getId(), costcodecurrencies);
}