Developer forum

Forum » Development » DWAPI - Get product category fields from product variant

DWAPI - Get product category fields from product variant

Nicolai Jessen
Nicolai Jessen
Reply

Hi,

I'm looking into the dwapi, more specifically product variants - /dwapi/ecommerce/variants/{productId}
The solution runs a DW 9.13.5
Is it possible to get the product category fields for the variant and if so, how? Can't seem to find them or am i looking at the wrong endpoint?

Thanks!


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply
This post has been marked as an answer

Hi Nicolai

 /dwapi/ecommerce/variants/{productId} gives you a list of variants available for a given product - in a variantinfoviewmodel

To get the entire product record, try the /dwapi/ecommerce/products/{id}/{variantId} endpoint

Votes for this answer: 1
 
Nicolai Jessen
Nicolai Jessen
Reply

Hi Nicolai,

Thanks for the reply, seems to work as intended :-)

Though I get this response/error (attached file) if I don't specify CurrencyCode and CountryCode - is this the intented behaviour / are these required? 

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

That is an error - and we have fixed it in later versions so it fall back to default. What version are you using?

 
Nicolai Jessen
Nicolai Jessen
Reply

DW 9.13.5 and
Dynamicweb API 0.14.6

 

You must be logged in to post in the forum