Developer forum

Forum » Dynamicweb 10 » Management Api: PriceById

Management Api: PriceById

Anders Ebdrup
Reply

Hello,

 

I am trying to update a price with the management api, but I am stuck as I cannot fetch the existing price with a query like this: https://www.example.com/Admin/Api/PriceById?Id=PRICE5&Type=PriceById, as returns an error:

An item with the same key has already been added. Key: PRICE5

Because we have prices in both DKK and EUR, so how do I limit the query to return a currency specific price?

 

Best regards, Anders


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Thats a bug

22913

https://dev.azure.com/dynamicwebsoftware/Dynamicweb/_workitems/edit/22913

 
Anders Ebdrup
Reply

Thanks for quick response, Nicolai! I hope that this will solve my problem with updating prices as well.

Best regards, Anders

 
Kristian Elmholt Kjær Dynamicweb Employee
Kristian Elmholt Kjær
Reply

Hi Anders,

I'm currently looking into this solving this bug. I'll keep you posted when I know more.

/Kristian

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Anders

The bugfix to this problem will be that we change the primary key on the database to only be priceid and not the combination of priceid and currency. The UI has never supported both and the API already expects priceid to be unique.

The solution we will roll out will remove duplicates by adding currency code to priceid if needed and then we will remove currency from the key.

You can already make these steps on the database or simply remove duplicate entries (same priceid) from the database. 

 

You must be logged in to post in the forum